Kirix Support Forums

form layout

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

form layout

Postby abenitez77 on Mon Mar 14, 2011 9:08 am

I am having trouble resizing and formatting my form. I have 2 columns and I want the column on the left (col1) to be more narrow than the column on the right (col2). How do I resize the columns individually? Also, How do I put 2 text boxes next to each other? with the titles above them?


function ControlsForm()
{
super("Controls Form", 0, 0, 600, 640);
setMinSize(600, 640);

// create a progress bar and set the member variable
// to the newly created progress bar
m_progressbar = new ProgressBar(0,0,0,20);
m_progressbar.setValue(0);
m_progressbar.setMaximum(100);


// create all controls
var borderbox = new BorderBox("Connection",1,1,350,150);
var button = new Button(" Connect To Server ");
var button2 = new Button(" Retrieve Table Names ");
var button3 = new Button(" Execute TSQL ");
//var button4 = new Button(" Enter TSQL Code ");
var button5 = new Button(" Get FieldNames ");
checkbox = new CheckBox(" SQL Output Table ");
checkbox2 = new CheckBox(" Kirix Output Table ");
checkbox.setValue(true);

//button.click.connect(this, onConnectToServer);
var label = new Label("Label");
var line = new Line(0,0,0,300);
listbox = new ListBox(1,1,300,100);
listbox2 = new ListBox(1,1,300,100);
//var picturebox = new PictureBox;
//var progressbar = new ProgressBar;
textbox = new TextBox("",1,1,200);
// textbox2 is sql box
//textbox2 = new TextBox("",1,1,350,100);
//textbox2.setMultiline();
textbox3 = new TextBox("",1,1,140);
choicebox = new ChoiceBox;
sqlcriteria = new TextBox("",1,1,140);


button.click.connect(this, onButtonClicked);
button2.click.connect(this, onButton2Clicked);
button3.click.connect(this, onButton3Clicked);
//button4.click.connect(this, onButton4Clicked);
button5.click.connect(this, onButton5Clicked);
Console.clear();

// var bmp = Bitmap.loadFile("\\usatl02eras40\Audit Strategy\ASTRATEGY\Projects\Kstrata\PRGX_Logo_small.jpg");
// var width = bmp.getWidth();
// var height = bmp.getHeight();

//super("Startup Picture", 1, 1, width-20, height);
//this.center();

// picturebox = new picturebox(0, 0, width, height-70);
// picturebox.setImage(bmp);
// this.add(picturebox);

// create first column layout
var layout_col1 = new BoxLayout(Layout.Vertical);
layout_col1.addSpacer(48);

// layout_col1.add(createControlTitle("PictureBox"), 0, Layout.Bottom, 4);
// layout_col1.add(picturebox);
// layout_col1.addSpacer(64);

// layout_col1.addSpacer(16);
// layout_col1.add(createControlTitle("Connection"), 0, Layout.Bottom, 0);
// layout_col1.add(borderbox);
// layout_col1.addSpacer(16);

layout_col1.add(createControlTitle("Retrieve DB Names"), 0, Layout.Bottom, 4);
layout_col1.add(button, 0, Layout.Bottom, 4);
layout_col1.addSpacer(32);
layout_col1.add(createControlTitle("Retrieve Table Names"), 0, Layout.Bottom, 4);
layout_col1.add(button2, 0, Layout.Bottom, 4);
layout_col1.addSpacer(32);
layout_col1.add(createControlTitle("Retrieve Field Names"), 0, Layout.Bottom, 4);
layout_col1.add(button5, 0, Layout.Bottom, 4);
layout_col1.addSpacer(8);

//layout_col1.add(createControlTitle("Enter TSQL Code"), 0, Layout.Bottom, 4);
//layout_col1.add(button4);
//layout_col1.addSpacer(16);
//layout_col1.add(createControlTitle("TSQL Code"), 0, Layout.Bottom, 4);
//layout_col1.add(textbox2);
//layout_col1.addSpacer(16);
layout_col1.add(createControlTitle(" Field Names "), 0, Layout.Bottom, 4);
layout_col1.add(choicebox, 0, Layout.Bottom, 4);
layout_col1.addSpacer(8);
layout_col1.add(createControlTitle(" SQL Criteria "), 0, Layout.Bottom, 4);
layout_col1.add(sqlcriteria, 0, Layout.Bottom, 4);
layout_col1.addSpacer(8);
layout_col1.add(createControlTitle(" Table Name "), 0, Layout.Bottom, 4);
layout_col1.add(textbox3, 0, Layout.Bottom, 4);
layout_col1.addSpacer(8);
layout_col1.add(createControlTitle(" SQL Local Table "), 0, Layout.Bottom, 4);
layout_col1.add(checkbox, 0, Layout.Bottom, 4);
layout_col1.addSpacer(8);
layout_col1.add(createControlTitle(" Kirix Local Table "), 0, Layout.Bottom, 4);
layout_col1.add(checkbox2, 0, Layout.Bottom, 4);
layout_col1.addSpacer(8);
layout_col1.add(createControlTitle("Execute TSQL"), 0, Layout.Bottom, 4);
layout_col1.add(button3, 0, Layout.Bottom, 4);

// layout_col2.add(m_progressbar, 0, Layout.Expand | Layout.Left | Layout.Right,5);

// layout_col1.addSpacer(16);
// layout_col1.add(createControlTitle("Label"), 0, Layout.Bottom, 4);
// layout_col1.add(label);

// create second column layout
var layout_col2 = new BoxLayout(Layout.Vertical);
layout_col2.addSpacer(8);
layout_col2.add(createControlTitle("SQL Server Info"), 0, Layout.Bottom, 4);
layout_col2.add(line);
layout_col2.addSpacer(16);
layout_col2.add(createControlTitle("Server Name"), 0, Layout.Bottom, 4);
layout_col2.add(textbox);
layout_col2.addSpacer(16);
layout_col2.add(createControlTitle("Databases"), 0, Layout.Bottom, 4);
layout_col2.add(listbox2);
layout_col2.addSpacer(16);
layout_col2.add(createControlTitle("Tables"), 0, Layout.Bottom, 4);
layout_col2.add(listbox);
layout_col2.addSpacer(16);
layout_col2.add(createControlTitle("ProgressBar"), 0, Layout.Bottom, 4);
layout_col2.add(m_progressbar);
layout_col2.add(m_progressbar, 0, Layout.Expand | Layout.Left | Layout.Right,5);

// create main layout
var main_layout = new BoxLayout(Layout.Horizontal);
main_layout.addSpacer(16);
main_layout.add(layout_col1, 1, Layout.Expand);
main_layout.add(new Line(Line.Vertical), 0, Layout.Expand);
main_layout.addSpacer(16);
main_layout.add(layout_col2, 1, Layout.Expand);
main_layout.add(new Line(Line.Vertical), 0, Layout.Expand);
main_layout.addSpacer(8);

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

Re: form layout

Postby abenitez77 on Mon Mar 14, 2011 9:46 am

Nevermind. I think I figured it out the column resizing. What I still can't do is put 2 text boxes or my 2 checkboxes next to each other instead of 1 above the other.
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Return to Strata Help & Feedback