26#ifndef TGUI_BUTTON_BASE_HPP
27#define TGUI_BUTTON_BASE_HPP
30#include <TGUI/Renderers/ButtonRenderer.hpp>
31#include <TGUI/Widgets/ClickableWidget.hpp>
32#include <TGUI/Components.hpp>
45 typedef std::shared_ptr<ButtonBase>
Ptr;
46 typedef std::shared_ptr<const ButtonBase>
ConstPtr;
56 ButtonBase(
const char* typeName,
bool initRenderer);
102 using Widget::setSize;
169 void leftMousePressed(
Vector2f pos)
override;
174 void leftMouseReleased(
Vector2f pos)
override;
179 void leftMouseButtonNoLongerDown()
override;
219 std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
225 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
237 virtual void updateSize();
243 virtual void initComponents();
249 void addComponent(
const std::shared_ptr<priv::dev::Component>& component);
255 std::shared_ptr<priv::dev::Component> getComponent(
const String& name);
264 priv::dev::ComponentState m_state = priv::dev::ComponentState::Normal;
266 bool m_autoSize =
true;
267 bool m_updatingSizeWhileSettingText =
false;
269 priv::dev::StylePropertyBackground background;
270 priv::dev::StylePropertyText text;
273 std::map<String, priv::dev::StylePropertyBase*> m_stylePropertiesNames;
274 std::map<String, std::vector<priv::dev::StylePropertyBase*>> m_stylePropertiesGlobalNames;
275 std::map<String, std::shared_ptr<priv::dev::Component>> m_namedComponents;
278 std::shared_ptr<priv::dev::BackgroundComponent> m_backgroundComponent;
279 std::shared_ptr<priv::dev::TextComponent> m_textComponent;
281 std::vector<std::shared_ptr<priv::dev::Component>> m_components;
Base class for render targets.
Definition BackendRenderTarget.hpp:48
Class to store the position or size of a widget.
Definition Layout.hpp:262
Wrapper class to store strings.
Definition String.hpp:79
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
States used for drawing.
Definition RenderStates.hpp:39