Kirix Support Forums

form layout

Please post any help questions, requests or other feedback here.

form layout

Postby abenitez77 on Wed Jun 27, 2012 12:42 pm

I want to put some of my buttons to the right of the labels. how can I do this in my layout below?

var layout_col1 = new BoxLayout(Layout.Vertical);
layout_col1.addSpacer(8);
layout_col1.add(createControlTitle("Existing Projects"), 0, Layout.Bottom, 4);
layout_col1.add(line3);
layout_col1.addSpacer(16);
layout_col1.add(createControlTitle(" Clients "), 0, Layout.Bottom, 4);
layout_col1.add(choiceboxClients, 0, Layout.Bottom, 4);
layout_col1.addSpacer(4);
layout_col1.add(createControlTitle(" Audit Year "), 0, Layout.Bottom, 4);
layout_col1.add(choiceboxAuditYear, 0, Layout.Bottom, 4);
layout_col1.addSpacer(4);
layout_col1.add(createControlTitle(" Projects "), 0, Layout.Bottom, 4);
layout_col1.add(choiceboxProjects, 0, Layout.Bottom, 4);
layout_col1.addSpacer(48);


// create second column layout
var layout_col2 = new BoxLayout(Layout.Vertical);
layout_col2.addSpacer(30);
layout_col2.add(createControlTitle("Projects List"), 0, Layout.Bottom, 4);
layout_col2.add(m_list);
layout_col2.addSpacer(20);

layout_col1.add(line5);
layout_col1.addSpacer(20);
layout_col1.add(createControlTitle("Add to Existing Project Above"), 0, Layout.Bottom, 4);
layout_col1.add(line2);
layout_col1.addSpacer(16);
layout_col1.add(createControlTitle(" Server Name "), 0, Layout.Bottom, 4);
layout_col1.add(ServerName);
layout_col1.addSpacer(16);
layout_col1.add(createControlTitle(" DataBase Name "), 0, Layout.Bottom, 4);
layout_col1.add(DataBaseName);
layout_col1.addSpacer(16);
layout_col1.add(createControlTitle(" Table Name "), 0, Layout.Bottom, 4);
layout_col1.add(TableName);
layout_col1.addSpacer(16);
layout_col1.add(createControlTitle("Add to Existing Info"), 0, Layout.Bottom, 4);
layout_col1.add(button, 0, Layout.Bottom, 4);
layout_col1.addSpacer(36);
layout_col1.add(createControlTitle(" Remove DB/Table "), 0, Layout.Bottom, 4);
layout_col1.add(ButtonRemoveDB, 0, Layout.Bottom, 4);
layout_col1.addSpacer(24);

// create main layout
var main_layout = new BoxLayout(Layout.Horizontal);
main_layout.addSpacer(8);
main_layout.add(layout_col1, 1, Layout.Expand);
main_layout.addSpacer(4);
main_layout.add(layout_col2, 2, Layout.Expand);

setLayout(main_layout);
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Re: form layout

Postby Ben on Tue Jul 03, 2012 11:04 am

Hello,

You have to create a separate horizontal layout (I usually call them button_layout). You would then add this horizontal layout to your main vertical layout.

Just as an example:

Code: Select all
        var horizontal_layout = new BoxLayout(Layout.Horizontal);
        layout.add(label_ctrl, 1, Layout.Expand);
        layout.add(button_ctrl, 1, Layout.Expand);
       
        main_veritical_layout.add(horizontal_layout, 1, Layout.Expand, 8);



All the best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to Strata Help & Feedback