[archived content]

About

TabControl? is a way to organize pages of information. It puts different controls into tabs to be viewed separately.

Usage

TabControls? use TabPages? to contain the different pages that hold controls. These pages have a text label that is displayed to differentiate them. In order to style the TabPages?' display use the appearance property of the TabControl? Control that they exist in. All tabs are styled the same way.

Example

import dfl.all;

void main() {
        auto form = new Form;
        form.dockPadding.all = 5;

        auto tabs = new TabControl;
        tabs.appearance = TabAppearance.FLAT_BUTTONS;

        auto currentPage = new TabPage;
        currentPage.text = "First Tab";
        auto currentLabel = new Label;
        currentLabel.text = "First Page's Label";
        currentLabel.dock = DockStyle.FILL;
        currentPage.controls.add(currentLabel);
        tabs.tabPages.add(currentPage);
        currentPage = new TabPage;
        currentPage.text = "Second Tab";
        currentLabel = new Label;
        currentLabel.text = "Second Page's Label";
        currentLabel.dock = DockStyle.FILL;
        currentPage.controls.add(currentLabel);
        tabs.tabPages.add(currentPage);
        currentPage = new TabPage;
        currentPage.text = "Third Tab";
        currentLabel = new Label;
        currentLabel.text = "Third Page's Label";
        currentLabel.dock = DockStyle.FILL;
        currentPage.controls.add(currentLabel);
        tabs.tabPages.add(currentPage);


        tabs.dock = DockStyle.FILL;
        form.controls.add(tabs);

        Application.run(form);
}

module dfl.tabcontrol;
public enum TabAlignment;
public enum TabAppearance;
public class TabControl: TabControlBase
{
public final TabAlignment alignment; [property setter]
public final TabAlignment alignment; [property getter]
public final TabAppearance appearance; [property setter]
public final TabAppearance appearance; [property getter]
public final bool multiline; [property setter]
public final bool multiline; [property getter]
protected void onHandleCreated(EventArgs ea);
protected void onLayout(LayoutEventArgs ea);
protected void onReflectedMessage(ref Message m);
public final Point padding; [property setter]
public final Point padding; [property getter]
public final int rowCount; [property getter]
public final int selectedIndex; [property setter]
public final int selectedIndex; [property getter]
public final TabPage selectedTab; [property setter]
public final TabPage selectedTab; [property getter]
public final int tabCount; [property getter]
public final TabPageCollection tabPages; [property getter]
[+] Inherited members
}
public static class TabControl.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 TabControlBase: Control
{
protected void createParams(ref CreateParams cp);
protected Size defaultSize; [property getter]
public Rect displayRectangle; [property getter]
public final TabDrawMode drawMode; [property setter]
public final TabDrawMode drawMode; [property getter]
public final Rect getTabRect(int i);
protected void onReflectedMessage(ref Message m);
protected void onSelectedIndexChanged(EventArgs ea);
protected void onSelectedIndexChanging(CancelEventArgs ea);
protected void prevWndProc(ref Message msg);
public Event selectedIndexChanged(TabControlBase,EventArgs);
public Event selectedIndexChanging(TabControlBase,CancelEventArgs);
protected void wndProc(ref Message m);
[+] Inherited members
}
{
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 enum TabDrawMode;
public class TabPage: Panel
{
public int opCmp(Object o);
public int opCmp(char[] val);
public int opEquals(char[] val);
public int opEquals(Object o);
protected void setBoundsCore(int x,int y,int width,int height,BoundsSpecified specified);
protected void setVisibleCore(bool byes);
public char[] text; [property setter]
public char[] toString();
[+] Inherited members
}
public static class TabPage.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 final int all; [property setter]
public final int all; [property getter]
public final int bottom; [property getter]
public final int bottom; [property setter]
public final int left; [property getter]
public final int left; [property setter]
public final int right; [property setter]
public final int right; [property getter]
public final int top; [property getter]
public final int top; [property setter]
}
public class TabPageCollection
{
public void add(char[] s);
public bool contains(char[] s);
public int indexOf(char[] s);
public void insert(int index,char[] s);
public void remove(char[] s);
}

Page last modified on July 03, 2008, at 08:49 PM