Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Layout woes(SWT Layout)
Layout woes [message #674531] Fri, 27 May 2011 09:23 Go to next message
clive.quinn is currently offline clive.quinnFriend
Messages: 2
Registered: May 2011
Junior Member
Hi,

I am trying to achieve the following using swt in a small dialog.
I want x amount of radio buttons and each radio button has an associated amount of controls.
For example:

(1) RadioButton1 Label Spinner
(2) RadioButton2 Label Spinner Label Spinner
(3) RadioButton3 Many checkboxes(max 31 as in days of month)

Now i have managed to layout this where the RadioButtons are part of a root composite and then the controls are layed out in a new composite on the next line.

Example:
(1) RadioButton1 (Within composite named root with GridLayout(1, false)
Label Spinner (Within subcomposite of root with GridLayout(2, false)
(2) RadioButton2 (Within composite named root with GridLayout(1, false)
Label Spinner Label Spinner
(Within subcomposite of root with GridLayout(4, false)
(3) RadioButton3 (Within composite named root with GridLayout(1, false)
Many checkboxes(max 31 as in days of month)

(Within subcomposite of root with GridLayout(12, false) (So controls wrap)

But i would like to lay this out so that the radio button and associated controls are all on the same line. I obviously want to preserve the radio buttons in the same composite so that i get the radio button selection behaviour.
Can anyone give me any tips as to how i might approach this so that the layout looks nice.

Thanks
Clive
Re: Layout woes [message #675526 is a reply to message #674531] Tue, 31 May 2011 18:34 Go to previous message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
Hi,

In your example, setting the layout of the root composite to GridLayout(2, false) instead of GridLayout(1, false) should display the radio button and the associated controls in the same line.
Also see --> Eclipse Corner Article on Understanding Layouts
Few example snippets on using GridLayout --> http://eclipse.org/swt/snippets/#gridlayout


Lakshmi P Shanmugam

[Updated on: Tue, 31 May 2011 18:34]

Report message to a moderator

Previous Topic:System Tray widget an the Unity Desktop
Next Topic:Vertical ToolBar
Goto Forum:
  


Current Time: Tue Apr 16 23:02:50 GMT 2024

Powered by FUDForum. Page generated in 0.60674 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top