Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8448 in orxonox.OLD for trunk/src/lib/gui/gl/glgui_style.h


Ignore:
Timestamp:
Jun 15, 2006, 12:48:26 PM (18 years ago)
Author:
bensch
Message:

merged gui back to the trunk
merged with command
merge -r8377:HEAD https://svn.orxonox.net/orxonox/branches/gui .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl/glgui_style.h

    r8276 r8448  
    77#define _GLGUI_STYLE_H
    88
    9 // FORWARD DECLARATION
     9#include "glgui_defs.h"
    1010
    1111#include "font.h"
    1212#include "texture.h"
    1313#include "color.h"
     14
     15class TiXmlElement;
    1416
    1517namespace OrxGui
     
    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;
     26
     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; }
    2941
    3042
    3143
    32   public:
    33     GLGuiStyle();
    34     virtual ~GLGuiStyle();
     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);
    3588
    3689  private:
    37     float             _borderLeft;           //!< The Distance to the left Border of the widget, before any internal Element starts.
    38     float             _borderRight;          //!< The Distance to the right Border of the widget, before any internal Element starts.
    39     float             _borderTop;            //!< The Distance to the top Border of the widget, before any internal Element starts
    40     float             _borderBottom;         //!< The Distance to the bottom Border of the widget, before any internal Element starts
     90    typedef struct
     91    {
     92      float             _borderLeft;           //!< The Distance to the left Border of the widget, before any internal Element starts.
     93      float             _borderRight;          //!< The Distance to the right Border of the widget, before any internal Element starts.
     94      float             _borderTop;            //!< The Distance to the top Border of the widget, before any internal Element starts
     95      float             _borderBottom;         //!< The Distance to the bottom Border of the widget, before any internal Element starts
    4196
    42     Font*             _font;                 //!< The Font used in the current Widget.
    43     float             _textSize;             //!< The TextSize of the Widget.
    44     float             _textColor;            //!< The TextColor of the Widget.
     97      float             _textSize;             //!< The TextSize of the Widget.
    4598
    46     float             _backgroundColor;      //!< The BackgroundColor of the Widget.
    47     Texture           _backgorundTexture;    //!< The BackgroundTexture of the Widget.
     99      Color             _backgroundColor;      //!< The BackgroundColor of the Widget.
     100      Texture           _backgroundTexture;    //!< The BackgroundTexture of the Widget.
    48101
    49     float             _foregroundColor;      //!< The foregroundColor of the Widget.
    50     Texture           _foregorundTexture;    //!< The ForegroundTexture of the Widget
     102      Color             _foregroundColor;      //!< The foregroundColor of the Widget.
     103    }
     104    StatedStyle;
    51105
    52     FeaturePosition   _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
    53106
    54     bool              _animated;             //!< If the Widget is animated (Texture might be an AnimatedTexture.)
    55     bool              _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
     107    StatedStyle         _style[GLGUI_STATE_COUNT];
     108
     109    FeaturePosition     _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
     110    Font*               _font;                 //!< The Font used in the current Widget.
     111
     112
     113    bool                _animated;             //!< If the Widget is animated (Texture might be an AnimatedTexture.)
     114    bool                _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
    56115  };
    57116}
Note: See TracChangeset for help on using the changeset viewer.