[archived content]

About:

A Splitter is a Control that allows the resizing of 2 Controls by providing a handle that may be dragged to resize the controls. Splitters cannot handle more than 2 Controls around them so you will have to use Containers if you want to do more than 2 Containers.

Usage:

A Splitter is not a ContainerControl? and as such you do not add Controls to it. This actually makes programming easy as you just do intuitive programming. Add a Control before you add the Splitter and add a Control After you add the Splitter. When you set all the DockStyles? it will adjust accordingly.

Example


import dfl.all;

public void main() {
        auto form = new Form();
        form.text = "Splitter Example";

        auto btn1 = new Button();
        btn1.text = "1";
        btn1.dock = DockStyle.LEFT;
        btn1.parent = form;

        auto split = new Splitter();
        split.dock = DockStyle.LEFT;
        split.parent = form;

        auto btn2 = new Button();
        btn2.text = "2";
        btn2.dock = DockStyle.FILL;
        btn2.parent = form;

        Application.run(form);
}

module dfl.splitter;
public class Splitter: Control
{
public AnchorStyles anchor; [property setter]
protected Size defaultSize; [property getter]
public DockStyle dock; [property setter]
public final int minSize; [property setter]
public final int minSize; [property getter]
public bool movingGrip; [property setter]
public bool movingGrip; [property getter]
protected void onMouseDown(MouseEventArgs mea);
protected void onMouseMove(MouseEventArgs mea);
protected void onMouseUp(MouseEventArgs mea);
protected void onMove(EventArgs ea);
protected void onPaint(PaintEventArgs ea);
protected void onResize(EventArgs ea);
protected void onSplitterMoved(SplitterEventArgs sea);
protected void onSplitterMoving(SplitterEventArgs sea);
public Event splitterMoved(Splitter,SplitterEventArgs);
public Event splitterMoving(Splitter,SplitterEventArgs);
[+] Inherited members
}
public static class Splitter.ControlCollection
{
public void add(Control ctrl);
public bool contains(Control ctrl);
public int indexOf(Control ctrl);
public int length; [property getter]
public int opApply(int delegate(ref Control) dg);
public int opIndex; [property getter]
protected final Control owner; [property getter]
public void remove(Control ctrl);
public void removeAt(int i);
}
public class SplitterEventArgs: EventArgs
{
public final int splitX; [property getter]
public final int splitX; [property setter]
public final int splitY; [property getter]
public final int splitY; [property setter]
public final int x; [property getter]
public final int y; [property getter]
[+] Inherited members
}

Page last modified on June 26, 2008, at 07:18 PM