26 #ifndef TGUI_LIST_BOX_HPP 27 #define TGUI_LIST_BOX_HPP 30 #include <TGUI/Widget.hpp> 97 bool load(
const std::string& configFileFilename,
const std::string& sectionName =
"ListBox");
107 const std::string& getLoadedConfigFile()
const;
117 void setSize(
float width,
float height);
128 virtual sf::Vector2f getSize()
const;
139 virtual sf::Vector2f getFullSize()
const;
152 void changeColors(
const sf::Color& backgroundColor = sf::Color::White,
153 const sf::Color& textColor = sf::Color::Black,
154 const sf::Color& selectedBackgroundColor = sf::Color(50, 100, 200),
155 const sf::Color& selectedTextColor = sf::Color::White,
156 const sf::Color& borderColor = sf::Color::Black);
165 void setBackgroundColor(
const sf::Color& backgroundColor);
174 void setTextColor(
const sf::Color& textColor);
183 void setSelectedBackgroundColor(
const sf::Color& selectedBackgroundColor);
192 void setSelectedTextColor(
const sf::Color& selectedTextColor);
201 void setBorderColor(
const sf::Color& borderColor);
210 const sf::Color& getBackgroundColor()
const;
219 const sf::Color& getTextColor()
const;
228 const sf::Color& getSelectedBackgroundColor()
const;
237 const sf::Color& getSelectedTextColor()
const;
246 const sf::Color& getBorderColor()
const;
258 void setTextFont(
const sf::Font& font);
267 const sf::Font* getTextFont()
const;
287 int addItem(
const sf::String& itemName,
int id = 0);
306 bool setSelectedItem(
const sf::String& itemName);
325 bool setSelectedItem(
int index);
345 bool removeItem(
unsigned int index);
358 bool removeItem(
const sf::String& itemName);
369 unsigned int removeItemsById(
int id);
376 void removeAllItems();
390 sf::String getItem(
unsigned int index)
const;
406 int getItemIndex(
const sf::String& itemName)
const;
415 std::vector<sf::String>& getItems();
427 sf::String getSelectedItem()
const;
441 int getSelectedItemIndex()
const;
451 int getSelectedItemId()
const;
463 bool changeItem(
unsigned int index,
const sf::String& newValue);
475 unsigned int changeItems(
const sf::String& originalValue,
const sf::String& newValue);
487 unsigned int changeItemsById(
int id,
const sf::String& newValue);
501 bool setScrollbar(
const std::string& scrollbarConfigFileFilename);
510 void removeScrollbar();
523 void setItemHeight(
unsigned int itemHeight);
532 unsigned int getItemHeight()
const;
544 void setMaximumItems(
unsigned int maximumItems = 0);
554 unsigned int getMaximumItems()
const;
566 virtual void setBorders(
unsigned int leftBorder = 0,
567 unsigned int topBorder = 0,
568 unsigned int rightBorder = 0,
569 unsigned int bottomBorder = 0);
582 virtual void setTransparency(
unsigned char transparency);
588 virtual bool mouseOnWidget(
float x,
float y);
593 virtual void leftMousePressed(
float x,
float y);
598 virtual void leftMouseReleased(
float x,
float y);
603 virtual void mouseMoved(
float x,
float y);
608 virtual void mouseWheelMoved(
int delta,
int x,
int y);
613 virtual void mouseNotOnWidget();
618 virtual void mouseNoLongerDown();
626 virtual bool setProperty(std::string property,
const std::string& value);
633 virtual bool getProperty(std::string property, std::string& value)
const;
641 virtual std::list< std::pair<std::string, std::string> > getPropertyList()
const;
650 virtual void initialize(
Container *
const container);
656 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
667 ItemSelected = WidgetCallbacksCount * 1,
668 AllListBoxCallbacks = WidgetCallbacksCount * 2 - 1,
669 ListBoxCallbacksCount = WidgetCallbacksCount * 2
676 std::string m_LoadedConfigFile;
679 std::vector<sf::String> m_Items;
680 std::vector<int> m_ItemIds;
687 unsigned int m_ItemHeight;
688 unsigned int m_TextSize;
691 unsigned int m_MaxItems;
697 sf::Color m_BackgroundColor;
698 sf::Color m_TextColor;
699 sf::Color m_SelectedBackgroundColor;
700 sf::Color m_SelectedTextColor;
701 sf::Color m_BorderColor;
704 const sf::Font* m_TextFont;
717 #endif // TGUI_LIST_BOX_HPP Namespace that contains all TGUI functions and classes.
Definition: AnimatedPicture.hpp:33
Definition: ComboBox.hpp:38
Parent class for widgets that store multiple widgets.
Definition: Container.hpp:43
Definition: ListBox.hpp:40
ListBoxCallbacks
Defines specific triggers to ListBox.
Definition: ListBox.hpp:665