Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8141 in orxonox.OLD


Ignore:
Timestamp:
Jun 4, 2006, 1:19:07 AM (18 years ago)
Author:
bensch
Message:

gui: added a class for the Styles of the GUI

Location:
branches/gui/src/lib
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/Makefile.am

    r8035 r8141  
    1111libORXglgui_a_SOURCES = \
    1212                glmenu/glmenu_imagescreen.cc \
     13                \
     14                glgui_style.cc \
    1315                glgui_handler.cc \
    1416                signal_connector.cc \
     
    3234noinst_HEADERS= \
    3335                glmenu/glmenu_imagescreen.h \
     36                \
     37                glgui_style.h \
    3438                signal_connector.h \
    3539                glgui.h \
  • branches/gui/src/lib/gui/gl/glgui_style.cc

    r8140 r8141  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "glgui_style.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    2223
    23 /**
    24  * standard constructor
    25  * @todo this constructor is not jet implemented - do it
    26 */
    27 ProtoClass::ProtoClass ()
    28 {
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
    30 
    31    /* If you make a new class, what is most probably the case when you write this file
    32       don't forget to:
    33        1. Add the new file new_class.cc to the ./src/Makefile.am
    34        2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS
    35 
    36       Advanced Topics:
    37       - if you want to let your object be managed via the ObjectManager make sure to read
    38         the object_manager.h header comments. You will use this most certanly only if you
    39         make many objects of your class, like a weapon bullet.
    40    */
    41 }
     24  /**
     25   * @brief standard constructor
     26  */
     27  GLGuiStyle::GLGuiStyle ()
     28  {
     29  }
    4230
    4331
    44 /**
    45  * standard deconstructor
    46 */
    47 ProtoClass::~ProtoClass ()
    48 {
    49   // delete what has to be deleted here
     32  /**
     33   * @brief standard deconstructor
     34   */
     35  GLGuiStyle::~GLGuiStyle ()
     36  {
     37    // delete what has to be deleted here
     38  }
    5039}
  • branches/gui/src/lib/gui/gl/glgui_style.h

    r8140 r8141  
    11/*!
    2  * @file proto_class.h
     2 * @file glgui_style.h
    33 * @brief Definition of ...
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
    8 
    9 #include "base_object.h"
     6#ifndef _GLGUI_STYLE_H
     7#define _GLGUI_STYLE_H
    108
    119// FORWARD DECLARATION
    1210
     11#include "font.h"
     12#include "texture.h"
     13#include "color.h"
     14
     15namespace OrxGui
     16{
     17
     18  //! A class for Defining Styles to the opengl-gui.
     19  class GLGuiStyle
     20  {
     21    //! An enumerator that defines the different states Widgets may be in.
     22    typedef enum {
     23      Normal,           //!< Normal state of the GUI's Widgets.
     24      Active,           //!< If the widget is Active.
     25      Selected,         //!< If the Widget is Selected.
     26      Insensitive       //!< If the Widget is insensitive.
     27    } State;
     28
     29  public:
     30    GLGuiStyle();
     31    virtual ~GLGuiStyle();
    1332
    1433
    15 //! A class for ...
    16 class ProtoClass : public BaseObject {
     34  private:
    1735
    18  public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
     36    float             _borderLeft;
     37    float             _borderRight;
     38    float             _borderTop;
     39    float             _borderBottom;
    2140
     41    Font*             _font;
     42    float             _textSize;
     43    float             _textColor;
    2244
    23  private:
     45    float             _backgroundColor;
     46    Texture           _backgorundTexture;
    2447
    25 };
     48    float             _foregroundColor;
     49    Texture           _foregorundTexture;
    2650
    27 #endif /* _PROTO_CLASS_H */
     51    bool              _animated;
     52    bool              _animatedStateChanges;
     53  };
     54}
     55#endif /* _GLGUI_STYLE_H */
  • branches/gui/src/lib/util/color.h

    r7195 r8141  
    1616{
    1717public:
     18  Color(float r, float g, float b, float a) :_r(r), _g(g), _b(b), _a(a) {};
     19  Color(const Color& c) { _r = c._r; _g = c._g; _b = c._b; _a = c._a; };
     20
     21  float r() const { return _r; }
     22  float& r() { return _r; }
     23  float g() const { return _g; }
     24  float& g() { return _g; }
     25  float b() const { return _b; }
     26  float& b() { return _b; }
     27  float a() const { return _a; }
     28  float& a() { return _a; }
     29
     30public:
    1831  static Vector RGBtoHSV (const Vector& RGB);
    1932  static void RGBtoHSV (const Vector& RGB, Vector& HSV);
     
    2437  static float minrgb(float r, float g, float b);
    2538  static float maxrgb(float r, float g, float b);
     39
     40  float       _r;     //!< Red Value.
     41  float       _g;     //!< Green Value.
     42  float       _b;     //!< Blue Value.
     43  float       _a;     //!< Alpha Value.
     44
    2645};
    2746
Note: See TracChangeset for help on using the changeset viewer.