summaryrefslogtreecommitdiff
path: root/src/interface/SaveButton.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-19 13:44:59 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-19 13:44:59 (GMT)
commit44639a6423c03552a3c0faafab27ef8f395f73a6 (patch)
tree1a4fc49a56060759fcbec6f18e9159cf126e8606 /src/interface/SaveButton.h
parent4a60b97c700c2f1843b7e99313554cb89fb5da4e (diff)
downloadpowder-44639a6423c03552a3c0faafab27ef8f395f73a6.zip
powder-44639a6423c03552a3c0faafab27ef8f395f73a6.tar.gz
Some folder changes, started search and client
Diffstat (limited to 'src/interface/SaveButton.h')
-rw-r--r--src/interface/SaveButton.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/interface/SaveButton.h b/src/interface/SaveButton.h
new file mode 100644
index 0000000..8834d8a
--- /dev/null
+++ b/src/interface/SaveButton.h
@@ -0,0 +1,50 @@
+#ifndef SAVEBUTTON_H_
+#define SAVEBUTTON_H_
+
+#include <string>
+
+#include "Component.h"
+#include "search/Save.h"
+#include "Graphics.h"
+#include "search/Thumbnail.h"
+
+namespace ui
+{
+class SaveButton;
+class SaveButtonAction
+{
+public:
+ virtual void ActionCallback(ui::SaveButton * sender) {}
+};
+
+class SaveButton : public Component
+{
+ Save save;
+ Thumbnail * thumbnail;
+public:
+ SaveButton(Window* parent_state, Save save);
+
+ SaveButton(Point position, Point size, Save save);
+
+ SaveButton(Save save);
+ virtual ~SaveButton();
+
+ virtual void OnMouseClick(int x, int y, unsigned int button);
+ virtual void OnMouseUnclick(int x, int y, unsigned int button);
+
+ virtual void OnMouseEnter(int x, int y);
+ virtual void OnMouseLeave(int x, int y);
+
+ virtual void Draw(const Point& screenPos);
+ virtual void Tick(float dt);
+
+ inline bool GetState() { return state; }
+ virtual void DoAction();
+ void SetActionCallback(SaveButtonAction * action);
+protected:
+ bool isButtonDown, state, isMouseInside;
+ SaveButtonAction * actionCallback;
+};
+}
+#endif /* BUTTON_H_ */
+