MyGUI  3.4.0
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 
13 namespace MyGUI
14 {
15 
20  public TextBox,
21  public MemberObsolete<Button>
22  {
24 
25  public:
26  Button();
27 
29  void setStateSelected(bool _value);
31  bool getStateSelected() const;
32 
37  void setModeImage(bool _value);
39  bool getModeImage() const;
40 
41  void setImageResource(const std::string& _name);
42 
43  void setImageGroup(const std::string& _name);
44 
45  void setImageName(const std::string& _name);
46 
47  /*internal:*/
48  void _setKeyFocus(bool _focus);
49  void _setMouseFocus(bool _focus);
50 
51  ImageBox* _getImageBox();
52 
53  protected:
54  void initialiseOverride() override;
55  void shutdownOverride() override;
56 
57  void onKeyLostFocus(Widget* _new) override;
58  void onKeySetFocus(Widget* _old) override;
59  void onMouseLostFocus(Widget* _new) override;
60  void onMouseSetFocus(Widget* _old) override;
61  void onMouseButtonPressed(int _left, int _top, MouseButton _id) override;
62  void onMouseButtonReleased(int _left, int _top, MouseButton _id) override;
63 
64  void baseUpdateEnable() override;
65 
66  bool _setState(const std::string& _value);
67 
68  void setPropertyOverride(const std::string& _key, const std::string& _value) override;
69 
70  private:
71  void updateButtonState();
72 
73  private:
74  bool mIsMousePressed;
75  bool mIsKeyFocus;
76  bool mIsMouseFocus;
77  // is fixed in pressed position
78  bool mStateSelected;
79 
80  ImageBox* mImage;
81  bool mModeImage;
82  };
83 
84 } // namespace MyGUI
85 
86 #endif // MYGUI_BUTTON_H_
MyGUI::ImageBox
ImageBox properties. Skin childs. ImageBox widget description should be here.
Definition: MyGUI_ImageBox.h:24
MyGUI::Widget
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:37
MyGUI::Button
Button properties. Skin childs. Button widget description should be here.
Definition: MyGUI_Button.h:22
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:16
MyGUI_Prerequest.h
MyGUI::TextBox
TextBox properties. Skin childs. TextBox widget description should be here.
Definition: MyGUI_TextBox.h:21
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:48
MyGUI::MemberObsolete
Definition: MyGUI_DeprecatedTypes.h:14
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:89
MyGUI
Definition: MyGUI_ActionController.h:15
MyGUI_TextBox.h