Text.pkg 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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(Font* font, int size = DEFAULT_FONT_SIZE);
  8. void SetText(const String text);
  9. void SetTextAlignment(HorizontalAlignment align);
  10. void SetRowSpacing(float spacing);
  11. void SetWordwrap(bool enable);
  12. void SetSelection(unsigned start, unsigned length = M_MAX_UNSIGNED);
  13. void ClearSelection();
  14. void SetSelectionColor(const Color& color);
  15. void SetHoverColor(const Color& color);
  16. Font* GetFont() const;
  17. int GetFontSize() const;
  18. const String& GetText() const;
  19. HorizontalAlignment GetTextAlignment() const;
  20. float GetRowSpacing() const;
  21. bool GetWordwrap() const;
  22. unsigned GetSelectionStart() const;
  23. unsigned GetSelectionLength() const;
  24. const Color& GetSelectionColor() const;
  25. const Color& GetHoverColor() const;
  26. int GetRowHeight() const;
  27. unsigned GetNumRows() const;
  28. void SetFontAttr(ResourceRef value);
  29. ResourceRef GetFontAttr() const;
  30. tolua_property__get_set Font* font;
  31. tolua_readonly tolua_property__get_set int fontSize;
  32. tolua_property__get_set String& text;
  33. tolua_property__get_set HorizontalAlignment textAlignment;
  34. tolua_property__get_set float rowSpacing;
  35. tolua_property__get_set bool wordwrap;
  36. tolua_readonly tolua_property__get_set unsigned selectionStart;
  37. tolua_readonly tolua_property__get_set unsigned selectionLength;
  38. tolua_property__get_set Color& selectionColor;
  39. tolua_property__get_set Color& hoverColor;
  40. tolua_readonly tolua_property__get_set int rowHeight;
  41. tolua_readonly tolua_property__get_set unsigned numRows;
  42. tolua_property__get_set ResourceRef fontAttr;
  43. };