Slick Forums

Discuss the Slick 2D Library
It is currently Wed May 22, 2013 7:31 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Align in a dialoglayout
PostPosted: Wed Feb 01, 2012 10:37 am 
Offline

Joined: Sun Dec 25, 2011 4:51 pm
Posts: 22
Hello, Matthias,

I used next code to place controls within dialog:
Code:
        setVerticalGroup(createSequentialGroup()
                .addWidget(title)
                .addGroup(createParallelGroup(lWidth, efWidth))
                .addGroup(createParallelGroup(lHeight, efHeight))
                .addGroup(createParallelGroup(bCancel, bOk)));

        Group col1 = createParallelGroup().addWidget(lWidth, Alignment.RIGHT).addWidget(lHeight, Alignment.RIGHT);
        Group col2 = createParallelGroup().addWidget(efWidth, Alignment.RIGHT).addWidget(efHeight, Alignment.RIGHT);


        setHorizontalGroup(createParallelGroup()
                .addWidget(title, Alignment.CENTER)
                .addGroup(createSequentialGroup().addGroup(col1).addGroup(col2))
                .addGroup(createSequentialGroup().addWidget(bCancel, Alignment.RIGHT).addWidget(bOk, Alignment.RIGHT)));


But in the end i get slightly misaligned picture (please look at the attached screenshot). How should i change the code to get:
- left and right borders by the biggest label (top), so edit fields and button "OK" aligned to right, labels "height", "width" and the button "Cancel" to left;
-edit fields at the right is aligned to the button "ok" (now the button has shift to the right)?

Thanks!


Attachments:
screenshot.png
screenshot.png [ 10.62 KiB | Viewed 293 times ]
Top
 Profile  
 
PostPosted: Wed Feb 01, 2012 6:31 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1172
From your code it looks correct. Maybe your themes contain a (soft) border? Could you try with simple solid background colors?

Also the widget alignment only applies to widgets which can't grow (eg they have max width/height = 0 or the required width/height is > max width/height).

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Thu Feb 02, 2012 1:05 pm 
Offline

Joined: Sun Dec 25, 2011 4:51 pm
Posts: 22
Matthias,

I've checked the theme and all widgets have (so they can't grow)

<param name="maxWidth"><int>0</int></param>
<param name="maxHeight"><int>0</int></param>

When i loaded classpath into the themeEditor it looks the same as in my programm.
How can i check softborder ?

Thanks in advance.


Top
 Profile  
 
PostPosted: Fri Feb 03, 2012 5:20 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1172
By temporary changing your theme to use solid background colors (a different one for each widget).
Or use the Theme Editor and it's highlight widget button (the red rectangle at the bottom of the top right pane).

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group