-
Notifications
You must be signed in to change notification settings - Fork 2
/
basicButton.h
61 lines (45 loc) · 2.26 KB
/
basicButton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef H_BASICBUTTON
#define H_BASICBUTTON
#include "actor.h"
#define TOOLTIP_RIGHT 1
#define TOOLTIP_LEFT 2
#define TOOLTIP_ABOVE 3
#define TOOLTIP_BELOW 4
class Input;
class BasicButton: public Actor{
public:
bool bOver; //is set from Input - mouse hovers over button
bool bDrawName; //draws the button name onto it
bool bAlwaysUpdate; //updates this button even if mouse is not over and is not in focus
bool bPermanent; //don't delete when deselecting - also pushes Buttons to "saveableButtonList" when true on default...
bool bScreenOverlay; //gets drawn when running the scene
bool bMessageWindow; //this button is used as an on-screen message.
bool bDragable; //this button can be dragged around...
bool bConfineDragX; //can only be dragged around horizontal
bool bConfineDragY; //can only be dragged around vertical
bool bResetAfterDrag; //sets button back to initial location after finished dragging
bool bTriggerWhileDragging; //triggers parent while dragging
string tooltip; //a tooltip to show when mouse hovers over button
Vector2f tooltipOffset; //where to draw the tooltip
string buttonProperty; //stores a string - often used to set the property of some Actor
int level; // used for submenus
BasicButton();
virtual ~BasicButton();
//setup functions
virtual void registerProperties();
virtual void setup();
virtual void update(double deltaTime);
virtual void drawTooltip();
virtual void drawPlane();
virtual void mouseOver();
virtual void mouseDrag();
virtual void finishDrag();
virtual void clickedLeft();
virtual void clickedRight();
virtual void focusClick();
virtual void deselect(int depth);
virtual void remove();
virtual void create();
virtual TiXmlElement* save(TiXmlElement *root);
};
#endif