PDA

View Full Version : Ext Designer Button Alignment



adhoul
13 May 2010, 1:17 AM
Hello,

Lets suppose we have a panel and inside it there are two buttons, is there a way to align these buttons and place them in (let's say) the center of the panel?

Thank you

jarrednicholls
13 May 2010, 10:26 AM
Hi adhoul,

You can set the Panel's layout to "hbox", which will make the buttons lay themselves out horizontally next to each other. Setting the layout option 'pack' to 'center' will center the buttons horizontally. Setting the option 'align' to 'middle' will center the buttons vertically. You can then individually set each button's width/flex and margins to size them and space them out accordingly.

Let me know if that makes sense. Keep in mind you can create nested containers to combine different layouts together to get the exact layout you want.

adhoul
14 May 2010, 2:14 AM
yes it makes perfect sense thank you. also what i've found is that Let's say we have a Panel, inside it we place a toolbar with buttons, then we select on the Panel to ButtonAlign "center" so we achieve the same result, which is basically what you mention in the last part of your message I think..