Lab4
Dependencies: SeeedStudioTFTv2 TFT_fonts mbed
Fork of Seeed_TFT_Touch_Shield by
Diff: ActionListener.cpp
- Revision:
- 4:ebcf8d366b91
- Child:
- 6:ebffa73d4f95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ActionListener.cpp Fri Sep 26 12:40:19 2014 +0000 @@ -0,0 +1,25 @@ +#include "ActionListener.h" + +ActionListener::ActionListener() +{ + is_reg = false ; +}; + +void ActionListener::registerForEvents(ActionListener* widg) +{ + target = widg ; + is_reg = true ; + children.push_back(widg); +}; + +void ActionListener::action(ActionType type, ActionEvent evnt) +{ + if(is_reg) { +// target->trigger_action(type, evnt); + for(vector<ActionListener*>::iterator it = children.begin(); it != children.end(); it++) { + ActionListener* w = *it; + w->trigger_action(type, evnt); + } + } + +}; \ No newline at end of file