Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8653 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 21, 2006, 1:26:27 AM (18 years ago)
Author:
bensch
Message:

select works (more or less)

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  
    111111            {
    112112              Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
     113              GLGuiWidget::mouseFocused()->select();
    113114              GLGuiWidget::mouseFocused()->click(cursorPos - GLGuiWidget::mouseFocused()->getAbsCoor2D());
    114115            }
     
    137138
    138139
    139     if (GLGuiWidget::mouseFocused())
    140     {
    141       GLGuiWidget::mouseFocused()->processEvent(event);
     140    if (GLGuiWidget::selected())
     141    {
     142      GLGuiWidget::selected()->processEvent(event);
    142143    }
    143144
  • branches/gui/src/lib/gui/gl/glgui_inputline.cc

    r8619 r8653  
    4747
    4848    this->setFocusable(true);
     49    this->setClickable(true);
    4950
    5051    this->_clearOnEnter = false;
  • branches/gui/src/lib/gui/gl/glgui_widget.cc

    r8652 r8653  
    7474    if (this == GLGuiWidget::_mouseFocused)
    7575      GLGuiWidget::_mouseFocused = NULL;
     76    if (this == GLGuiWidget::selected())
     77      this->unselect();
    7678  }
    7779
     
    162164  {
    163165    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;
    164180  }
    165181
  • branches/gui/src/lib/gui/gl/glgui_widget.h

    r8652 r8653  
    5757    static GLGuiWidget* mouseFocused() { return GLGuiWidget::_mouseFocused; };
    5858
     59    /// SELECT
     60    static GLGuiWidget* selected() { return GLGuiWidget::_selected; };
     61    void select();
     62    void unselect();
    5963
    6064    /// CLICK
Note: See TracChangeset for help on using the changeset viewer.