Changeset 8653 in orxonox.OLD for branches/gui/src
- Timestamp:
- Jun 21, 2006, 1:26:27 AM (18 years ago)
- Location:
- branches/gui/src/lib/gui/gl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_handler.cc
r8652 r8653 111 111 { 112 112 Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y); 113 GLGuiWidget::mouseFocused()->select(); 113 114 GLGuiWidget::mouseFocused()->click(cursorPos - GLGuiWidget::mouseFocused()->getAbsCoor2D()); 114 115 } … … 137 138 138 139 139 if (GLGuiWidget:: mouseFocused())140 { 141 GLGuiWidget:: mouseFocused()->processEvent(event);140 if (GLGuiWidget::selected()) 141 { 142 GLGuiWidget::selected()->processEvent(event); 142 143 } 143 144 -
branches/gui/src/lib/gui/gl/glgui_inputline.cc
r8619 r8653 47 47 48 48 this->setFocusable(true); 49 this->setClickable(true); 49 50 50 51 this->_clearOnEnter = false; -
branches/gui/src/lib/gui/gl/glgui_widget.cc
r8652 r8653 74 74 if (this == GLGuiWidget::_mouseFocused) 75 75 GLGuiWidget::_mouseFocused = NULL; 76 if (this == GLGuiWidget::selected()) 77 this->unselect(); 76 78 } 77 79 … … 162 164 { 163 165 return this->focusOverWidget(cursor->getAbsCoor2D()); 166 } 167 168 169 void GLGuiWidget::select() 170 { 171 if (GLGuiWidget::selected() != NULL) 172 GLGuiWidget::selected()->unselect(); 173 GLGuiWidget::_selected = this; 174 } 175 176 void GLGuiWidget::unselect() 177 { 178 if (GLGuiWidget::selected() != this) 179 _selected = NULL; 164 180 } 165 181 -
branches/gui/src/lib/gui/gl/glgui_widget.h
r8652 r8653 57 57 static GLGuiWidget* mouseFocused() { return GLGuiWidget::_mouseFocused; }; 58 58 59 /// SELECT 60 static GLGuiWidget* selected() { return GLGuiWidget::_selected; }; 61 void select(); 62 void unselect(); 59 63 60 64 /// CLICK
Note: See TracChangeset
for help on using the changeset viewer.