OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
imagebutton.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_WIDGETS_IMAGEBUTTON_H
2 #define OPENMW_COMPONENTS_WIDGETS_IMAGEBUTTON_H
3 
4 #include <MyGUI_ImageBox.h>
5 
6 namespace Gui
7 {
8 
12  class ImageButton : public MyGUI::ImageBox
13  {
14  MYGUI_RTTI_DERIVED(ImageButton)
15 
16  public:
17  MyGUI::IntSize getRequestedSize();
18 
20  void setImage(const std::string& image);
21 
22  protected:
23  virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
24  virtual void onMouseLostFocus(MyGUI::Widget* _new);
25  virtual void onMouseSetFocus(MyGUI::Widget* _old);
26  virtual void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id);
27  virtual void onMouseButtonReleased(int _left, int _top, MyGUI::MouseButton _id);
28 
29  std::string mImageHighlighted;
30  std::string mImageNormal;
31  std::string mImagePushed;
32  };
33 
34 }
35 
36 #endif
virtual void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id)
Definition: imagebutton.cpp:37
std::string mImageHighlighted
Definition: imagebutton.hpp:29
void setImage(const std::string &image)
Set mImageNormal, mImageHighlighted and mImagePushed based on file convention (image_idle.ext, image_over.ext and image_pressed.ext)
Definition: imagebutton.cpp:56
std::string mImageNormal
Definition: imagebutton.hpp:30
virtual void onMouseButtonReleased(int _left, int _top, MyGUI::MouseButton _id)
Definition: imagebutton.cpp:70
virtual void onMouseSetFocus(MyGUI::Widget *_old)
Definition: imagebutton.cpp:25
allows using different image textures depending on the button state
Definition: imagebutton.hpp:12
virtual void onMouseLostFocus(MyGUI::Widget *_new)
Definition: imagebutton.cpp:31
virtual void setPropertyOverride(const std::string &_key, const std::string &_value)
Definition: imagebutton.cpp:8
std::string mImagePushed
Definition: imagebutton.hpp:31
MyGUI::IntSize getRequestedSize()
Definition: imagebutton.cpp:45