Lab4
Dependencies: SeeedStudioTFTv2 TFT_fonts mbed
Fork of Seeed_TFT_Touch_Shield by
Diff: ActionListener.cpp
- Revision:
- 6:ebffa73d4f95
- Parent:
- 4:ebcf8d366b91
diff -r b33fc1aa8d33 -r ebffa73d4f95 ActionListener.cpp --- a/ActionListener.cpp Fri Sep 26 12:42:10 2014 +0000 +++ b/ActionListener.cpp Fri Sep 26 15:33:34 2014 +0000 @@ -5,21 +5,18 @@ is_reg = false ; }; -void ActionListener::registerForEvents(ActionListener* widg) +void ActionListener::registerForEvents(ActionListener* tagt) { - target = widg ; + target = tagt ; is_reg = true ; - children.push_back(widg); +// if(tagt != NULL) +// children.push_back(tagt); }; void ActionListener::action(ActionType type, ActionEvent evnt) { + //trigger action for target 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); - } + trigger_action(type, evnt, (void*) target); } - }; \ No newline at end of file