Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Solving layout problems using grid column count and other properties
Solving layout problems using grid column count and other properties [message #579647] Tue, 30 March 2010 11:49
Alex Schroeder is currently offline Alex Schroeder
Messages: 38
Registered: February 2010
Location: Z├╝rich, Switzerland
Member

Somebody just came to my desk and asked me how to achieve the following layout for a prototype they're doing for a customer.


+-Dialog---------------------------------------------------- ------------------+
| +-Anonymous Group------------------------------------------------------- --+ |
| | +-------------------+ +---------------------+ | |
| | Field 1 | | Field 2 | | | |
| | +-------------------+ +---------------------+ | |
| +----------------------------------------------------------- --------------+ |
| +-Column 1-----------------------+ +-Column 2-----------------------------+ |
| | +-----------------+ | | +---------------------+ | |
| | Field 3 | | | | Field 6 | | | |
| | +-----------------+ | | +---------------------+ | |
| | +-----------------+ | | +---------------------+ | |
| | Field 4 | | | | Field 7 | | | |
| | +-----------------+ | | +---------------------+ | |
| | +-----------------+ | +--------------------------------------+ |
| | Field 5 | | | +-----------------------+ |
| | +-----------------+ | Field 8 | | |
| +--------------------------------+ +-----------------------+ |
| |
| +--------+ +---------+ |
| | Ok | | Cancel | |
| +--------+ +---------+ |
+----------------------------------------------------------- ------------------+

Here's how:



Anonymous Group is just a group box with no name with type TopGroup or whatever takes your fancy.
Column 1 is a another group box with Grid Column Count 1 because we want Fields 3, 4, and 5 to be in a single column.
Column 1 also has a Grid W of 1 because it takes up one column on the dialog.
Column 1 also has a Grid H of at least 3 because that's how many rows it takes in the layout. The framework will accept larger values, but smaller values or the default lead to breakage.
Column 2 same thing: Grid Column Count 1, Grid W 1, Grid H at least 2.


I'm still not quite happy with the alignment on pixel-level. It's good enough for a prototype. What do you think, are those small misalignments worth a bug report?

(Personally I also think that it's bad style to leave Field 8 outside a frame, but that's what the spec of the prototype said, so I'm not going to argue. They still have time to see the errors of their ways!) :)
Previous Topic:Solving layout problems using grid column count and other properties
Next Topic:AbstractComposerAttribute.getConfiguredStatement
Goto Forum:
  


Current Time: Thu Jul 24 00:22:03 EDT 2014

Powered by FUDForum. Page generated in 0.02156 seconds