LineEdit.pkg 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. $#include "LineEdit.h"
  2. /// Single-line text editor %UI element.
  3. class LineEdit : public BorderImage
  4. {
  5. public:
  6. /// Set text.
  7. void SetText(const String& text);
  8. /// Set cursor position.
  9. void SetCursorPosition(unsigned position);
  10. /// Set cursor blink rate. 0 disables blinking.
  11. void SetCursorBlinkRate(float rate);
  12. /// Set maximum text length. 0 for unlimited.
  13. void SetMaxLength(unsigned length);
  14. /// Set echo character for password entry and such. 0 (default) shows the actual text.
  15. void SetEchoCharacter(unsigned c);
  16. /// Set whether can move cursor with arrows or mouse, default true.
  17. void SetCursorMovable(bool enable);
  18. /// Set whether selections are allowed, default true.
  19. void SetTextSelectable(bool enable);
  20. /// Set whether copy-paste operations are allowed, default true.
  21. void SetTextCopyable(bool enable);
  22. /// Set text selection doubleclick interval in seconds.
  23. void SetDoubleClickInterval(float interval);
  24. /// Return text.
  25. const String& GetText() const;
  26. /// Return cursor position.
  27. unsigned GetCursorPosition() const;
  28. /// Return cursor blink rate.
  29. float GetCursorBlinkRate() const;
  30. /// Return maximum text length.
  31. unsigned GetMaxLength() const;
  32. /// Return echo character.
  33. unsigned GetEchoCharacter() const;
  34. /// Return whether can move cursor with arrows or mouse.
  35. bool IsCursorMovable() const;
  36. /// Return whether selections are allowed.
  37. bool IsTextSelectable() const;
  38. /// Return whether copy-paste operations are allowed.
  39. bool IsTextCopyable() const;
  40. /// Return text element.
  41. Text* GetTextElement() const;
  42. /// Return cursor element.
  43. BorderImage* GetCursor() const;
  44. /// Return text selection doubleclick interval in seconds.
  45. float GetDoubleClickInterval() const;
  46. };