Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SeeedStudioTFTv2 TFT_fonts mbed
Fork of Seeed_TFT_Touch_Shield by
Diff: ActionListener.h
- Revision:
- 4:ebcf8d366b91
- Child:
- 6:ebffa73d4f95
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ActionListener.h	Fri Sep 26 12:40:19 2014 +0000
@@ -0,0 +1,33 @@
+#pragma once
+#include <vector>
+#include "mbed.h"
+
+typedef enum { CORD, STR, CORD_STR } ActionType;
+
+class ActionEvent{
+public:
+    //pixel x that event took place
+    int x;  
+    //pixel y that event took place
+    int y;   
+    
+    char* string;
+};
+
+class ActionListener{
+public:
+    ActionListener();
+    
+    void registerForEvents(ActionListener* widg);
+    
+    void action(ActionType type, ActionEvent evnt);
+
+protected:
+    virtual void trigger_action( ActionType type, ActionEvent evnt)=0;
+    
+private:
+    bool is_reg;
+    ActionListener* target;
+    vector<ActionListener*> children;    
+       
+};
\ No newline at end of file
    