MyGUI 3.4.3
MyGUI_Button.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_BUTTON_H_
8#define MYGUI_BUTTON_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_TextBox.h"
12
13namespace MyGUI
14{
15
19 class MYGUI_EXPORT Button : public TextBox, public MemberObsolete<Button>
20 {
22
23 public:
25 void setStateSelected(bool _check);
27 bool getStateSelected() const;
28
33 void setModeImage(bool _value);
35 bool getModeImage() const;
36
37 void setImageResource(std::string_view _name);
38
39 void setImageGroup(std::string_view _name);
40
41 void setImageName(std::string_view _name);
42
43 /*internal:*/
44 void _setKeyFocus(bool _focus);
45 void _setMouseFocus(bool _focus);
46
47 ImageBox* _getImageBox() const;
48
49 protected:
50 void initialiseOverride() override;
51 void shutdownOverride() override;
52
53 void onKeyLostFocus(Widget* _new) override;
54 void onKeySetFocus(Widget* _old) override;
55 void onMouseLostFocus(Widget* _new) override;
56 void onMouseSetFocus(Widget* _old) override;
57 void onMouseButtonPressed(int _left, int _top, MouseButton _id) override;
58 void onMouseButtonReleased(int _left, int _top, MouseButton _id) override;
59
60 void baseUpdateEnable() override;
61
62 bool _setState(std::string_view _value);
63
64 void setPropertyOverride(std::string_view _key, std::string_view _value) override;
65
66 private:
67 void updateButtonState();
68
69 private:
70 bool mIsMousePressed{false};
71 bool mIsKeyFocus{false};
72 bool mIsMouseFocus{false};
73 // is fixed in pressed position
74 bool mStateSelected{false};
75
76 ImageBox* mImage{nullptr};
77 bool mModeImage{false};
78 };
79
80} // namespace MyGUI
81
82#endif // MYGUI_BUTTON_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
widget description should be here.
widget description should be here.
widget description should be here.
widget description should be here.