Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7881 in orxonox.OLD


Ignore:
Timestamp:
May 26, 2006, 11:46:07 PM (18 years ago)
Author:
bensch
Message:

trunk: better focus

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

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl_gui/glgui_button.h

    r7873 r7881  
    3636    virtual ~GLGuiButton();
    3737
     38    const std::string& getLabel() const { return this->label.getText(); };
    3839    void setLabel(const std::string& label);
    3940
  • branches/gui/src/lib/gui/gl_gui/glgui_handler.cc

    r7880 r7881  
    107107      {
    108108        GLGuiWidget* widget = dynamic_cast<GLGuiWidget*>(*it);
    109         if (widget->focusOverWidget(this->cursor->getAbsCoor2D().x, this->cursor->getAbsCoor2D().y))
     109        if (widget->isVisible() && widget->focusOverWidget(this->cursor->getAbsCoor2D().x, this->cursor->getAbsCoor2D().y))
    110110        {
    111111          // receiving Focus
    112112          if (GLGuiWidget::focused() != widget)
    113113          {
    114             printf("yeah\n");
    115114            widget->giveFocus();
     115            printf("%s\n", widget->getClassName());
    116116          }
    117117        }
  • branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc

    r7873 r7881  
    5050  }
    5151
     52  void GLGuiPushButton::receivedFocus()
     53  {
     54    printf("%s received focus\n", this->getLabel().c_str());
     55
     56  }
     57  void GLGuiPushButton::removedFocus()
     58  {
     59    printf("%s removed focus\n", this->getLabel().c_str());
     60
     61  }
     62
     63
     64
     65
    5266  /**
    5367   * draws the GLGuiPushButton
  • branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.h

    r7873 r7881  
    2727
    2828
     29    virtual void receivedFocus();
     30    virtual void removedFocus();
    2931    virtual void draw() const;
    3032    virtual void update();
Note: See TracChangeset for help on using the changeset viewer.