Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

TabCtrl

 

class TabCtrl : public Ctrl

This widget can be used to organize the dialog content into separate pages switched by clicking header tabs.

 

 

Each tab of TabCtrl can but does not need to contain a slave widget (usually slave dialog pane).

Value of TabCtrl (accessed by GetData() / SetData() or respective shortcut operators) is the index of active tab.

TabCtrl responds to SetReadOnly / SetEditable method calls by locking / unlocking itself in currently active tab w.r.t. user actions.

 

 

Public Member List

 

Callback WhenSet

This callback is invoked when active tab changes.

 


 

TabCtrl::Item& Add()

Add a new tab to TabCtrl. Returns a reference to TabCtrl::Item which can be used to setup tab's properties.

 


 

TabCtrl::Item& Add(const char *text)

Same as Add(), but also sets the text of tab.

 


 

TabCtrl::Item& Add(const Image& m, const char *text)

Adds a tab and sets its image and label.

 


 

TabCtrl::Item& Add(Ctrl& slave, const char *text)

Adds a tab with the slave widget and text label.

 


 

TabCtrl::Item& Add(Ctrl& slave, const Image& m, const char *text)

Adds a tab with the slave widget, image and text.

 


 

TabCtrl::Item& Insert(int i)

Inserts a new tab to TabCtrl at position i. Returns a reference to TabCtrl::Item which can be used to setup tab's properties.

 


 

TabCtrl::Item& Insert(int i, const char *text)

Inserts a new tab to TabCtrl at position i and also sets the text of tab to text.

 


 

TabCtrl::Item& Insert(int i, const Image& m, const char *text)

Inserts a new tab to TabCtrl at position i and also sets the text of tab to text and the image to m.

 


 

TabCtrl::Item& Insert(int i, Ctrl& slave, const char *text)

Inserts a new tab to TabCtrl at position i and also sets it's slave widget to slave and the text to text.

 


 

TabCtrl::Item& Insert(int i, Ctrl& slave, const Image& m, const char *text)

Inserts a new tab at position i. slave is the slave dialog, m is image to be shown in tab and text is tab label.

 


 

void Remove(int i)

Removes the tab with the index i.

 


 

int GetCount() const

Returns the number of tabs in TabCtrl.

 


 

int GetTab(Point pconst

Returns the index of the tab that can be found at the psoition p.

 


 

Item& GetItem(int i)

Returns a reference to tab i.

 


 

const Item& GetItem(int iconst

Return a constant reference to tab i.

 


 

void Set(int i)

Sets tab i as active. You can also use SetData (or operator<<=).

 


 

int Get() const

Returns the index of active tab. You can also use GetData (or operator~).

 


 

int Find(const Ctrl& slaveconst

Finds the tab index of slave. If slave is not present in TabCtrl, returns -1.

 


 

void Set(Ctrl& slave)

Sets tab with slave widget as active. If slave is not present in TabCtrl, nothing happens.

 


 

bool IsAt(Ctrl& slave)

Returns true if slave represents the active tab.

 


 

TabCtrl::Item& Insert(Ctrl& before_slave)

TabCtrl::Item& Insert(Ctrl& before_slave, const char *text)

TabCtrl::Item& Insert(Ctrl& before_slave, const Image& m, const char *text)

TabCtrl::Item& Insert(Ctrl& before_slave, Ctrl& slave, const char *text)

TabCtrl::Item& Insert(Ctrl& before_slave, Ctrl& slave, const Image& m, const char *text)

Inserts a new tab before tab that contains before_slave. If before_slave is not present in TabCtrl, new tab is appended at the end.

 


 

void Remove(Ctrl& slave)

Removes a tab with slave. If slave is not present in TabCtrl, nothing happens.

 


 

void GoNext()

Sets the next tab as active. If the tab is last, sets the first one.

 


 

void GoPrev()

Sets the previous tab as active. If the tab is first, sets the last one.

 


 

Size ComputeSize(Size pane)

Computes required smallest size of TabCtrl is big enough to have client area of pane size.

 


 

void Add(Ctrl& c)

Adds widget c to client area. Note that in this case, widget does not belong to any of tabs and is not affect by switching them.

 


 

TabCtrl& NoAccept(bool ac = true)

If active, TabCtrl Accept method does not call any of slave widgets Accept.

 


 

TabCtrl& AcceptCurrent(bool ac = true)

If AcceptCurrent is active (default is not active), TabCtrl Accept method accepts only the current slave widget instead of all of them. Returns *this.

 


 

TabCtrl& AcceptAll()

Same as AcceptCurrent(false).

 


 

TabCtrl& SetStyle(const Style& s)

Sets the style of the tab control to TabCtrl::Style s.

 


 

void Reset()

Resets TabCtrl to default settings.

 


 

static const Style& StyleDefault()

Returns the default style of a tab control.

 

 

 

 

TabCtrl::Item

 

class Item

This nested class represents properties of individual tabs in TabCtrl.

 

 

Public Method List

 

Item& Text(const String& _text)

Sets the label of tab to _text. Returns *this.

 


 

Item& Picture(PaintRect d)

Sets the d as visual content of tab. Returns *this.

 


 

Item& SetImage(const UPP::Image& _im)

Sets the image to appear on the left side of tab's label. Returns *this.

 


 

Item& SetCtrl(Ctrl *_ctrl)

Sets the ctrl to appear inside header tab. Returns *this.

 


 

Item& SetCtrl(Ctrl& c)

Same as SetCtrl(&c). Returns *this.

 


 

Item& Slave(Ctrl *_slave)

Sets the slave widget. Returns *this.

 


 

Item& Key(dword _key)

Sets a key that activates tab. Returns *this.

 


 

Item& Enable(bool _en = true)

Enables/disables tab. Returns *this.

 


 

Item& Disable()

Same as Enable(false).

 


 

bool IsEnabled() const

Returns true if tab is enabled.

 


 

Ctrl *GetSlave()

const Ctrl *GetSlave() const

Returns the slave widget.

 


 

Ctrl *GetCtrl()

const Ctrl *GetCtrl() const

Returns the control that appears inside the header tab.

 

 

Last edit by cxl on 10/09/2016. Do you want to contribute?. T++