43 using Ptr = std::shared_ptr<ButtonBase>;
44 using ConstPtr = std::shared_ptr<const ButtonBase>;
53 ButtonBase(
const char* typeName,
bool initRenderer);
85 TGUI_NODISCARD const
ButtonRenderer* getSharedRenderer() const override;
109 void setEnabled(
bool enabled) override;
116 virtual
void setText(const
String& text);
123 TGUI_NODISCARD const
String& getText() const;
154 void setIgnoreKeyEvents(
bool ignore);
166 TGUI_NODISCARD
bool getIgnoreKeyEvents() const;
176 void setFocused(
bool focused) override;
182 TGUI_NODISCARD
bool isMouseOnWidget(
Vector2f pos) const override;
192 void leftMouseReleased(
Vector2f pos) override;
197 void leftMouseButtonNoLongerDown() override;
213 void mouseEnteredWidget() override;
218 void mouseLeftWidget() override;
225 void rendererChanged(const
String& property) override;
230 TGUI_NODISCARD std::unique_ptr<DataIO::Node> save(SavingRenderersMap& renderers) const override;
235 void load(const std::unique_ptr<DataIO::Node>& node, const LoadingRenderersMap& renderers) override;
240 void updateTextSize() override;
250 virtual
void updateSize();
255 virtual
void updateTextPosition();
260 virtual
void initComponents();
265 void addComponent(const std::shared_ptr<priv::dev::Component>& component);
270 TGUI_NODISCARD std::shared_ptr<priv::dev::Component> getComponent(const
String& name);
278 priv::dev::ComponentState m_state = priv::dev::ComponentState::Normal;
280 bool m_autoSize = true;
281 bool m_updatingTextSize = false;
282 bool m_ignoreKeyEvents = false;
287 priv::dev::StylePropertyBackground background;
288 priv::dev::StylePropertyText text;
290 std::uint64_t m_textStyleChangedCallbackId = 0;
293 std::map<
String, priv::dev::StylePropertyBase*> m_stylePropertiesNames;
294 std::map<
String, std::vector<priv::dev::StylePropertyBase*>> m_stylePropertiesGlobalNames;
295 std::map<
String, std::shared_ptr<priv::dev::Component>> m_namedComponents;
298 std::shared_ptr<priv::dev::BackgroundComponent> m_backgroundComponent;
299 std::shared_ptr<priv::dev::TextComponent> m_textComponent;
301 std::vector<std::shared_ptr<priv::dev::Component>> m_components;