Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Layout woes(SWT Layout)
Layout woes [message #674531] Fri, 27 May 2011 05:23 Go to next message
Eclipse UserFriend
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 14:34 Go to previous message
Eclipse UserFriend
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

[Updated on: Tue, 31 May 2011 14:34] by Moderator

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


Current Time: Fri Jul 04 21:12:36 EDT 2025

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

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

Back to the top