Public Member Functions | |
Tab () | |
Default constructor. More... | |
Tab (const Tab ©) | |
Copy constructor. More... | |
virtual | ~Tab () |
Destructor. More... | |
Tab & | operator= (const Tab &right) |
Overload of assignment operator. More... | |
virtual bool | load (const std::string &pathname) |
Creates the Tab object. More... | |
virtual void | setSize (float width, float height) |
Changes the size of a tab. More... | |
virtual Vector2u | getSize () const |
Returns the size of the tabs, unaffected by scaling. More... | |
virtual Vector2f | getScaledSize () const |
Returns the size of the tabs, after the scaling transformation. More... | |
virtual std::string | getLoadedPathname () const |
Returns the pathname that was used to load the tab. More... | |
virtual unsigned int | add (const sf::String &name, bool select=true) |
Adds a new tab. More... | |
virtual void | select (const sf::String &name) |
Selects the tab with a given name. More... | |
virtual void | select (unsigned int index) |
Selects the tab with a given index. More... | |
virtual void | deselect () |
Deselects the selected tab. More... | |
virtual void | remove (const sf::String &name) |
Removes a tab with a given name. More... | |
virtual void | remove (unsigned int index) |
Removes a tab with a given index. More... | |
virtual void | removeAll () |
Removes all tabs. More... | |
virtual sf::String | getSelected () const |
Get the name of the currently selected tab. More... | |
virtual int | getSelectedIndex () const |
Get the index of the currently selected tab. More... | |
virtual void | setTextFont (const sf::Font &font) |
Changes the font of the tabs. More... | |
virtual const sf::Font * | getTextFont () const |
Returns the font of the tabs. More... | |
virtual void | setTextColor (const sf::Color &color) |
Set the text color that will be used inside the tabs. More... | |
virtual const sf::Color & | getTextColor () const |
Get the text color that is currently being used inside the tabs. More... | |
virtual void | setTextSize (unsigned int size) |
Changes the character size of the text. More... | |
virtual unsigned int | getTextSize () const |
Returns the character size of the text. More... | |
virtual void | setTabHeight (unsigned int height) |
Changes the height of the tabs. More... | |
virtual unsigned int | getTabHeight () const |
Returns the height of the tabs. More... | |
Public Member Functions inherited from tgui::OBJECT | |
OBJECT () | |
Default constructor. More... | |
OBJECT (const OBJECT ©) | |
Copy constructor. More... | |
virtual | ~OBJECT () |
Destructor. More... | |
OBJECT & | operator= (const OBJECT &right) |
Overload of assignment operator. More... | |
virtual void | show () |
Shows the object. More... | |
virtual void | hide () |
Hides the object. More... | |
virtual bool | isVisible () const |
Returns true when the object is visible. More... | |
virtual void | enable () |
Enables the object. More... | |
virtual void | disable () |
Disables the object. More... | |
virtual bool | isEnabled () const |
Returns true when the object is enabled. More... | |
virtual bool | isDisabled () const |
Returns true when the object is disabled. More... | |
virtual bool | isLoaded () const |
Returns true when the object is loaded successfully. More... | |
void | focus () |
Focus the object. More... | |
void | unfocus () |
Unfocus the object. More... | |
void | focusNextObject () |
Focuses the next object. More... | |
virtual bool | isFocused () const |
Returns true when the object is focused and false otherwise. More... | |
virtual ObjectTypes | getObjectType () const |
Returns the type of the object. More... | |
virtual void | moveToFront () |
Places the object before all other objects. More... | |
virtual void | moveToBack () |
Places the object behind all other objects. More... | |
Public Attributes | |
unsigned int | distanceToSide |
The distance between the side of the tab and the text that is drawn on top of the tab. More... | |
unsigned int | maximumTabWidth |
tgui::Tab::Tab | ( | ) |
Default constructor.
tgui::Tab::Tab | ( | const Tab & | copy | ) |
Copy constructor.
copy | Instance to copy |
|
virtual |
Destructor.
|
virtual |
Adds a new tab.
name | The name of the tab (this is the text that will be drawn on top of the tab). |
select | Do you want the new tab to be selected immediately? |
|
virtual |
Deselects the selected tab.
|
virtual |
Returns the pathname that was used to load the tab.
|
virtual |
Returns the size of the tabs, after the scaling transformation.
Implements tgui::OBJECT.
|
virtual |
Get the name of the currently selected tab.
|
virtual |
Get the index of the currently selected tab.
|
virtual |
Returns the size of the tabs, unaffected by scaling.
Implements tgui::OBJECT.
|
virtual |
Returns the height of the tabs.
|
virtual |
Get the text color that is currently being used inside the tabs.
|
virtual |
Returns the font of the tabs.
|
virtual |
Returns the character size of the text.
|
virtual |
Creates the Tab object.
pathname | The path to the folder that contains the images for the tabs. The folder must also contain an info.txt file, which will give more information about the tab. |
Overload of assignment operator.
right | Instance to assign |
|
virtual |
Removes a tab with a given name.
name | The name of the tab to remove. |
When multiple tabs have the same name, only the first will be removed.
|
virtual |
Removes a tab with a given index.
index | The index of the tab to remove. |
When the index is too high then nothing will happen.
|
virtual |
Removes all tabs.
|
virtual |
Selects the tab with a given name.
name | The name of the tab to select. |
When the name doen't match any tab then nothing will be changed. If there are multiple tabs with the same name then the first one will be selected.
|
virtual |
Selects the tab with a given index.
index | The index of the tab to select. |
When the index is too high then nothing will happen.
|
virtual |
Changes the size of a tab.
width | The maximum width for a single tab. |
height | The height of all the tabs. |
The width parameter will just change maximumTabWidth. The height parameter will just change the tab height with setTabHeight.
Implements tgui::OBJECT.
|
virtual |
Changes the height of the tabs.
height | By default, it is the height of the tab image that is loaded with the load function. |
|
virtual |
Set the text color that will be used inside the tabs.
color | The new text color. |
|
virtual |
Changes the font of the tabs.
When you don't call this function then the global font will be use. This global font can be changed by changing gloabalFont from the parent.
font | The new font. |
|
virtual |
Changes the character size of the text.
textSize | The new size of the text. If the size is 0 (default) then the text will be scaled to fit in the tab. |
unsigned int tgui::Tab::distanceToSide |
The distance between the side of the tab and the text that is drawn on top of the tab.
unsigned int tgui::Tab::maximumTabWidth |
The maximum width of a single tab. By default, this number is 0 which means that there is no limitation.