26 #ifndef _TGUI_LISTBOX_INCLUDED_
27 #define _TGUI_LISTBOX_INCLUDED_
48 ListBox(
const ListBox& copy);
60 ListBox& operator= (
const ListBox& right);
66 virtual void initialize();
72 virtual ListBox* clone();
91 virtual bool load(
unsigned int width,
93 const std::string& scrollbarPathname =
"",
94 unsigned int itemHeight = 0);
103 virtual void setSize(
float width,
float height);
109 virtual Vector2u getSize()
const;
115 virtual Vector2f getScaledSize()
const;
123 virtual std::string getLoadedScrollbarPathname()
const;
135 virtual void changeColors(
const sf::Color& backgroundColor = sf::Color::White,
136 const sf::Color& textColor = sf::Color::Black,
137 const sf::Color& selectedBackgroundColor = sf::Color(50, 100, 200),
138 const sf::Color& selectedTextColor = sf::Color::White,
139 const sf::Color& borderColor = sf::Color::Black);
146 virtual void setBackgroundColor(
const sf::Color& backgroundColor);
153 virtual void setTextColor(
const sf::Color& textColor);
160 virtual void setSelectedBackgroundColor(
const sf::Color& selectedBackgroundColor);
167 virtual void setSelectedTextColor(
const sf::Color& selectedTextColor);
174 virtual void setBorderColor(
const sf::Color& borderColor);
180 virtual const sf::Color& getBackgroundColor()
const;
185 virtual const sf::Color& getTextColor()
const;
190 virtual const sf::Color& getSelectedBackgroundColor()
const;
195 virtual const sf::Color& getSelectedTextColor()
const;
200 virtual const sf::Color& getBorderColor()
const;
209 virtual void setTextFont(
const sf::Font& font);
215 virtual const sf::Font* getTextFont()
const;
232 virtual unsigned int addItem(
const sf::String& itemName);
248 virtual bool setSelectedItem(
const sf::String& itemName);
264 virtual bool setSelectedItem(
unsigned int id);
270 virtual void removeItem(
unsigned int id);
276 virtual void removeItem(
const sf::String& itemName);
282 virtual void removeAllItems();
292 virtual sf::String getItem(
unsigned int id)
const;
304 virtual unsigned int getItemID(
const sf::String& itemName)
const;
310 virtual std::vector<sf::String>& getItems();
320 virtual sf::String getSelectedItem()
const;
332 virtual unsigned int getSelectedItemID()
const;
338 virtual bool setScrollbar(
const std::string& scrollbarPathname);
346 virtual void removeScrollbar();
355 virtual void setItemHeight(
unsigned int itemHeight);
360 virtual unsigned int getItemHeight()
const;
369 virtual void setMaximumItems(
unsigned int maximumItems = 0);
374 virtual unsigned int getMaximumItems()
const;
385 virtual void setBorders(
unsigned int leftBorder = 0,
386 unsigned int topBorder = 0,
387 unsigned int rightBorder = 0,
388 unsigned int bottomBorder = 0);
395 virtual bool mouseOnObject(
float x,
float y);
396 virtual void leftMousePressed(
float x,
float y);
397 virtual void leftMouseReleased(
float x,
float y);
398 virtual void mouseMoved(
float x,
float y);
399 virtual void mouseWheelMoved(
int delta);
400 virtual void mouseNotOnObject();
401 virtual void mouseNoLongerDown();
411 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
418 std::vector<sf::String> m_Items;
421 unsigned int m_SelectedItem;
425 unsigned int m_ItemHeight;
427 unsigned int m_TextSize;
430 unsigned int m_MaxItems;
436 std::string m_LoadedScrollbarPathname;
439 sf::Color m_BackgroundColor;
440 sf::Color m_TextColor;
441 sf::Color m_SelectedBackgroundColor;
442 sf::Color m_SelectedTextColor;
443 sf::Color m_BorderColor;
459 #endif //_TGUI_LISTBOX_INCLUDED_
The parent struct for every object.
Definition: Objects.hpp:36
Parent struct for every object that has borders.
Definition: Objects.hpp:299
Definition: ListBox.hpp:37
Definition: ComboBox.hpp:35