Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 895 vs 902 for /trunk/Source Code/GUI/GUIInterface.cpp

Diff revisions: vs.
  @@ -109,29 +109,43 @@
109 109 return ret;
110 110 }
111 111
112 -
113 - void GUIInterface::mouseMoved(const GUIEvent& event) {
112 + // Return true if input was consumed
113 + bool GUIInterface::mouseMoved(const GUIEvent& event) {
114 114 for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
115 115 for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
116 - guiStackIterator.second.first->mouseMoved(event);
116 + if (guiStackIterator.second.first->mouseMoved(event)) {
117 + return true;
118 + }
117 119 }
118 120 }
121 +
122 + return false;
119 123 }
120 124
121 - void GUIInterface::onMouseUp(const GUIEvent& event) {
125 + // Return true if input was consumed
126 + bool GUIInterface::onMouseUp(const GUIEvent& event) {
122 127 for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
123 128 for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
124 - guiStackIterator.second.first->onMouseUp(event);
129 + if (guiStackIterator.second.first->onMouseUp(event)) {
130 + return true;
131 + }
125 132 }
126 133 }
134 +
135 + return false;
127 136 }
128 137
129 - void GUIInterface::onMouseDown(const GUIEvent& event) {
138 + // Return true if input was consumed
139 + bool GUIInterface::onMouseDown(const GUIEvent& event) {
130 140 for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
131 141 for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
132 - guiStackIterator.second.first->onMouseDown(event);
142 + if (guiStackIterator.second.first->onMouseDown(event)) {
143 + return true;
144 + }
133 145 }
134 146 }
147 +
148 + return false;
135 149 }
136 150
137 151