Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7887 in orxonox.OLD for branches/gui/src/lib


Ignore:
Timestamp:
May 27, 2006, 2:52:26 AM (19 years ago)
Author:
bensch
Message:

gui: release only if pushed before

Location:
branches/gui/src/lib/gui/gl_gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.cc

    r7884 r7887  
    5757    this->_focusable = false;
    5858    this->_clickable = false;
     59    this->_pushed = false;
     60
    5961    this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
    6062
     
    6466    this->frontModel = 0;
    6567    this->backModel = 0;
     68
    6669
    6770    this->widgetSignals.resize(SignalCount, SignalConnector());
     
    7982  {
    8083    GLGuiWidget::_focused = NULL;
     84    this->_pushed = false;
    8185    this->removedFocus();
    8286  };
     
    96100  void GLGuiWidget::click()
    97101  {
     102    assert (!this->_pushed);
    98103    this->widgetSignals[Signal_click]("none");
     104    this->_pushed = true;
    99105
    100106    this->clicked();
     
    103109  void GLGuiWidget::release()
    104110  {
    105     this->widgetSignals[Signal_release]("none");
     111    if (this->_pushed)
     112    {
     113      this->widgetSignals[Signal_release]("none");
    106114
    107     this->released();
     115      this->released();
     116      this->_pushed = false;
     117    }
    108118  }
    109119
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.h

    r7884 r7887  
    128128    bool                           _clickable;        //!< if this widget can be clicked upon.
    129129
     130    bool                           _pushed;
     131
    130132    static GLGuiWidget*            _focused;
    131133    static GLGuiWidget*            _inputGrabber;
Note: See TracChangeset for help on using the changeset viewer.