MyGUI 3.2.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

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
19 class MYGUI_EXPORT Button :
20 public TextBox,
21 public MemberObsolete<Button>
22 {
23 MYGUI_RTTI_DERIVED( Button )
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 _setMouseFocus(bool _focus);
49
50 ImageBox* _getImageBox();
51
52 protected:
53 virtual void initialiseOverride();
54 virtual void shutdownOverride();
55
56 virtual void onMouseLostFocus(Widget* _new);
57 virtual void onMouseSetFocus(Widget* _old);
58 virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
59 virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
60
61 virtual void baseUpdateEnable();
62
63 bool _setState(const std::string& _value);
64
65 virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
66
67 private:
68 void updateButtonState();
69
70 private:
71 // нажата ли кнопка
72 bool mIsMousePressed;
73 // в фокусе ли кнопка
74 bool mIsMouseFocus;
75 // статус кнопки нажата или нет
76 bool mStateSelected;
77
78 ImageBox* mImage;
79 bool mModeImage;
80 };
81
82 } // namespace MyGUI
83
84 #endif // MYGUI_BUTTON_H_
MyGUI::Widget
Widget properties. Widget_skin_childs Skin childs. Widget widget description should be here...
Definition: MyGUI_Widget.h:29
MyGUI::ImageBox
ImageBox properties. ImageBox_skin_childs Skin childs. ImageBox widget description should be here...
Definition: MyGUI_ImageBox.h:21
MyGUI_Prerequest.h
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:15
MyGUI::Button
Button properties. Button_skin_childs Skin childs. Button widget description should be here...
Definition: MyGUI_Button.h:19
MyGUI
Definition: MyGUI_ActionController.h:14
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:65
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::TextBox
TextBox properties. TextBox_skin_childs Skin childs. TextBox widget description should be here...
Definition: MyGUI_TextBox.h:19
MyGUI::MemberObsolete
Definition: MyGUI_DeprecatedTypes.h:13
MyGUI_TextBox.h