| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- $#include "LineEdit.h"
- /// Single-line text editor %UI element.
- class LineEdit : public BorderImage
- {
- public:
- /// Construct.
- LineEdit(Context* context);
- /// Destruct.
- virtual ~LineEdit();
- /// Set text.
- void SetText(const String& text);
- /// Set cursor position.
- void SetCursorPosition(unsigned position);
- /// Set cursor blink rate. 0 disables blinking.
- void SetCursorBlinkRate(float rate);
- /// Set maximum text length. 0 for unlimited.
- void SetMaxLength(unsigned length);
- /// Set echo character for password entry and such. 0 (default) shows the actual text.
- void SetEchoCharacter(unsigned c);
- /// Set whether can move cursor with arrows or mouse, default true.
- void SetCursorMovable(bool enable);
- /// Set whether selections are allowed, default true.
- void SetTextSelectable(bool enable);
- /// Set whether copy-paste operations are allowed, default true.
- void SetTextCopyable(bool enable);
- /// Set text selection doubleclick interval in seconds.
- void SetDoubleClickInterval(float interval);
- /// Return text.
- const String& GetText() const { return line_; }
- /// Return cursor position.
- unsigned GetCursorPosition() const { return cursorPosition_; }
- /// Return cursor blink rate.
- float GetCursorBlinkRate() const { return cursorBlinkRate_; }
- /// Return maximum text length.
- unsigned GetMaxLength() const { return maxLength_; }
- /// Return echo character.
- unsigned GetEchoCharacter() const { return echoCharacter_; }
- /// Return whether can move cursor with arrows or mouse.
- bool IsCursorMovable() const { return cursorMovable_; }
- /// Return whether selections are allowed.
- bool IsTextSelectable() const { return textSelectable_; }
- /// Return whether copy-paste operations are allowed.
- bool IsTextCopyable() const { return textCopyable_; }
- /// Return text element.
- Text* GetTextElement() const { return text_; }
- /// Return cursor element.
- BorderImage* GetCursor() const { return cursor_; }
- /// Return text selection doubleclick interval in seconds.
- float GetDoubleClickInterval() const;
- };
|