Text.pkg 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. $#include "Text.h"
  2. class Text : public UIElement
  3. {
  4. Text(Context* context);
  5. virtual ~Text();
  6. bool SetFont(const String& fontName, int size = DEFAULT_FONT_SIZE);
  7. bool SetFont(const char* fontName, int size = DEFAULT_FONT_SIZE);
  8. bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
  9. void SetText(const String& text);
  10. void SetText(const char* text);
  11. void SetTextAlignment(HorizontalAlignment align);
  12. void SetRowSpacing(float spacing);
  13. void SetWordwrap(bool enable);
  14. void SetSelection(unsigned start, unsigned length = M_MAX_UNSIGNED);
  15. void ClearSelection();
  16. void SetSelectionColor(const Color& color);
  17. void SetHoverColor(const Color& color);
  18. Font* GetFont() const;
  19. int GetFontSize() const;
  20. const String& GetText() const;
  21. HorizontalAlignment GetTextAlignment() const;
  22. float GetRowSpacing() const;
  23. bool GetWordwrap() const;
  24. unsigned GetSelectionStart() const;
  25. unsigned GetSelectionLength() const;
  26. const Color& GetSelectionColor() const;
  27. const Color& GetHoverColor() const;
  28. int GetRowHeight() const;
  29. unsigned GetNumRows() const;
  30. void SetFontAttr(ResourceRef value);
  31. ResourceRef GetFontAttr() const;
  32. tolua_property__get_set Font* font;
  33. tolua_readonly tolua_property__get_set int fontSize;
  34. tolua_property__get_set String& text;
  35. tolua_property__get_set HorizontalAlignment textAlignment;
  36. tolua_property__get_set float rowSpacing;
  37. tolua_property__get_set bool wordwrap;
  38. tolua_readonly tolua_property__get_set unsigned selectionStart;
  39. tolua_readonly tolua_property__get_set unsigned selectionLength;
  40. tolua_property__get_set Color& selectionColor;
  41. tolua_property__get_set Color& hoverColor;
  42. tolua_readonly tolua_property__get_set int rowHeight;
  43. tolua_readonly tolua_property__get_set unsigned numRows;
  44. tolua_property__get_set ResourceRef fontAttr;
  45. };