el h / SimpleGUI

Fork of SimpleGUI by Duncan McIntyre

Revision:
13:6714534e7974
Child:
14:e6515b19f5a0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dialogs/SpinnerDialog.h	Sat May 21 14:40:09 2016 +0000
@@ -0,0 +1,41 @@
+#ifndef SPINNER_DIALOG_H
+#define SPINNER_DIALOG_H
+
+#include "ContainerWidget.h"
+#include "SpinnerWidget.h"
+#include "BitmapWidget.h"
+
+/**
+* A Dialog takes over the whole screen and offers some sort of control
+* together with apply and cancel buttons
+**/
+class SpinnerDialog : public ContainerWidget
+{
+public:
+
+    SpinnerDialog(GraphicsContext *context);
+    SpinnerWidget *spinner();
+
+    template<typename T>
+    void onOK(T* tptr, void (T::*mptr)(Event e)) {
+        _onOK.attach(ptr, mptr);
+    }
+
+    template<typename T>
+    void onCancel(T* tptr, void (T::*mptr)(Event e)) {
+        _onCancel.attach(ptr, mptr);
+    }
+    
+private:
+
+    SpinnerWidget *_spinner;
+    FunctionPointerArg1<void,Event> _onOK;
+    FunctionPointerArg1<void,Event> _onCancel;
+    
+    void _handleOK(Event e);
+    void _handleCancel(Event e);
+
+
+};
+
+#endif
\ No newline at end of file