26 #ifndef TGUI_MENU_BAR_HPP 27 #define TGUI_MENU_BAR_HPP 30 #include <TGUI/Widget.hpp> 68 bool load(
const std::string& configFileFilename,
const std::string& sectionName =
"MenuBar");
78 const std::string& getLoadedConfigFile()
const;
90 virtual void setSize(
float width,
float height);
102 virtual sf::Vector2f getSize()
const;
111 void addMenu(
const sf::String& text);
129 bool addMenuItem(
const sf::String& menu,
const sf::String& text);
142 bool removeMenu(
const sf::String& menu);
149 void removeAllMenus();
161 bool removeMenuItem(
const sf::String& menu,
const sf::String& menuItem);
173 void changeColors(
const sf::Color& backgroundColor = sf::Color::White,
174 const sf::Color& textColor = sf::Color::Black,
175 const sf::Color& selectedBackgroundColor = sf::Color(50, 100, 200),
176 const sf::Color& selectedTextColor = sf::Color::White);
185 void setBackgroundColor(
const sf::Color& backgroundColor);
194 void setTextColor(
const sf::Color& textColor);
203 void setSelectedBackgroundColor(
const sf::Color& selectedBackgroundColor);
212 void setSelectedTextColor(
const sf::Color& selectedTextColor);
221 const sf::Color& getBackgroundColor()
const;
230 const sf::Color& getTextColor()
const;
239 const sf::Color& getSelectedBackgroundColor()
const;
248 const sf::Color& getSelectedTextColor()
const;
260 void setTextFont(
const sf::Font& font);
269 const sf::Font* getTextFont()
const;
279 void setTextSize(
unsigned int size);
288 unsigned int getTextSize()
const;
297 void setDistanceToSide(
unsigned int distanceToSide);
306 unsigned int getDistanceToSide()
const;
318 void setMinimumSubMenuWidth(
unsigned int minimumWidth);
329 unsigned int getMinimumSubMenuWidth()
const;
335 virtual bool mouseOnWidget(
float x,
float y);
340 virtual void leftMousePressed(
float x,
float y);
345 virtual void leftMouseReleased(
float x,
float y);
350 virtual void mouseMoved(
float x,
float y);
355 virtual void mouseNoLongerDown();
363 virtual bool setProperty(std::string property,
const std::string& value);
370 virtual bool getProperty(std::string property, std::string& value)
const;
378 virtual std::list< std::pair<std::string, std::string> > getPropertyList()
const;
387 virtual void initialize(
Container *
const container);
393 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
404 MenuItemClicked = WidgetCallbacksCount * 1,
405 AllMenuBarCallbacks = WidgetCallbacksCount * 2 - 1,
406 MenuBarCallbacksCount = WidgetCallbacksCount * 2
416 std::vector<sf::Text> menuItems;
417 int selectedMenuItem;
420 std::string m_LoadedConfigFile;
422 std::vector<Menu> m_Menus;
426 const sf::Font* m_TextFont;
430 unsigned int m_TextSize;
432 unsigned int m_DistanceToSide;
434 unsigned int m_MinimumSubMenuWidth;
436 sf::Color m_BackgroundColor;
437 sf::Color m_TextColor;
438 sf::Color m_SelectedBackgroundColor;
439 sf::Color m_SelectedTextColor;
450 #endif // TGUI_MENU_BAR_HPP Namespace that contains all TGUI functions and classes.
Definition: AnimatedPicture.hpp:33
Parent class for widgets that store multiple widgets.
Definition: Container.hpp:43