Esempio n. 1
0
 bool Component::HandleKeyEvent(const KeyEvent & e)
 {
   /*
    * Use this as a basic template for how to handle mouse events.
    * Here, we simply pass key events on to child components to see
    * if they can handle the event. As soon as one component handles
    * the event, the method returns.
    */
   for (vector<Component*>::iterator iter=this->children.begin(); iter != this->children.end(); iter++) {
     Component* c = (*iter);
     if (c->HandleKeyEvent(e)) {
       return true;
     }
   }
   return false;
 }