Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/gl/glgui_inputline.h @ 8448

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

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

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    virtual void resize();
55
56
57  private:
58    void init();
59    void changedText();
60
61  private:
62    Text                    _text;            //!< The Text to display inside of the InputLine.
63
64    Uint16                  pressedKey;       //!< the pressed key that will be repeated.
65    Uint16                  pressedKeyName;   //!< The Name of the Key, that was pressed.
66
67    float                   delayNext;        //!< How much time must pass before next output.
68
69    static float            repeatDelay;      //!< Repead Delay.
70    static float            repeatRate;       //!< Repeat Rate.
71  };
72}
73
74#endif /* _GLGUI_INPUTLINE_H */
Note: See TracBrowser for help on using the repository browser.