comparison engine/core/gui/guimanager.cpp @ 2:e84dccee1bb7

* add myself to authors * fix missing break in guimanager * when an event occurs over an guichan window the event is marked as consumedByGuichan, but the event is still distributed to all event listeners, those can check via event.isConsumedByGuichan...
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 01 Jul 2008 17:43:35 +0000
parents 4a0efb7baf70
children 6387bbc0c2d5
comparison
equal deleted inserted replaced
1:2082bf27a3b8 2:e84dccee1bb7
199 } 199 }
200 200
201 void GUIManager::evaluateKeyEventConsumption(KeyEvent& evt) { 201 void GUIManager::evaluateKeyEventConsumption(KeyEvent& evt) {
202 gcn::Widget* w = m_focushandler->getFocused(); 202 gcn::Widget* w = m_focushandler->getFocused();
203 if (w) { 203 if (w) {
204 evt.consume(); 204 evt.consumedByGuichan();
205 } 205 }
206 } 206 }
207 207
208 void GUIManager::evaluateMouseEventConsumption(MouseEvent& evt) { 208 void GUIManager::evaluateMouseEventConsumption(MouseEvent& evt) {
209 gcn::Widget* w = m_gcn_topcontainer->getWidgetAt(evt.getX(), evt.getY()); 209 gcn::Widget* w = m_gcn_topcontainer->getWidgetAt(evt.getX(), evt.getY());
210 if (w && w->isVisible()) { 210 if (w && w->isVisible()) {
211 // evt.consume(); 211 evt.consumedByGuichan();
212 } 212 }
213 } 213 }
214 214
215 void GUIManager::mousePressed(MouseEvent& evt) { 215 void GUIManager::mousePressed(MouseEvent& evt) {
216 evaluateMouseEventConsumption(evt); 216 evaluateMouseEventConsumption(evt);
217 if (!evt.isConsumed()) { 217 if (!evt.isConsumedByGuichan()) {
218 m_focushandler->focusNone(); 218 m_focushandler->focusNone();
219 } 219 }
220 } 220 }
221 221
222 void GUIManager::mouseDragged(MouseEvent& evt) { 222 void GUIManager::mouseDragged(MouseEvent& evt) {