View previous topic :: View next topic |
Author |
Message |
tsalm
Joined: 18 Feb 2008 Posts: 26 Location: France
|
Posted: Sat Mar 08, 2008 4:40 pm Post subject: How to use Splitter ? |
|
|
Hi all,
I would know how to add some controls inside the two panels of a splitter ?
TIA
TSalm
Here is my test code :
Code: | import dfl.all;
int main()
{
Form myForm;
Splitter mySplitter;
Label myLabelTop,myLabelBottom;
myForm = new Form;
myForm.text = "Split test";
mySplitter = new Splitter;
mySplitter.dock(DockStyle.TOP);
myLabelTop = new Label;
myLabelTop.text = "TOP";
myLabelBottom = new Label;
myLabelBottom.text = "BOTTOM";
/* ? How to set label parents here ? */
mySplitter.parent = myForm;
Application.run(myForm);
return 0;
} |
|
|
Back to top |
|
|
Al
Joined: 10 Mar 2008 Posts: 9
|
Posted: Mon Mar 10, 2008 3:24 am Post subject: |
|
|
I'm not sure I understand what exactly you want to do, but here's what I did in the Entice designer:
Code: |
/*
Generated by Entice Designer
Entice Designer written by Christopher E. Miller
www.dprogramming.com/entice.php
*/
private import dfl.all;
class TestForm: dfl.form.Form
{
// Do not modify or move this block of variables.
//~Entice Designer variables begin here.
dfl.listbox.ListBox listBox1;
dfl.splitter.Splitter splitter1;
dfl.listbox.ListBox listBox2;
//~Entice Designer variables end here.
this()
{
initializeTestForm();
//@ Other TestForm initialization code here.
}
private void initializeTestForm()
{
// Do not manually modify this function.
//~Entice Designer 0.8.4.04 code begins here.
//~DFL Form
text = "Test Form";
clientSize = dfl.all.Size(456, 405);
//~DFL dfl.listbox.ListBox=listBox1
listBox1 = new dfl.listbox.ListBox();
listBox1.name = "listBox1";
listBox1.dock = dfl.all.DockStyle.LEFT;
listBox1.bounds = dfl.all.Rect(0, 0, 120, 394);
listBox1.parent = this;
//~DFL dfl.splitter.Splitter=splitter1
splitter1 = new dfl.splitter.Splitter();
splitter1.name = "splitter1";
splitter1.bounds = dfl.all.Rect(120, 0, 5, 405);
splitter1.parent = this;
//~DFL dfl.listbox.ListBox=listBox2
listBox2 = new dfl.listbox.ListBox();
listBox2.name = "listBox2";
listBox2.dock = dfl.all.DockStyle.FILL;
listBox2.bounds = dfl.all.Rect(125, 0, 331, 394);
listBox2.parent = this;
//~Entice Designer 0.8.4.04 code ends here.
}
}
int main()
{
int result = 0;
try
{
//Application.enableVisualStyles();
//@ Other application initialization code here.
Application.run(new TestForm());
}
catch(Object o)
{
msgBox(o.toString(), "Fatal Error", MsgBoxButtons.OK, MsgBoxIcon.ERROR);
result = 1;
}
return result;
}
|
Here we have two listboxes separated with a splitter. Pay attention to the way controls are docked.
HTH |
|
Back to top |
|
|
tsalm
Joined: 18 Feb 2008 Posts: 26 Location: France
|
Posted: Mon Mar 10, 2008 4:19 pm Post subject: |
|
|
Perfect!
thank
ps: I thought that the "Splitter" class has 2 panels and a splitter between, like in VS 2005. |
|
Back to top |
|
|
|
|
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 vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|