Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/gui/src/lib/gui/gl/glgui_inputline.h @ 8437

Last change on this file since 8437 was 8419, checked in by bensch, 18 years ago

Better coloring sceme

File size: 1.8 KB
Line 
1/*!
2 * @file glgui_inputline.h
3 * The gl_INPUTLINE widget of th openglGUI
4 *
5 */
6
7#ifndef _GLGUI_INPUTLINE_H
8#define _GLGUI_INPUTLINE_H
9
10#include "glgui_widget.h"
11#include "text.h"
12#include "event.h"
13
14// FORWARD DECLARATION
15namespace OrxGui
16{
17
18  //! This is InputLine part of the openglGUI class
19  /**
20   * The InputLine is a Widget, that displays a Line, that can be manipulated through
21   * Writing Text on it.
22   *
23   * Whenever the Text is changed the textChanged signal is emitted.
24   */
25  class GLGuiInputLine : public OrxGui::GLGuiWidget
26  {
27
28  public:
29    GLGuiInputLine();
30    virtual ~GLGuiInputLine();
31
32
33    /** @returns the text of the inputLine */
34    const std::string& _getText() const { return this->_text.getText(); };
35
36    void setText(const std::string& text);
37    void append(const std::string& appendText);
38    void appendCharacter(char character);
39    void removeCharacters(unsigned int chars);
40
41    virtual void removedFocus();
42
43    virtual void tick(float dt);
44    virtual void draw() const;
45
46    virtual bool processEvent(const Event& event);
47
48    DeclareSignal1(textChanged, const std::string&);
49
50  protected:
51    virtual void updateFrontColor();
52    virtual void hiding();
53    virtual void showing();
54
55
56  private:
57    void init();
58    void resize();
59
60  private:
61    Text                    _text;            //!< The Text to display inside of the InputLine.
62
63    Uint16                  pressedKey;       //!< the pressed key that will be repeated.
64    Uint16                  pressedKeyName;   //!< The Name of the Key, that was pressed.
65
66    float                   delayNext;        //!< How much time must pass before next output.
67
68    static float            repeatDelay;      //!< Repead Delay.
69    static float            repeatRate;       //!< Repeat Rate.
70  };
71}
72
73#endif /* _GLGUI_INPUTLINE_H */
Note: See TracBrowser for help on using the repository browser.