Changeset 8324 in orxonox.OLD for trunk/src/lib/gui/gl/glgui_handler.cc
- Timestamp:
- Jun 12, 2006, 12:40:57 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl/glgui_handler.cc
r8312 r8324 42 42 EventHandler::getInstance()->withUNICODE(ES_ALL, true ); 43 43 44 this-> cursor = NULL;44 this->_cursor = NULL; 45 45 for (unsigned int i = 0; i < EV_NUMBER; i++) 46 46 { … … 64 64 void GLGuiHandler::activateCursor() 65 65 { 66 if (this-> cursor == NULL)67 this-> cursor = new GLGuiCursor();68 this-> cursor->show();69 this-> cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));66 if (this->_cursor == NULL) 67 this->_cursor = new GLGuiCursor(); 68 this->_cursor->show(); 69 this->_cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY())); 70 70 } 71 71 72 72 void GLGuiHandler::deactivateCursor(bool deleteCursor) 73 73 { 74 if (this-> cursor)74 if (this->_cursor) 75 75 { 76 76 if (deleteCursor) 77 delete this-> cursor;78 this-> cursor = NULL;77 delete this->_cursor; 78 this->_cursor = NULL; 79 79 } 80 80 } … … 108 108 if (GLGuiWidget::focused()->clickable()) 109 109 { 110 Vector2D cursorPos = (this-> cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(event.x, event.y);110 Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y); 111 111 GLGuiWidget::focused()->click(cursorPos - GLGuiWidget::focused()->getAbsCoor2D()); 112 112 } … … 116 116 if (GLGuiWidget::focused()->clickable()) 117 117 { 118 Vector2D cursorPos = (this-> cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(event.x, event.y);118 Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y); 119 119 GLGuiWidget::focused()->release(cursorPos - GLGuiWidget::focused()->getAbsCoor2D()); 120 120 } … … 128 128 129 129 case EV_VIDEO_RESIZE: 130 if (this-> cursor != NULL)131 this-> cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h));130 if (this->_cursor != NULL) 131 this->_cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h)); 132 132 break; 133 133 } … … 147 147 Vector2D GLGuiHandler::cursorPositionOverFocusedWidget() const 148 148 { 149 return (this-> cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(0,0);149 return (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(0,0); 150 150 } 151 151 152 152 const Vector2D& GLGuiHandler::cursorPositionAbs() const 153 153 { 154 if (this-> cursor)155 return this-> cursor->getAbsCoor2D();154 if (this->_cursor) 155 return this->_cursor->getAbsCoor2D(); 156 156 else 157 157 return Vector2D::nullVector(); … … 160 160 { 161 161 assert (widget != NULL); 162 if (this-> cursor)163 return this-> cursor->getAbsCoor2D() - widget->getAbsCoor2D();162 if (this->_cursor) 163 return this->_cursor->getAbsCoor2D() - widget->getAbsCoor2D(); 164 164 else 165 165 return Vector2D::nullVector(); … … 179 179 const std::list<BaseObject*>* objects = ClassList::getList(CL_GLGUI_WIDGET); 180 180 181 if (objects != NULL && this-> cursor != NULL)181 if (objects != NULL && this->_cursor != NULL) 182 182 { 183 183 for (std::list<BaseObject*>::const_iterator it = objects->begin(); it != objects->end(); it++) … … 187 187 if (widget->isVisible() && 188 188 widget->focusable() && 189 widget->focusOverWidget(this-> cursor))189 widget->focusOverWidget(this->_cursor)) 190 190 { 191 191 // receiving Focus
Note: See TracChangeset
for help on using the changeset viewer.