MyGUI_Button.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_BUTTON_H_
#define MYGUI_BUTTON_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_TextBox.h"
namespace MyGUI
{
class MYGUI_EXPORT Button : public TextBox, public MemberObsolete<Button>
{
MYGUI_RTTI_DERIVED(Button)
public:
void setStateSelected(bool _check);
bool getStateSelected() const;
void setModeImage(bool _value);
bool getModeImage() const;
void setImageResource(std::string_view _name);
void setImageGroup(std::string_view _name);
void setImageName(std::string_view _name);
/*internal:*/
void _setKeyFocus(bool _focus);
void _setMouseFocus(bool _focus);
ImageBox* _getImageBox() const;
protected:
void initialiseOverride() override;
void shutdownOverride() override;
void onKeyLostFocus(Widget* _new) override;
void onKeySetFocus(Widget* _old) override;
void onMouseLostFocus(Widget* _new) override;
void onMouseSetFocus(Widget* _old) override;
void onMouseButtonPressed(int _left, int _top, MouseButton _id) override;
void onMouseButtonReleased(int _left, int _top, MouseButton _id) override;
void baseUpdateEnable() override;
bool _setState(std::string_view _value);
void setPropertyOverride(std::string_view _key, std::string_view _value) override;
private:
void updateButtonState();
private:
bool mIsMousePressed{false};
bool mIsKeyFocus{false};
bool mIsMouseFocus{false};
// is fixed in pressed position
bool mStateSelected{false};
ImageBox* mImage{nullptr};
bool mModeImage{false};
};
} // namespace MyGUI
#endif // MYGUI_BUTTON_H_
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
MyGUI_TextBox.h
MyGUI::Button
widget description should be here.
Definition MyGUI_Button.h:20
MyGUI::Button::onMouseSetFocus
void onMouseSetFocus(Widget *_old) override
Definition MyGUI_Button.cpp:45
MyGUI::Button::_setMouseFocus
void _setMouseFocus(bool _focus)
Definition MyGUI_Button.cpp:134
MyGUI::Button::_setState
bool _setState(std::string_view _value)
Definition MyGUI_Button.cpp:156
MyGUI::Button::onMouseButtonReleased
void onMouseButtonReleased(int _left, int _top, MouseButton _id) override
Definition MyGUI_Button.cpp:70
MyGUI::Button::onKeyLostFocus
void onKeyLostFocus(Widget *_new) override
Definition MyGUI_Button.cpp:38
MyGUI::Button::onMouseButtonPressed
void onMouseButtonPressed(int _left, int _top, MouseButton _id) override
Definition MyGUI_Button.cpp:59
MyGUI::Button::setImageName
void setImageName(std::string_view _name)
Definition MyGUI_Button.cpp:184
MyGUI::Button::onKeySetFocus
void onKeySetFocus(Widget *_old) override
Definition MyGUI_Button.cpp:31
MyGUI::Button::getStateSelected
bool getStateSelected() const
Get buton selected.
Definition MyGUI_Button.cpp:221
MyGUI::Button::getModeImage
bool getModeImage() const
Definition MyGUI_Button.cpp:226
MyGUI::Button::_getImageBox
ImageBox * _getImageBox() const
Definition MyGUI_Button.cpp:231
MyGUI::Button::setPropertyOverride
void setPropertyOverride(std::string_view _key, std::string_view _value) override
Definition MyGUI_Button.cpp:190
MyGUI::Button::shutdownOverride
void shutdownOverride() override
Definition MyGUI_Button.cpp:24
MyGUI::Button::baseUpdateEnable
void baseUpdateEnable() override
Definition MyGUI_Button.cpp:140
MyGUI::Button::setImageResource
void setImageResource(std::string_view _name)
Definition MyGUI_Button.cpp:170
MyGUI::Button::setStateSelected
void setStateSelected(bool _check)
Set button selected state.
Definition MyGUI_Button.cpp:119
MyGUI::Button::initialiseOverride
void initialiseOverride() override
Definition MyGUI_Button.cpp:16
MyGUI::Button::setModeImage
void setModeImage(bool _value)
Definition MyGUI_Button.cpp:150
MyGUI::Button::onMouseLostFocus
void onMouseLostFocus(Widget *_new) override
Definition MyGUI_Button.cpp:52
MyGUI::Button::setImageGroup
void setImageGroup(std::string_view _name)
Definition MyGUI_Button.cpp:177
MyGUI::Button::_setKeyFocus
void _setKeyFocus(bool _focus)
Definition MyGUI_Button.cpp:128
MyGUI::ImageBox
widget description should be here.
Definition MyGUI_ImageBox.h:22
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::TextBox
widget description should be here.
Definition MyGUI_TextBox.h:20
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16