MyGUI: MyGUI_Button.h Source File

MyGUI 3.4.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
13namespace 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 _setKeyFocus(bool _focus);
49 void _setMouseFocus(bool _focus);
50
51 ImageBox* _getImageBox() const;
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_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:48
MyGUI_TextBox.h
MyGUI::Button
widget description should be here.
Definition MyGUI_Button.h:22
MyGUI::ImageBox
widget description should be here.
Definition MyGUI_ImageBox.h:24
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::TextBox
widget description should be here.
Definition MyGUI_TextBox.h:21
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:37
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16