Changeset 8652 in orxonox.OLD
- Timestamp:
- Jun 21, 2006, 1:15:24 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
r8450 r8652 104 104 { 105 105 case EV_MOUSE_BUTTON_LEFT: 106 if (GLGuiWidget:: focused() != NULL)106 if (GLGuiWidget::mouseFocused() != NULL) 107 107 { 108 108 if (event.bPressed) 109 109 { 110 if (GLGuiWidget:: focused()->clickable())110 if (GLGuiWidget::mouseFocused()->clickable()) 111 111 { 112 112 Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y); 113 GLGuiWidget:: focused()->click(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());113 GLGuiWidget::mouseFocused()->click(cursorPos - GLGuiWidget::mouseFocused()->getAbsCoor2D()); 114 114 } 115 115 } 116 116 else 117 117 { 118 if (GLGuiWidget:: focused()->clickable())118 if (GLGuiWidget::mouseFocused()->clickable()) 119 119 { 120 120 Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y); 121 GLGuiWidget:: focused()->release(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());121 GLGuiWidget::mouseFocused()->release(cursorPos - GLGuiWidget::mouseFocused()->getAbsCoor2D()); 122 122 } 123 123 } … … 125 125 break; 126 126 case EV_LEAVE_STATE: 127 if (GLGuiWidget:: focused() != NULL)128 GLGuiWidget:: focused()->breakFocus();127 if (GLGuiWidget::mouseFocused() != NULL) 128 GLGuiWidget::mouseFocused()->breakMouseFocus(); 129 129 break; 130 130 … … 137 137 138 138 139 if (GLGuiWidget:: focused())140 { 141 GLGuiWidget:: focused()->processEvent(event);139 if (GLGuiWidget::mouseFocused()) 140 { 141 GLGuiWidget::mouseFocused()->processEvent(event); 142 142 } 143 143 … … 192 192 { 193 193 // receiving Focus 194 if (GLGuiWidget:: focused() != widget)194 if (GLGuiWidget::mouseFocused() != widget) 195 195 { 196 widget->give Focus();196 widget->giveMouseFocus(); 197 197 } 198 198 return ; 199 199 } 200 200 } 201 if (GLGuiWidget:: focused() != NULL)202 GLGuiWidget:: focused()->breakFocus();201 if (GLGuiWidget::mouseFocused() != NULL) 202 GLGuiWidget::mouseFocused()->breakMouseFocus(); 203 203 } 204 204 } -
branches/gui/src/lib/gui/gl/glgui_table.cc
r8651 r8652 264 264 265 265 glEnd(); 266 267 266 268 267 269 this->endDraw(); -
branches/gui/src/lib/gui/gl/glgui_widget.cc
r8631 r8652 72 72 GLGuiWidget::~GLGuiWidget() 73 73 { 74 if (this == GLGuiWidget::_ focused)75 GLGuiWidget::_ focused = NULL;74 if (this == GLGuiWidget::_mouseFocused) 75 GLGuiWidget::_mouseFocused = NULL; 76 76 } 77 77 78 78 GLGuiWidget* GLGuiWidget::_selected = NULL; 79 GLGuiWidget* GLGuiWidget::_ focused = NULL;79 GLGuiWidget* GLGuiWidget::_mouseFocused = NULL; 80 80 GLGuiWidget* GLGuiWidget::_inputGrabber = NULL; 81 81 … … 134 134 135 135 /** @brief gives focus to this widget */ 136 void GLGuiWidget::give Focus()137 { 138 if (GLGuiWidget:: focused() != NULL)139 GLGuiWidget:: focused()->breakFocus();140 GLGuiWidget::_ focused = this;136 void GLGuiWidget::giveMouseFocus() 137 { 138 if (GLGuiWidget::mouseFocused() != NULL) 139 GLGuiWidget::mouseFocused()->breakMouseFocus(); 140 GLGuiWidget::_mouseFocused = this; 141 141 this->receivedFocus(); 142 142 }; 143 143 144 void GLGuiWidget::break Focus()145 { 146 if (GLGuiWidget::_ focused == this)144 void GLGuiWidget::breakMouseFocus() 145 { 146 if (GLGuiWidget::_mouseFocused == this) 147 147 { 148 GLGuiWidget::_ focused = NULL;148 GLGuiWidget::_mouseFocused = NULL; 149 149 this->_pushed = false; 150 150 this->removedFocus(); -
branches/gui/src/lib/gui/gl/glgui_widget.h
r8647 r8652 43 43 /// FOCUS 44 44 /** @brief gives focus to this widget */ 45 void give Focus();46 void break Focus();45 void giveMouseFocus(); 46 void breakMouseFocus(); 47 47 /** @returns true if the widget is focusable */ 48 48 bool focusable() const { return this->_focusable; }; … … 55 55 56 56 /** @returns the currently focused Widget (NULL if none is selected) */ 57 static GLGuiWidget* focused() { return GLGuiWidget::_focused; };57 static GLGuiWidget* mouseFocused() { return GLGuiWidget::_mouseFocused; }; 58 58 59 59 … … 251 251 private: 252 252 static GLGuiWidget* _selected; //!< The currently selected Widget. 253 static GLGuiWidget* _ focused;//!< The currently Focused Widget (mouse-focus).253 static GLGuiWidget* _mouseFocused; //!< The currently Focused Widget (mouse-focus). 254 254 static GLGuiWidget* _inputGrabber; //!< The Widget that grabs input (keyboard-focus). 255 255
Note: See TracChangeset
for help on using the changeset viewer.