diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-14 18:51:24 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-14 18:51:24 (GMT) |
| commit | 2c9295007a287dc01ff63fcf7b3da141f7474e37 (patch) | |
| tree | e8065e920ca45686a40e41fd46513e13d46f47b0 /includes/interface.old/Button.h | |
| parent | fc2f52099c0bbb2412046252bf7b5e4113bbe8e4 (diff) | |
| download | powder-2c9295007a287dc01ff63fcf7b3da141f7474e37.zip powder-2c9295007a287dc01ff63fcf7b3da141f7474e37.tar.gz | |
Various things, also IEF UI
Diffstat (limited to 'includes/interface.old/Button.h')
| -rw-r--r-- | includes/interface.old/Button.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/includes/interface.old/Button.h b/includes/interface.old/Button.h new file mode 100644 index 0000000..1b2900e --- /dev/null +++ b/includes/interface.old/Button.h @@ -0,0 +1,42 @@ +/* + * Button.h + * + * Created on: Jan 8, 2012 + * Author: Simon + */ + +#ifndef BUTTON_H_ +#define BUTTON_H_ + +#include <string> + +#include "Component.h" + +namespace ui +{ + class Button : public Component + { + public: + Button(int x, int y, int width, int height, const std::string& buttonText); + + bool Toggleable; + + std::string ButtonText; + + virtual void OnMouseClick(int x, int y, unsigned int button); + virtual void OnMouseUnclick(int x, int y, unsigned int button); + virtual void OnMouseUp(int x, int y, unsigned int button); + + virtual void OnMouseEnter(int x, int y, int dx, int dy); + virtual void OnMouseLeave(int x, int y, int dx, int dy); + + virtual void Draw(void* userdata); + + inline bool GetState() { return state; } + virtual void DoAction(); //action of button what ever it may be + + protected: + bool isButtonDown, state, isMouseInside; + }; +} +#endif /* BUTTON_H_ */ |
