Public Types | ||||
enum | TabPanePosition { Top, Bottom } | |||
Public Member Functions | ||||
size_t | getTabCount (void) const | |||
Return number of tabs. | ||||
TabPanePosition | getTabPanePosition (void) const | |||
Return the positioning of the tab pane. | ||||
void | setTabPanePosition (TabPanePosition pos) | |||
Change the positioning of the tab button pane. | ||||
void | setSelectedTab (const String &name) | |||
Set the selected tab by the name of the root window within it. Also ensures that the tab is made visible (tab pane is scrolled if required).
| ||||
void | setSelectedTab (uint ID) | |||
Set the selected tab by the ID of the root window within it. Also ensures that the tab is made visible (tab pane is scrolled if required).
| ||||
void | setSelectedTabAtIndex (size_t index) | |||
Set the selected tab by the index position in the tab control. Also ensures that the tab is made visible (tab pane is scrolled if required).
| ||||
void | makeTabVisible (const String &name) | |||
Ensure that the tab by the name of the root window within it is visible.
| ||||
void | makeTabVisible (uint ID) | |||
Ensure that the tab by the ID of the root window within it is visible.
| ||||
void | makeTabVisibleAtIndex (size_t index) | |||
Ensure that the tab by the index position in the tab control is visible.
| ||||
Window * | getTabContentsAtIndex (size_t index) const | |||
Return the Window which is the first child of the tab at index position index. | ||||
Window * | getTabContents (const String &name) const | |||
Return the Window which is the tab content with the given name. | ||||
Window * | getTabContents (uint ID) const | |||
Return the Window which is the tab content with the given ID. | ||||
bool | isTabContentsSelected (Window *wnd) const | |||
Return whether the tab contents window is currently selected. | ||||
size_t | getSelectedTabIndex () const | |||
Return the index of the currently selected tab. | ||||
const UDim & | getTabHeight (void) const | |||
Return the height of the tabs. | ||||
const UDim & | getTabTextPadding (void) const | |||
Return the amount of padding to add either side of the text in the tab. | ||||
virtual void | initialiseComponents (void) | |||
Initialise the Window based object ready for use. | ||||
void | setTabHeight (const UDim &height) | |||
Set the height of the tabs. | ||||
void | setTabTextPadding (const UDim &padding) | |||
Set the amount of padding to add either side of the text in the tab. | ||||
void | addTab (Window *wnd) | |||
Add a new tab to the tab control. | ||||
void | removeTab (const String &name) | |||
Remove the named tab from the tab control. | ||||
void | removeTab (uint ID) | |||
Remove the tab with the given ID from the tab control. | ||||
TabControl (const String &type, const String &name) | ||||
Constructor for TabControl base class. | ||||
virtual | ~TabControl (void) | |||
Destructor for Listbox base class. | ||||
Static Public Attributes | ||||
static const String | EventNamespace | |||
Namespace for global events. | ||||
static const String | WidgetTypeName | |||
Window factory name. | ||||
static const String | EventSelectionChanged | |||
Event triggered when there is a change to the currently selected tab. | ||||
static const String | ContentPaneNameSuffix | |||
Widget name suffix for the tab content pane component. | ||||
static const String | TabButtonNameSuffix | |||
Widget name suffix for the tab button components. | ||||
static const String | TabButtonPaneNameSuffix | |||
Widget name suffix for the tab button pane component. | ||||
static const String | ButtonScrollLeftSuffix | |||
Widget name suffix for the scroll tabs to right pane component. | ||||
static const String | ButtonScrollRightSuffix | |||
Widget name suffix for the scroll tabs to left pane component. | ||||
Protected Types | ||||
typedef std::vector< TabButton * > | TabButtonVector | |||
Protected Member Functions | ||||
virtual void | drawSelf (float z) | |||
Perform the actual rendering for this Window. | ||||
virtual void | addButtonForTabContent (Window *wnd) | |||
Add a TabButton for the specified child Window. | ||||
virtual void | removeButtonForTabContent (Window *wnd) | |||
Remove the TabButton for the specified child Window. | ||||
TabButton * | getButtonForTabContents (Window *wnd) const | |||
Return the TabButton associated with this Window.
| ||||
String | makeButtonName (Window *wnd) | |||
Construct a button name to handle a window. | ||||
virtual void | selectTab_impl (Window *wnd) | |||
Internal implementation of select tab. | ||||
virtual void | makeTabVisible_impl (Window *wnd) | |||
Internal implementation of make tab visible. | ||||
virtual bool | testClassName_impl (const String &class_name) const | |||
Return whether this window was inherited from the given class name at some point in the inheritance hierarchy. | ||||
Window * | getTabButtonPane () const | |||
Return a pointer to the tab button pane (Window)for this TabControl. | ||||
Window * | getTabPane () const | |||
Return a pointer to the content component widget for this TabControl. | ||||
void | performChildWindowLayout () | |||
method called to perform extended laying out of attached child windows. | ||||
int | writeChildWindowsXML (XMLSerializer &xml_stream) const | |||
virtual bool | validateWindowRenderer (const String &name) const | |||
Function used in checking if a WindowRenderer is valid for this window. | ||||
TabButton * | createTabButton (const String &name) const | |||
create and return a pointer to a TabButton widget for use as a clickable tab header | ||||
void | removeTab_impl (Window *window) | |||
Implementation function to do main work of removing a tab. | ||||
virtual void | onSelectionChanged (WindowEventArgs &e) | |||
Handler called internally when the currently selected item or items changes. | ||||
virtual void | onFontChanged (WindowEventArgs &e) | |||
Handler called when the window's font is changed. | ||||
void | calculateTabButtonSizePosition (size_t index) | |||
create and return a pointer to a TabButton widget for use as a clickable tab header | ||||
void | addTabControlProperties (void) | |||
void | addChild_impl (Window *wnd) | |||
Add given window to child list at an appropriate position. | ||||
void | removeChild_impl (Window *wnd) | |||
Remove given window from child list. | ||||
bool | handleContentWindowTextChanged (const EventArgs &args) | |||
bool | handleTabButtonClicked (const EventArgs &args) | |||
bool | handleScrollPane (const EventArgs &e) | |||
bool | handleDraggedPane (const EventArgs &e) | |||
bool | handleWheeledPane (const EventArgs &e) | |||
Protected Attributes | ||||
UDim | d_tabHeight | |||
The height of the tabs in pixels. | ||||
UDim | d_tabPadding | |||
The padding of the tabs relative to parent. | ||||
TabButtonVector | d_tabButtonVector | |||
Sorting for tabs. | ||||
float | d_firstTabOffset | |||
The offset in pixels of the first tab. | ||||
TabPanePosition | d_tabPanePos | |||
The position of the tab pane. | ||||
float | d_btGrabPos | |||
std::map< Window *, Event::ScopedConnection > | d_eventConnections | |||
Container used to track event subscriptions to added tab windows. | ||||
Static Protected Attributes | ||||
static TabControlProperties::TabHeight | d_tabHeightProperty | |||
static TabControlProperties::TabTextPadding | d_tabTextPaddingProperty | |||
static TabControlProperties::TabPanePosition | d_tabPanePosition |
void CEGUI::TabControl::addTab | ( | Window * | wnd | ) |
Add a new tab to the tab control.
wnd | The Window which will be placed in the content area of this new tab. |
References addButtonForTabContent(), CEGUI::Window::addChildWindow(), d_eventConnections, CEGUI::UDim::d_offset, CEGUI::UDim::d_scale, d_tabHeight, CEGUI::Window::EventTextChanged, CEGUI::Window::getFont(), CEGUI::Font::getFontHeight(), CEGUI::Window::getName(), getTabCount(), getTabPane(), CEGUI::Informative, performChildWindowLayout(), CEGUI::Window::requestRedraw(), setSelectedTab(), CEGUI::Window::setVisible(), and CEGUI::EventSet::subscribeEvent().
Referenced by addChild_impl().
void CEGUI::TabControl::calculateTabButtonSizePosition | ( | size_t | index | ) | [protected] |
create and return a pointer to a TabButton widget for use as a clickable tab header
name | Button name |
index | The index of the tab button |
References d_firstTabOffset, CEGUI::URect::d_max, CEGUI::UDim::d_offset, d_tabButtonVector, CEGUI::Size::d_width, CEGUI::UVector2::d_x, CEGUI::Window::getArea(), CEGUI::Window::getFont(), CEGUI::Window::getPixelSize(), getTabTextPadding(), CEGUI::Window::getText(), CEGUI::Font::getTextExtent(), CEGUI::Window::getXPosition(), CEGUI::Window::requestRedraw(), CEGUI::Window::setHeight(), CEGUI::Window::setVisible(), CEGUI::Window::setWidth(), CEGUI::Window::setXPosition(), and CEGUI::Window::setYPosition().
Referenced by performChildWindowLayout().
create and return a pointer to a TabButton widget for use as a clickable tab header
name | Button name |
References CEGUI::TabControlWindowRenderer::createTabButton(), and CEGUI::Window::d_windowRenderer.
Referenced by addButtonForTabContent().
virtual void CEGUI::TabControl::drawSelf | ( | float | z | ) | [inline, protected, virtual] |
Perform the actual rendering for this Window.
z | float value specifying the base Z co-ordinate that should be used when rendering |
Reimplemented from CEGUI::Window.
size_t CEGUI::TabControl::getSelectedTabIndex | ( | ) | const |
Return the index of the currently selected tab.
References d_tabButtonVector.
Window * CEGUI::TabControl::getTabButtonPane | ( | ) | const [protected] |
Return a pointer to the tab button pane (Window)for this TabControl.
UnknownObjectException | Thrown if the component does not exist. |
References CEGUI::Window::getName(), and TabButtonPaneNameSuffix.
Referenced by addButtonForTabContent(), makeButtonName(), performChildWindowLayout(), and removeButtonForTabContent().
Window * CEGUI::TabControl::getTabContents | ( | uint | ID | ) | const |
Return the Window which is the tab content with the given ID.
ID | ID of the Window which was attached as a tab content. |
InvalidRequestException | thrown if content is not found. |
References CEGUI::Window::getChild(), and getTabPane().
Return the Window which is the tab content with the given name.
name | Name of the Window which was attached as a tab content. |
InvalidRequestException | thrown if content is not found. |
References CEGUI::Window::getChild(), and getTabPane().
Window * CEGUI::TabControl::getTabContentsAtIndex | ( | size_t | index | ) | const |
Return the Window which is the first child of the tab at index position index.
index | Zero based index of the item to be returned. |
InvalidRequestException | thrown if index is out of range. |
References d_tabButtonVector.
Referenced by makeTabVisibleAtIndex(), and setSelectedTabAtIndex().
size_t CEGUI::TabControl::getTabCount | ( | void | ) | const |
Return number of tabs.
References CEGUI::Window::getChildCount(), and getTabPane().
Referenced by addTab(), and removeTab_impl().
Window * CEGUI::TabControl::getTabPane | ( | ) | const [protected] |
Return a pointer to the content component widget for this TabControl.
UnknownObjectException | Thrown if the component does not exist. |
References ContentPaneNameSuffix, and CEGUI::Window::getName().
Referenced by addTab(), getTabContents(), getTabCount(), makeTabVisible(), performChildWindowLayout(), removeTab(), removeTab_impl(), and setSelectedTab().
TabPanePosition CEGUI::TabControl::getTabPanePosition | ( | void | ) | const [inline] |
Return the positioning of the tab pane.
Referenced by CEGUI::FalagardTabButton::render().
void CEGUI::TabControl::initialiseComponents | ( | void | ) | [virtual] |
Initialise the Window based object ready for use.
Reimplemented from CEGUI::Window.
References ButtonScrollLeftSuffix, ButtonScrollRightSuffix, CEGUI::PushButton::EventClicked, CEGUI::Window::getName(), and performChildWindowLayout().
bool CEGUI::TabControl::isTabContentsSelected | ( | Window * | wnd | ) | const |
Return whether the tab contents window is currently selected.
wnd | The tab contents window to query. |
InvalidRequestException | thrown if wnd is not a valid tab contents window. |
References getButtonForTabContents(), and CEGUI::TabButton::isSelected().
void CEGUI::TabControl::makeTabVisible_impl | ( | Window * | wnd | ) | [protected, virtual] |
Internal implementation of make tab visible.
wnd | Pointer to a Window which is the root of the tab content to make visible |
References CEGUI::UDim::asAbsolute(), ButtonScrollLeftSuffix, ButtonScrollRightSuffix, d_firstTabOffset, CEGUI::URect::d_max, d_tabButtonVector, CEGUI::Size::d_width, CEGUI::UVector2::d_x, CEGUI::Window::getArea(), CEGUI::Window::getName(), CEGUI::Window::getPixelSize(), CEGUI::TabButton::getTargetWindow(), CEGUI::Window::getXPosition(), performChildWindowLayout(), and CEGUI::Window::setWantsMultiClickEvents().
Referenced by makeTabVisible(), makeTabVisibleAtIndex(), and selectTab_impl().
void CEGUI::TabControl::onFontChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Handler called when the window's font is changed.
e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'. |
Reimplemented from CEGUI::Window.
References d_tabButtonVector, CEGUI::Window::getFont(), and CEGUI::Window::setFont().
void CEGUI::TabControl::performChildWindowLayout | ( | void | ) | [protected, virtual] |
method called to perform extended laying out of attached child windows.
The system may call this at various times (like when it is resized for example), and it may be invoked directly where required.
Reimplemented from CEGUI::Window.
References ButtonScrollLeftSuffix, ButtonScrollRightSuffix, calculateTabButtonSizePosition(), d_firstTabOffset, d_tabButtonVector, d_tabPanePos, CEGUI::Size::d_width, CEGUI::Window::getName(), CEGUI::Window::getPixelSize(), getTabButtonPane(), getTabPane(), CEGUI::PropertySet::isPropertyPresent(), CEGUI::PropertySet::setProperty(), and CEGUI::Window::setVisible().
Referenced by addTab(), initialiseComponents(), makeTabVisible_impl(), removeTab_impl(), setTabHeight(), setTabPanePosition(), and setTabTextPadding().
void CEGUI::TabControl::removeTab | ( | uint | ID | ) |
Remove the tab with the given ID from the tab control.
References CEGUI::Window::getChild(), getTabPane(), CEGUI::Window::isChild(), and removeTab_impl().
void CEGUI::TabControl::removeTab | ( | const String & | name | ) |
Remove the named tab from the tab control.
References CEGUI::Window::getChild(), getTabPane(), CEGUI::Window::isChild(), and removeTab_impl().
Referenced by removeChild_impl().
void CEGUI::TabControl::selectTab_impl | ( | Window * | wnd | ) | [protected, virtual] |
Internal implementation of select tab.
wnd | Pointer to a Window which is the root of the tab content to select |
References d_tabButtonVector, CEGUI::TabButton::getTargetWindow(), CEGUI::TabButton::isSelected(), makeTabVisible_impl(), onSelectionChanged(), CEGUI::TabButton::setSelected(), and CEGUI::Window::setVisible().
Referenced by setSelectedTab(), and setSelectedTabAtIndex().
void CEGUI::TabControl::setTabPanePosition | ( | TabPanePosition | pos | ) |
Change the positioning of the tab button pane.
pos | The new positioning of the tab pane |
References d_tabPanePos, and performChildWindowLayout().
virtual bool CEGUI::TabControl::testClassName_impl | ( | const String & | class_name | ) | const [inline, protected, virtual] |
Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
class_name | The class name that is to be checked. |
Reimplemented from CEGUI::Window.
References CEGUI::Window::testClassName_impl().
virtual bool CEGUI::TabControl::validateWindowRenderer | ( | const String & | name | ) | const [inline, protected, virtual] |
Function used in checking if a WindowRenderer is valid for this window.
Reimplemented from CEGUI::Window.
float CEGUI::TabControl::d_btGrabPos [protected] |
The position on the button tab where user grabbed