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);
152 void leftMousePressed(
Vector2f pos)
override;
157 void leftMouseReleased(
Vector2f pos)
override;
162 void leftMouseButtonNoLongerDown()
override;
202 std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
208 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
226 virtual void updateSize();
232 virtual void initComponents();
238 void addComponent(
const std::shared_ptr<priv::dev::Component>& component);
244 std::shared_ptr<priv::dev::Component> getComponent(
const String& name);
253 priv::dev::ComponentState m_state = priv::dev::ComponentState::Normal;
255 bool m_autoSize =
true;
256 bool m_updatingTextSize =
false;
258 priv::dev::StylePropertyBackground background;
259 priv::dev::StylePropertyText text;
262 std::map<String, priv::dev::StylePropertyBase*> m_stylePropertiesNames;
263 std::map<String, std::vector<priv::dev::StylePropertyBase*>> m_stylePropertiesGlobalNames;
264 std::map<String, std::shared_ptr<priv::dev::Component>> m_namedComponents;
267 std::shared_ptr<priv::dev::BackgroundComponent> m_backgroundComponent;
268 std::shared_ptr<priv::dev::TextComponent> m_textComponent;
270 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:284
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