Om
1.0.0
A universal framework for multimedia simulation
|
A class that displays one of multiple views based on a user's tab selection. More...
#include <omGUITabView.h>
Classes | |
class | Delegate |
A class that contains function objects that recieve TabView events. More... | |
Public Member Functions | |
TabView (const Size2D &size) | |
Create a new tab view with the specified size. More... | |
TabView (const Size2D &size, const Vector2i &position) | |
Create a new tab view with the specified position and size relative to its parent view. More... | |
~TabView () | |
Destroy a tab view, releasing all resources associated with it. More... | |
virtual Size2D | getSize () const |
Return a 2D vector indicating the size on the screen of this tab view in pixels. More... | |
virtual Bool | setSize (const Size2D &size) |
Set the size on the screen of this tab view in pixels. More... | |
virtual Vector2i | getPosition () const |
Return the 2D position of this tab view in pixels, relative to the bottom left corner of the view. More... | |
virtual Bool | setPosition (const Vector2i &position) |
Set the 2D position of this tab view in pixels, relative to the bottom left corner of the view. More... | |
Size | getPageCount () const |
Return the number of pages there are in this tab view. More... | |
TabViewPage * | getPage (Index index) const |
Get the page at the specified index in the TabView. More... | |
Bool | getPageIndex (const TabViewPage *item, Index &index) const |
Place the index of the specified page in the output parameter and return if it was found. More... | |
Bool | addPage (TabViewPage *newPage) |
Add the specified TabViewPage to the end of the list of items, placing it at the end of the tab view. More... | |
Bool | insertPage (Index index, TabViewPage *newPage) |
Insert the specified TabViewPage at the specified item index in this tab view. More... | |
Bool | setPage (Index index, TabViewPage *newPage) |
Set the specified TabViewPage at the specified index in the list of pages. More... | |
Bool | removePage (const TabViewPage *page) |
Remove the specified TabViewPage from this Menu. More... | |
Bool | removePageAtIndex (Index index) |
Remove the page at the specified index in the page list. More... | |
void | clearPages () |
Remove all pages from this tab view. More... | |
Index | getSelectedPage () const |
Return the index of the currently selected page in this tab view. More... | |
Bool | setSelectedPage (Index newPageIndex) |
Set the index of the currently selected page in this tab view. More... | |
const Delegate & | getDelegate () const |
Return a const reference to the object that responds to events for this TabView. More... | |
void | setDelegate (const Delegate &newDelegate) |
Set the object to which TabView events should be delegated. More... | |
virtual void * | getInternalPointer () const |
Return a pointer to platform-specific data for this tab view. More... | |
Public Member Functions inherited from om::gui::objects::WindowObject | |
WindowObject () | |
Create a new default window element. More... | |
Size | getWidth () const |
Return the horizontal size in pixels of this window element. More... | |
Size | getHeight () const |
Return the vertical size in pixels of this window element. More... | |
Bool | setSize (Size newWidth, Size newHeight) |
Set the size on the screen of this window element in pixels. More... | |
Window * | getParentWindow () const |
Return the window that is a parent of this window element. More... | |
virtual void | setParentWindow (Window *newParentWindow) |
Set the window that is going to be a parent of this window element. More... | |
Bool | hasParentWindow () const |
Return whether or not this window element belongs to a window. More... | |
Public Member Functions inherited from om::gui::objects::GUIObject | |
virtual | ~GUIObject () |
Destroy a GUI element and release all resources associated with it. More... | |
Additional Inherited Members | |
Protected Attributes inherited from om::gui::objects::WindowObject | |
Window * | parentWindow |
The parent window of this window element, or NULL if this element is not part of a window. More... | |
A class that displays one of multiple views based on a user's tab selection.
om::gui::objects::TabView::TabView | ( | const Size2D & | size | ) |
Create a new tab view with the specified size.
om::gui::objects::TabView::TabView | ( | const Size2D & | size, |
const Vector2i & | position | ||
) |
Create a new tab view with the specified position and size relative to its parent view.
om::gui::objects::TabView::~TabView | ( | ) |
Destroy a tab view, releasing all resources associated with it.
|
virtual |
Return a 2D vector indicating the size on the screen of this tab view in pixels.
The actual size of the rendering framebuffer may be different than this value, due to differences in the pixel density of displays. Call getFramebufferSize() to get the actual size in rendered pixels of this view.
Implements om::gui::objects::WindowObject.
|
virtual |
Set the size on the screen of this tab view in pixels.
The method returns whether or not the size change operation was successful.
Implements om::gui::objects::WindowObject.
|
virtual |
Return the 2D position of this tab view in pixels, relative to the bottom left corner of the view.
The coordinate position is defined relative to its enclosing coordinate frame where the origin will be the bottom left corner of the enclosing view or window.
Implements om::gui::objects::WindowObject.
|
virtual |
Set the 2D position of this tab view in pixels, relative to the bottom left corner of the view.
The coordinate position is defined relative to its enclosing coordinate frame where the origin will be the bottom left corner of the enclosing view or window.
If the position change operation is successful, TRUE is returned and the view is moved. Otherwise, FALSE is returned and the view is not moved.
Implements om::gui::objects::WindowObject.
Size om::gui::objects::TabView::getPageCount | ( | ) | const |
Return the number of pages there are in this tab view.
TabViewPage* om::gui::objects::TabView::getPage | ( | Index | index | ) | const |
Get the page at the specified index in the TabView.
If the specified index is invalid, a NULL pointer is returned.
index | - the index of the page to be retrieved. |
Bool om::gui::objects::TabView::getPageIndex | ( | const TabViewPage * | item, |
Index & | index | ||
) | const |
Place the index of the specified page in the output parameter and return if it was found.
If the menu contains the specified page, it places the index of that item in the output index parameter and returns TRUE. Otherwise, if the page is not found, the method returns FALSE and no index is retrieved.
Bool om::gui::objects::TabView::addPage | ( | TabViewPage * | newPage | ) |
Add the specified TabViewPage to the end of the list of items, placing it at the end of the tab view.
If the new page pointer is NULL, the add operation is ignored and FALSE is returned. Otherwise, the page is added and TRUE is returned, indicating success.
newPage | - the page to add to the end of the page list. |
Bool om::gui::objects::TabView::insertPage | ( | Index | index, |
TabViewPage * | newPage | ||
) |
Insert the specified TabViewPage at the specified item index in this tab view.
If the new page pointer is NULL or if the specified insertion index is greater than the number of pages in the view, FALSE is returned indicating that the insertion operation failed. Otherwise, TRUE is returned and the page is inserted at the specified index.
newPage | - the page to insert in the page list. |
index | - the index in the page list at which to insert the new item. |
Bool om::gui::objects::TabView::setPage | ( | Index | index, |
TabViewPage * | newPage | ||
) |
Set the specified TabViewPage at the specified index in the list of pages.
This method replaces the page at the specified index with a new menu item. If the new page pointer is NULL, the set operation is ignored.
newPage | - the page to set in the page list. |
index | - the index at which to set the new item. |
Bool om::gui::objects::TabView::removePage | ( | const TabViewPage * | page | ) |
Remove the specified TabViewPage from this Menu.
If the page pointer is NULL or if the specified item is not contained in this menu, FALSE is returned indicating failure. Otherwise, that page is removed and TRUE is returned.
page | - the page to remove from the page list. |
Remove the page at the specified index in the page list.
If the specified index is invalid, FALSE is returned and the tab view is unaltered. Otherwise, the item at that index is removed and TRUE is returned.
index | - the index at which to remove a page from the tab view. |
void om::gui::objects::TabView::clearPages | ( | ) |
Remove all pages from this tab view.
Index om::gui::objects::TabView::getSelectedPage | ( | ) | const |
Return the index of the currently selected page in this tab view.
Set the index of the currently selected page in this tab view.
The method returns whether or not the selected page was able to be set.
const Delegate& om::gui::objects::TabView::getDelegate | ( | ) | const |
Return a const reference to the object that responds to events for this TabView.
void om::gui::objects::TabView::setDelegate | ( | const Delegate & | newDelegate | ) |
Set the object to which TabView events should be delegated.
|
virtual |
Return a pointer to platform-specific data for this tab view.
On Mac OS X, this method returns a pointer to a subclass of NSTabView which represents the tab view.
On Windows, this method returns an HWND indicating the 'window' which represents the tab view.
Implements om::gui::objects::GUIObject.