Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7924 in orxonox.OLD for branches/gui


Ignore:
Timestamp:
May 28, 2006, 5:04:08 PM (19 years ago)
Author:
bensch
Message:

gui: introducing rect into gui

Location:
branches/gui/src
Files:
7 edited

Legend:

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

    r7919 r7924  
    77#define _GLGUI_H
    88
     9#include "glgui_defs.h"
    910#include "glgui_handler.h"
    1011
  • branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc

    r7919 r7924  
    8888
    8989
    90       this->setAbsCoorSoft2D(newPos, 10);
     90      this->setAbsCoor2D(newPos);
    9191      movement = Vector2D();
    9292    }
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.h

    r7919 r7924  
    2626    virtual ~GLGuiSlider();
    2727
    28     void init();
     28    /** @returns the Value of the Slider. */
     29    float value() const { return this->_value; }
     30    /** @returns the minimum of the sliders range */
     31    float min() const { return this->_minValue; };
     32    /** @returns the maximum of the sliders range */
     33    float max() const { return this->_maxValue; };
     34    /** @returns the step size */
     35    float step() const { return this->_step; };
     36
     37    void setValue(float value);
     38
     39    void setMin(float minimum);
     40    void setMax(float maximum);
     41    void setRange(float minimum, float maximum);
     42
     43    void setStep(float step);
     44
    2945
    3046    virtual void draw() const;
    3147
    3248  private:
     49    void init();
     50    private:
     51
    3352    Orientation      orientation;
    3453
    3554    float            _maxValue;
    3655    float            _minValue;
     56    float            _step;
    3757
    3858    float            _value;
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.cc

    r7919 r7924  
    2828
    2929  /**
    30    * standard constructor
     30   * @brief standard constructor
    3131  */
    32   GLGuiWidget::GLGuiWidget ( )
     32  GLGuiWidget::GLGuiWidget (GLGuiWidget* parent)
    3333  {
    3434    this->init();
    35   }
    36 
    37 
    38   /**
    39    * standard deconstructor
     35
     36    if (parent != NULL)
     37      parent->addChild2D(this);
     38  }
     39
     40
     41  /**
     42   * @brief standard deconstructor
    4043   */
    4144  GLGuiWidget::~GLGuiWidget()
     
    6366    this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
    6467
    65     this->backMat.setDiffuse(1.0, 1.0, 1.0);
    66     this->frontMat.setDiffuse(1.0, 0.0, 0.0);
     68    this->_backMat.setDiffuse(1.0, 1.0, 1.0);
     69    this->_frontMat.setDiffuse(1.0, 0.0, 0.0);
    6770
    6871    this->widgetSignals.resize(SignalCount, SignalConnector());
     
    130133  void GLGuiWidget::released()
    131134  {
    132     this->frontMat.setDiffuse(0,1,0);
     135    this->frontMaterial().setDiffuse(0,1,0);
    133136
    134137  }
     
    194197  void GLGuiWidget::draw() const
    195198  {
    196     this->backMat.select();
     199    this->backMaterial().select();
    197200
    198201    glBegin(GL_QUADS);
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.h

    r7919 r7924  
    5353
    5454  public:
    55     GLGuiWidget();
     55    GLGuiWidget(GLGuiWidget* parent = NULL);
    5656    virtual ~GLGuiWidget();
    5757
     
    9292
    9393    /// MATERIAL (looks)
    94     Material& backMaterial() { return this->backMat; };
    95     const Material& backMaterial() const { return this->backMat; };
     94    Material& backMaterial() { return this->_backMat; };
     95    const Material& backMaterial() const { return this->_backMat; };
     96    Rect2D& backRect() { return this->_backRect; };
     97    const Rect2D& backRect() const { return this->_backRect; };
    9698
    97     Material& frontMaterial() { return this->frontMat; };
    98     const Material& frontMaterial() const { return this->frontMat; };
     99    Material& frontMaterial() { return this->_frontMat; };
     100    const Material& frontMaterial() const { return this->_frontMat; };
     101    Rect2D& frontRect() { return this->_frontRect; };
     102    const Rect2D& frontRect() const { return this->_frontRect; };
     103
     104    inline void drawRect(const Rect2D& rect) {
     105      glBegin(GL_QUADS);
     106      glTexCoord2i(0,0); glVertex2d(rect.left(), rect.top());
     107      glTexCoord2i(0,1); glVertex2d(rect.left(), rect.bottom());
     108      glTexCoord2i(1,1); glVertex2d(rect.right(), rect.bottom());
     109      glTexCoord2i(1,0); glVertex2d(rect.right(), rect.top());
     110      glEnd();
     111    }
    99112
    100113    /** @param the Event to process. @returns true if the Event has been consumed*/
     
    123136  private:
    124137    /// LOOKS
    125     Material                       backMat;
    126     Rect2D                         backRect;
     138    Material                       _backMat;
     139    Rect2D                         _backRect;
    127140
    128     Material                       frontMat;
    129     Rect2D                         frontRect;
     141    Material                       _frontMat;
     142    Rect2D                         _frontRect;
    130143
    131144
  • branches/gui/src/story_entities/simple_game_menu.cc

    r7919 r7924  
    6666  /// GUI
    6767  ///(this is as modular as it is possible).
     68  /*
    6869  OrxGui::GLGuiPushButton* pb = new OrxGui::GLGuiPushButton("PUSH ME");
    6970  pb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::enterGui));
     
    7374  OrxGui::GLGuiHandler::getInstance()->activateCursor();
    7475  OrxGui::GLGuiHandler::getInstance()->activate();
     76  */
    7577  /////
    7678
  • branches/gui/src/story_entities/simple_game_menu.h

    r7919 r7924  
    3131
    3232  public:
    33     std::vector<TextElement*>          menuList;                        //!< the list of the menu items
     33    std::vector<TextElement*>         menuList;                        //!< the list of the menu items
    3434    std::vector<StoryEntity*>         storyList;                       //!< the list of the StoryEntities for the menu
    3535    std::vector<ImageEntity*>         screenshootList;                 //!< list of the screen shoots FIXME: make a better structure for this stuff
Note: See TracChangeset for help on using the changeset viewer.