Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7929 in orxonox.OLD for branches/gui/src


Ignore:
Timestamp:
May 28, 2006, 7:15:24 PM (19 years ago)
Author:
bensch
Message:

gui: click with positional information

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

Legend:

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

    r7928 r7929  
    6868
    6969
    70   void GLGuiCheckButton::released()
     70  void GLGuiCheckButton::released(const Vector2D& pos)
    7171  {
    7272    printf("%s released\n", this->getLabel().c_str());
    73     GLGuiWidget::released();
     73    GLGuiWidget::released(pos);
    7474    this->toggleActiveState();
    7575  }
  • branches/gui/src/lib/gui/gl_gui/glgui_checkbutton.h

    r7925 r7929  
    2626    virtual ~GLGuiCheckButton();
    2727
    28     virtual void released();
     28    virtual void released(const Vector2D& pos);
    2929
    3030    bool    isActive() { return this->bActive; };
  • branches/gui/src/lib/gui/gl_gui/glgui_handler.cc

    r7919 r7929  
    107107          {
    108108            if (GLGuiWidget::focused()->clickable())
    109               GLGuiWidget::focused()->click();
     109            {
     110              GLGuiWidget::focused()->click(Vector2D(event.x, event.y) - GLGuiWidget::focused()->getAbsCoor2D());
     111            }
    110112          }
    111113          else
    112114          {
    113115            if (GLGuiWidget::focused()->clickable())
    114               GLGuiWidget::focused()->release();
     116              GLGuiWidget::focused()->release(Vector2D(event.x, event.y) - GLGuiWidget::focused()->getAbsCoor2D());
    115117          }
    116118        }
  • branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc

    r7928 r7929  
    7474  }
    7575
    76   void GLGuiPushButton::clicked()
     76  void GLGuiPushButton::clicked(const Vector2D& pos)
    7777  {
    7878    printf("%s clicked\n", this->getLabel().c_str());
    79     GLGuiWidget::clicked();
     79    GLGuiWidget::clicked(pos);
    8080  }
    8181
    8282
    83   void GLGuiPushButton::released()
     83  void GLGuiPushButton::released(const Vector2D& pos)
    8484  {
    8585    printf("%s released\n", this->getLabel().c_str());
    86     GLGuiWidget::released();
     86    GLGuiWidget::released(pos);
    8787  }
    8888
  • branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.h

    r7925 r7929  
    2929    virtual void receivedFocus();
    3030    virtual void removedFocus();
    31     virtual void clicked();
    32     virtual void released();
     31    virtual void clicked(const Vector2D& pos);
     32    virtual void released(const Vector2D& pos);
    3333
    3434
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.cc

    r7928 r7929  
    4343  void GLGuiSlider::init()
    4444  {
     45
    4546    this->setClassID(CL_GLGUI_SLIDER, "GLGuiSlider");
     47
     48    this->setClickable( );
     49    this->setFocusable( );
     50
    4651    this->_value = 0.0;
    4752    this->_minValue = 0.0;
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.h

    r7928 r7929  
    1717  //! This is part of the openglGUI class
    1818  /**
    19    *
     19   * The Slider is a Widget, with a Range and a Value.
    2020   */
    2121  class GLGuiSlider : public GLGuiWidget
     
    4343    void setStep(float step);
    4444
     45    virtual void draw() const;
    4546
    46     virtual void draw() const;
    4747  protected:
    4848    void resize();
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.cc

    r7925 r7929  
    111111
    112112
    113   void GLGuiWidget::click()
     113  void GLGuiWidget::click(const Vector2D& pos)
    114114  {
    115115    assert (!this->_pushed);
     
    117117    this->_pushed = true;
    118118
    119     this->clicked();
    120   }
    121 
    122   void GLGuiWidget::release()
     119    this->clicked(pos);
     120  }
     121
     122  void GLGuiWidget::release(const Vector2D& pos)
    123123  {
    124124    if (this->_pushed)
     
    126126      this->widgetSignals[Signal_release]("none");
    127127
    128       this->released();
     128      this->released(pos);
    129129      this->_pushed = false;
    130130    }
     
    132132
    133133
    134   void GLGuiWidget::clicked()
     134  void GLGuiWidget::clicked(const Vector2D& pos)
    135135  {
    136136    this->frontMaterial().setDiffuse(0, 0, 1);
     
    138138  }
    139139
    140   void GLGuiWidget::released()
     140  void GLGuiWidget::released(const Vector2D& pos)
    141141  {
    142142    this->frontMaterial().setDiffuse(0,1,0);
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.h

    r7928 r7929  
    8383
    8484    /// CLICK
    85     void click();
    86     void release();
     85    void click(const Vector2D& pos);
     86    void release(const Vector2D& pos);
    8787    bool clickable() const { return this->_clickable; };
    8888    void setClickable(bool clickable = true) { this->_clickable = clickable; };
     
    127127
    128128    // if something was clickt on the GUI-widget.
    129     virtual void clicked();
    130     virtual void released();
     129    virtual void clicked(const Vector2D& pos);
     130    virtual void released(const Vector2D& pos);
    131131    virtual void receivedFocus();
    132132    virtual void removedFocus();
Note: See TracChangeset for help on using the changeset viewer.