FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use Splitter ?

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
tsalm



Joined: 18 Feb 2008
Posts: 26
Location: France

PostPosted: Sat Mar 08, 2008 4:40 pm    Post subject: How to use Splitter ? Reply with quote

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
View user's profile Send private message
Al



Joined: 10 Mar 2008
Posts: 9

PostPosted: Mon Mar 10, 2008 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
tsalm



Joined: 18 Feb 2008
Posts: 26
Location: France

PostPosted: Mon Mar 10, 2008 4:19 pm    Post subject: Reply with quote

Perfect!
thank

ps: I thought that the "Splitter" class has 2 panels and a splitter between, like in VS 2005.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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