Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8446 in orxonox.OLD


Ignore:
Timestamp:
Jun 15, 2006, 11:35:45 AM (18 years ago)
Author:
bensch
Message:

gui: senslessly producing code

Location:
branches/gui/src/lib/gui/gl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_defs.h

    r8442 r8446  
    2222  } Orientation;
    2323
    24   const std::string OrientationString[2] = {
     24  const std::string OrientationString[] = {
    2525    "Horizontal",
    2626    "Vertical"
     
    3636  //! The count of States a GUI-Element can be in.
    3737#define GLGUI_STATE_COUNT   4
     38#define GLGUI_DEFAULT_STYLE OrxGui::Normal
    3839
    3940  const std::string StateString[] =
     
    4546    };
    4647
     48    //! Where a Certain feature will be positioned at.
     49    typedef enum {
     50      FeatureLeft,          //!< On the Left side.
     51      FeatureRight,         //!< On the Right side.
     52      FeatureTop,           //!< On Top of the rest of the Widget.
     53      FeatureBottom,        //!< At the Bottom of the rest of the Widget.
     54    } FeaturePosition;
     55
     56    const std::string FeaturePositionString[] =
     57    {
     58      "Left",
     59      "Right",
     60      "Top",
     61      "Bottom"
     62    };
    4763
    4864
  • branches/gui/src/lib/gui/gl/glgui_style.cc

    r8145 r8446  
    1818#include "glgui_style.h"
    1919
     20#include "loading/load_param.h"
     21
    2022namespace OrxGui
    2123{
     
    2527   * @brief standard constructor
    2628  */
    27   GLGuiStyle::GLGuiStyle ()
     29  GLGuiStyle::GLGuiStyle (const TiXmlElement* root)
    2830  {
     31    if (root != NULL)
     32      this->loadParams(root);
     33
     34    this->
    2935  }
    3036
     
    3743    // delete what has to be deleted here
    3844  }
     45
     46  void GLGuiStyle::loadParams(const TiXmlElement* root)
     47  {
     48  }
     49
     50  void GLGuiStyle::setBorderLeft(float value)
     51  {
     52    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     53      setBorderLeft(value, (OrxGui::State)i);
     54  }
     55
     56  void GLGuiStyle::setBorderLeft(float value, OrxGui::State state)
     57{}
     58
     59  void GLGuiStyle::setBorderLeftS(float value, const std::string& state)
     60  {}
     61
     62
     63  void GLGuiStyle::setBorderRight(float value)
     64  {
     65    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     66      setBorderRight(value, (OrxGui::State)i);
     67  }
     68
     69  void GLGuiStyle::setBorderRight(float value, OrxGui::State state)
     70{}
     71
     72  void GLGuiStyle::setBorderRightS(float value, const std::string& state)
     73  {}
     74
     75
     76  void GLGuiStyle::setBorderTop(float value)
     77  {
     78    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     79      setBorderTop(value, (OrxGui::State)i);
     80  }
     81
     82  void GLGuiStyle::setBorderTop(float value, OrxGui::State state)
     83{}
     84
     85  void GLGuiStyle::setBorderTopS(float value, const std::string& state)
     86  {}
     87
     88
     89  void GLGuiStyle::setBorderBottom(float value)
     90  {
     91    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     92      setBorderBottom(value, (OrxGui::State)i);
     93  }
     94
     95  void GLGuiStyle::setBorderBottom(float value, OrxGui::State state)
     96{}
     97
     98  void GLGuiStyle::setBorderBottomS(float value, const std::string& state)
     99  {}
     100
     101
     102  void GLGuiStyle::setTextSize(float value)
     103  {
     104    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     105      setTextSize(value, (OrxGui::State)i);
     106  }
     107
     108  void GLGuiStyle::setTextSize(float value, OrxGui::State state)
     109{}
     110
     111  void GLGuiStyle::setTextSizeS(float value, const std::string& state)
     112  {}
     113
     114
     115  void GLGuiStyle::setBackgroundColor(const Color& color)
     116  {
     117    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     118      setBackgroundColor(color, (OrxGui::State)i);
     119  }
     120
     121  void GLGuiStyle::setBackgroundColor(const Color& color, OrxGui::State state)
     122{}
     123
     124  void GLGuiStyle::setBackgroundColorS(float r, float g, float b, float a, const std::string& state)
     125  {}
     126
     127
     128  void GLGuiStyle::setBackgroundTexture(const Texture& texture)
     129  {
     130    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     131      setBackgroundTexture(texture, (OrxGui::State)i);
     132  }
     133
     134  void GLGuiStyle::setBackgroundTexture(const Texture& texture, OrxGui::State state)
     135{}
     136
     137  void GLGuiStyle::setBackgroundTexture(const std::string& textureName, const std::string& state)
     138  {}
     139
     140
     141  void GLGuiStyle::setForegroundColor(const Color& color)
     142  {
     143    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     144      setForegroundColor(color, (OrxGui::State)i);
     145  }
     146
     147  void GLGuiStyle::setForegroundColor(const Color& color, OrxGui::State state)
     148  {}
     149
     150  void GLGuiStyle::setForegroundColorS(float r, float g, float b, float a, const std::string& state)
     151  {}
     152
     153
     154
     155  void GLGuiStyle::setFeaturePosition(FeaturePosition featurePosition)
     156  {
     157    this->_featurePosition = featurePosition;
     158  }
     159
     160  void GLGuiStyle::setFeaturePosition(const std::string& featurePosition)
     161  {
     162
     163  }
     164
     165
     166  void GLGuiStyle::setFont(Font* font)
     167  {
     168    this->_font = font;
     169  }
     170
     171  void GLGuiStyle::setFont(const std::string& fontName)
     172  {
     173    //this->font = new Font(fontName);
     174  }
     175
     176
     177  void GLGuiStyle::setAnimated(bool animated)
     178  {
     179    this->_animated = animated;
     180  }
     181
     182  void GLGuiStyle::animatedStateChanges(bool animated)
     183  {
     184    this->_animatedStateChanges = animated;
     185  }
     186
    39187}
  • branches/gui/src/lib/gui/gl/glgui_style.h

    r8441 r8446  
    1313#include "color.h"
    1414
     15class TiXmlElement;
     16
    1517namespace OrxGui
    1618{
     
    1921  {
    2022  public:
     23    GLGuiStyle(const TiXmlElement* root = NULL);
     24    virtual ~GLGuiStyle();
    2125
    22     //! Where a Certain feature will be positioned at.
    23     typedef enum {
    24       FeatureLeft,          //!< On the Left side.
    25       FeatureRight,         //!< On the Right side.
    26       FeatureTop,           //!< On Top of the rest of the Widget.
    27       FeatureBottom,        //!< At the Bottom of the rest of the Widget.
    28     } FeaturePosition;
    2926
    30   public:
    31     GLGuiStyle();
    32     virtual ~GLGuiStyle();
     27    /// Retrieve
     28    inline float borderLeft(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderLeft; }
     29    inline float borderRight(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderRight; }
     30    inline float borderTop(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderTop; }
     31    inline float borderBottom(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderBottom; }
     32    inline float textSize(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._textSize; }
     33    inline const Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundColor; }
     34    inline const Texture& backgrorundTexture(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundTexture; }
     35    inline const Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._foregroundColor; }
     36
     37    inline FeaturePosition featurePosition() const { return _featurePosition; }
     38    inline const Font* const font() const { return _font; }
     39    inline bool animated() const { return _animated; }
     40    inline bool animatedStateChanges() const { return _animatedStateChanges; }
     41
     42
     43
     44    /// SETUP
     45    void loadParams(const TiXmlElement* root);
     46
     47    void setBorderLeft(float value);
     48    void setBorderLeft(float value, OrxGui::State state);
     49    void setBorderLeftS(float value, const std::string& state);
     50
     51    void setBorderRight(float value);
     52    void setBorderRight(float value, OrxGui::State state);
     53    void setBorderRightS(float value, const std::string& state);
     54
     55    void setBorderTop(float value);
     56    void setBorderTop(float value, OrxGui::State state);
     57    void setBorderTopS(float value, const std::string& state);
     58
     59    void setBorderBottom(float value);
     60    void setBorderBottom(float value, OrxGui::State state);
     61    void setBorderBottomS(float value, const std::string& state);
     62
     63    void setTextSize(float value);
     64    void setTextSize(float value, OrxGui::State state);
     65    void setTextSizeS(float value, const std::string& state);
     66
     67    void setBackgroundColor(const Color& color);
     68    void setBackgroundColor(const Color& color, OrxGui::State state);
     69    void setBackgroundColorS(float r, float g, float b, float a, const std::string& state);
     70
     71    void setBackgroundTexture(const Texture& texture);
     72    void setBackgroundTexture(const Texture& texture, OrxGui::State state);
     73    void setBackgroundTexture(const std::string& textureName, const std::string& state);
     74
     75    void setForegroundColor(const Color& color);
     76    void setForegroundColor(const Color& color, OrxGui::State state);
     77    void setForegroundColorS(float r, float g, float b, float a, const std::string& state);
     78
     79
     80    void setFeaturePosition(FeaturePosition featurePosition);
     81    void setFeaturePosition(const std::string& featurePosition);
     82
     83    void setFont(Font* font);
     84    void setFont(const std::string& fontName);
     85
     86    void setAnimated(bool animated);
     87    void animatedStateChanges(bool animated);
    3388
    3489  private:
     
    4398
    4499      Color             _backgroundColor;      //!< The BackgroundColor of the Widget.
    45       Texture           _backgorundTexture;    //!< The BackgroundTexture of the Widget.
     100      Texture           _backgroundTexture;    //!< The BackgroundTexture of the Widget.
    46101
    47102      Color             _foregroundColor;      //!< The foregroundColor of the Widget.
     
    52107    StatedStyle         _style[GLGUI_STATE_COUNT];
    53108
    54     FeaturePosition   _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
     109    FeaturePosition     _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
    55110    Font*               _font;                 //!< The Font used in the current Widget.
    56111
    57112
    58     bool              _animated;             //!< If the Widget is animated (Texture might be an AnimatedTexture.)
    59     bool              _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
     113    bool                _animated;             //!< If the Widget is animated (Texture might be an AnimatedTexture.)
     114    bool                _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
    60115  };
    61116}
Note: See TracChangeset for help on using the changeset viewer.