Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2006, 10:33:24 PM (18 years ago)
Author:
bensch
Message:

added image-button a speciality of glgui to display buttons, that on push show a new Image inside a ImageWidget

File:
1 copied

Legend:

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

    r8686 r8688  
    77 */
    88
    9 #ifndef _GLGUI_NOTIFIER_H
    10 #define _GLGUI_NOTIFIER_H
     9#ifndef _GLGUI_IMAGEBUTTON_H
     10#define _GLGUI_IMAGEBUTTON_H
    1111
    1212#include "glgui_widget.h"
     
    1515#include <stack>
    1616
    17 // FORWARD DECLARATION
    18 class MultiLineText;
    19 class Text;
    20 
    21 //! Namespace of the GLGuiNotifier of ORXONOX.
     17//! Namespace of the GLGuiImageButton of ORXONOX.
    2218namespace OrxGui
    2319{
    24   class GLGuiNotifier : public GLGuiWidget
     20  class GLGuiImageButton : public GLGuiWidget
    2521  {
    2622  public:
    27     GLGuiNotifier();
    28     virtual ~GLGuiNotifier();
    29 
    30     void pushNotifyMessage(const std::string& message);
    31 
    32     /// Setup
    33     void setDisplayLineCount(unsigned int count);
    34     void setFadeAge(float fadeAge);
    35     void setHideAge(float hideAge);
    36 
    37     /** @returns the beginning of the Hiding process */
    38     inline float fadeAge() const { return _fadeAge; };
    39     /** @returns at what age elements should be fully hidden */
    40     inline float hideAge() const { return _hideAge; };
    41 
    42     void clear();
    43 
    44     // Element2D-functions
    45     virtual void tick(float dt);
    46     virtual void draw() const;
     23    GLGuiImageButton();
     24    virtual ~GLGuiImageButton();
    4725
    4826    void debug() const;
     
    5230
    5331  private:
    54     void repositionText();
    55     void applyTextSettings(MultiLineText* text);
    56     void applySettings();
    57     // helpers //
    58     Vector2D calculateLinePosition(unsigned int lineNumber);
    59 
    60 
    6132
    6233  private:
    63     //! structure that defines a Displayed line.
    64     typedef struct
    65     {
    66       float             age;
    67       MultiLineText*    text;
    68 
    69     } DisplayLine;
    70 
    71 
    72     float                       _fadeAge;
    73     float                       _hideAge;
    74     float                       _transformAge;
    75 
    76     unsigned int                lineSpacing;            //!< The Spacing between lines.
    77 
    78     // BUFFER
    79     unsigned int                bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters).
    80     std::list<DisplayLine>      displayLines;           //!< A list of stored bufferTexts for the display of the buffer.
    81 
    82     std::stack<MultiLineText*>  hiddenText;             //!< Text that is not shown, and not used is thrown in here
    83 
    84 
    85     unsigned long               linesProcessed;         //!< How many Lines have been processed so far.
    86     std::list<std::string>      inputBuffer;            //!< The input buffer for lines that were not yet printet out, because there is too much input.
    8734
    8835  };
     
    9037}
    9138
    92 #endif /* _GLGUI_NOTIFIER_H */
     39#endif /* _GLGUI_IMAGEBUTTON_H */
Note: See TracChangeset for help on using the changeset viewer.