Public Member Functions | |
ComboBox () | |
Default constructor. More... | |
ComboBox (const ComboBox ©) | |
Copy constructor. More... | |
virtual | ~ComboBox () |
Destructor. More... | |
ComboBox & | operator= (const ComboBox &right) |
Overload of assignment operator. More... | |
virtual bool | load (const std::string &comboBoxPathname, float width, float height, unsigned int nrOfItemsInListToDisplay=10, const std::string &scrollbarPathname="") |
Loads the combo box. More... | |
virtual void | setSize (float width, float height) |
Changes the size of the combo box. More... | |
virtual Vector2u | getSize () const |
Returns the size of the combo box, unaffected by scaling. More... | |
virtual Vector2f | getScaledSize () const |
Returns the size of the combo box, after the scaling transformation. More... | |
virtual std::string | getLoadedPathname () const |
Returns the pathname that was used to load the combo box. More... | |
virtual std::string | getLoadedScrollbarPathname () const |
Returns the pathname that was used to load the scrollbar. More... | |
virtual void | setItemsToDisplay (unsigned int nrOfItemsInListToDisplay) |
Changes the number of items that are displayed in the list. More... | |
virtual unsigned int | getItemsToDisplay () const |
Returns the number of items that are displayed in the list. More... | |
virtual void | changeColors (const sf::Color &backgroundColor=sf::Color::White, const sf::Color &textColor=sf::Color::Black, const sf::Color &selectedBackgroundColor=sf::Color(50, 100, 200), const sf::Color &selectedTextColor=sf::Color::White, const sf::Color &borderColor=sf::Color::Black) |
Changes the colors that are used in the combo box. More... | |
virtual void | setBackgroundColor (const sf::Color &backgroundColor) |
Set the background color that will be used inside the combo box. More... | |
virtual void | setTextColor (const sf::Color &textColor) |
Set the text color that will be used inside the combo box. More... | |
virtual void | setSelectedBackgroundColor (const sf::Color &selectedBackgroundColor) |
Set the background color of the selected text that will be used inside the combo box. More... | |
virtual void | setSelectedTextColor (const sf::Color &selectedTextColor) |
Set the text color of the selected text that will be used inside the combo box. More... | |
virtual void | setBorderColor (const sf::Color &borderColor) |
Set the border color text that will be used inside the combo box. More... | |
virtual const sf::Color & | getBackgroundColor () const |
Get the background color that is currently being used inside the combo box. More... | |
virtual const sf::Color & | getTextColor () const |
Get the text color that is currently being used inside the combo box. More... | |
virtual const sf::Color & | getSelectedBackgroundColor () const |
Get the background color of the selected text that is currently being used inside the combo box. More... | |
virtual const sf::Color & | getSelectedTextColor () const |
Get the text color of the selected text that is currently being used inside the combo box. More... | |
virtual const sf::Color & | getBorderColor () const |
Get the border color that is currently being used inside the combo box. More... | |
virtual void | setTextFont (const sf::Font &font) |
Changes the text font. More... | |
virtual const sf::Font * | getTextFont () const |
Returns the text font. More... | |
virtual void | setBorders (unsigned int leftBorder=0, unsigned int topBorder=0, unsigned int rightBorder=0, unsigned int bottomBorder=0) |
Changes the size of the borders. More... | |
virtual unsigned int | addItem (const sf::String &itemName) |
Adds an item to the list, so that it can be selected later. More... | |
virtual bool | setSelectedItem (const sf::String &itemName) |
Selects an item from the list. More... | |
virtual bool | setSelectedItem (unsigned int id) |
Selects an item from the list. More... | |
virtual void | removeItem (unsigned int id) |
Removes an item from the list with a given id. More... | |
virtual void | removeItem (const sf::String &itemName) |
Removes all items from the list with a given name. More... | |
virtual void | removeAllItems () |
Removes all items from the list. More... | |
virtual sf::String | getItem (unsigned int id) const |
Returns the item name of the given id. More... | |
virtual unsigned int | getItemID (const sf::String &itemName) const |
Returns the id of the first item with the given name. More... | |
virtual std::vector< sf::String > & | getItems () const |
Returns the list that constains all the items. More... | |
virtual sf::String | getSelectedItem () const |
Returns the currently selected item. More... | |
virtual unsigned int | getSelectedItemID () const |
Get the id of the selected item. More... | |
virtual bool | setScrollbar (const std::string &scrollbarPathname) |
Changes the scrollbar that is displayed next to the list. More... | |
virtual void | removeScrollbar () |
Removes the scrollbar. More... | |
virtual void | setMaximumItems (unsigned int maximumItems=0) |
Changes the maximum items that the combo box can contain. More... | |
virtual unsigned int | getMaximumItems () const |
Returns the maximum items that the combo box can contain. 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 Member Functions inherited from tgui::OBJECT_BORDERS | |
OBJECT_BORDERS () | |
Default constructor. More... | |
virtual Vector4u | getBorders () const |
Returns the size of the borders as a tgui::Vector4u. More... | |
tgui::ComboBox::ComboBox | ( | ) |
Default constructor.
tgui::ComboBox::ComboBox | ( | const ComboBox & | copy | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
Adds an item to the list, so that it can be selected later.
itemName | The name of the item you want to add (this is the text that will be displayed inside the combo box) |
|
virtual |
Changes the colors that are used in the combo box.
backgroundColor | The color of the background of the combo box |
textColor | The color of the text |
selectedBackgroundColor | The color of the background of the selected item in the list |
selectedTextColor | The color of the text when it is selected in the list |
borderColor | The color of the borders |
|
virtual |
Get the background color that is currently being used inside the combo box.
|
virtual |
Get the border color that is currently being used inside the combo box.
|
virtual |
Returns the item name of the given id.
The string will be empty when the id was too high or when it was 0.
|
virtual |
Returns the id of the first item with the given name.
If none of the items matches then the id will be 0.
|
virtual |
Returns the list that constains all the items.
|
virtual |
Returns the number of items that are displayed in the list.
When there is no scrollbar then this is the maximum number of items. If there is one, then it will only become visible when there are more items than this number.
|
virtual |
Returns the pathname that was used to load the combo box.
When the combo box has not been loaded yet then this function will return an empty string.
|
virtual |
Returns the pathname that was used to load the scrollbar.
When no scrollbar was loaded then this function will return an empty string.
|
virtual |
Returns the maximum items that the combo box can contain.
If this function returns 0 then there is no limit. If no scrollbar was loaded then the amount of items that are displayed will still be a limit.
|
virtual |
Returns the size of the combo box, after the scaling transformation.
Implements tgui::OBJECT.
|
virtual |
Get the background color of the selected text that is currently being used inside the combo box.
|
virtual |
Returns the currently selected item.
When no item was selected then this function will return an empty string.
|
virtual |
Get the id of the selected item.
When no item was selected then this function returns 0.
|
virtual |
Get the text color of the selected text that is currently being used inside the combo box.
|
virtual |
Returns the size of the combo box, unaffected by scaling.
Implements tgui::OBJECT.
|
virtual |
Get the text color that is currently being used inside the combo box.
|
virtual |
Returns the text font.
|
virtual |
Loads the combo box.
comboBoxPathname | The path to the folder that contains the arrow image(s). The folder must also contain an info.txt file, which will give more information about the comb box. |
width | The width of the combo box (borders included). |
height | The height of the combo box (borders included). |
nrOfItemsToDisplay | The amount of items that are displayed when you click on the arrow. If there is no scrollbar then this will also be the maximum amount of items that the combo box can contain. |
scrollbarPathname | The ScrollbarPathname is the pathname needed to load the scrollbar. If not provided then there will be no possibility to scroll, thus no items will be added when the combo box is full. |
|
virtual |
Removes all items from the list.
|
virtual |
Removes an item from the list with a given id.
|
virtual |
Removes all items from the list with a given name.
|
virtual |
Removes the scrollbar.
When there are too many items to fit in the list then the items will be removed.
|
virtual |
Set the background color that will be used inside the combo box.
|
virtual |
Set the border color text that will be used inside the combo box.
|
virtual |
Changes the size of the borders.
leftBorder | The width of the left border |
topBorder | The height of the top border |
rightBorder | The width of the right border |
bottomBorder | The height of the bottom border |
Implements tgui::OBJECT_BORDERS.
|
virtual |
Changes the number of items that are displayed in the list.
When there is no scrollbar then this is the maximum number of items. If there is one, then it will only become visible when there are more items than this number.
|
virtual |
Changes the maximum items that the combo box can contain.
If maximumItems is 0 then there is no limit. If no scrollbar was loaded then the amount of items that are displayed is already a limit.
|
virtual |
Changes the scrollbar that is displayed next to the list.
|
virtual |
Set the background color of the selected text that will be used inside the combo box.
|
virtual |
Selects an item from the list.
When adding items to the combo box with the addItem function, none of them will be selected. If you don't want the combo box to stay empty until the user selects something, but you want a default item instead, then you can use this function to select an item. The first item that matches the name will be selected.
|
virtual |
Selects an item from the list.
When adding items to the combo box with the addItem function, none of them will be selected. If you don't want the combo box to stay empty until the user selects something, but you want a default item instead, then you can use this function to select an item.
The id starts counting from 1. If you pass 0 to this function then none of the items will be selected.
|
virtual |
Set the text color of the selected text that will be used inside the combo box.
|
virtual |
Changes the size of the combo box.
width | The new width of the combo box (borders included) |
height | The new height of the combo box (borders included) |
Implements tgui::OBJECT.
|
virtual |
Set the text color that will be used inside the combo box.
|
virtual |
Changes the text font.