@TextStyleEditor.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class TextStyleEditor : PropWin
  4. {
  5. class Change : Edit::_Undo::Change
  6. {
  7. EditTextStyle data;
  8. virtual void create(ptr user)override;
  9. virtual void apply(ptr user)override;
  10. };
  11. class TextClip : TextNoTest
  12. {
  13. virtual void draw(C GuiPC &gpc)override;
  14. };
  15. UID elm_id;
  16. Elm *elm;
  17. bool changed;
  18. EditTextStyle edit;
  19. TextStylePtr game;
  20. TextClip text;
  21. Panel panel;
  22. Button undo, redo, locate;
  23. Property *font_prop;
  24. Edit::Undo<Change> undos; void undoVis();
  25. static void PreChanged(C Property &prop);
  26. static void Changed(C Property &prop);
  27. static void ParamsShadow(EditTextStyle &e, C Str &t);
  28. static void ParamsShade (EditTextStyle &e, C Str &t);
  29. static void ParamsColor (EditTextStyle &e, C Str &t);
  30. static void ParamsSelect(EditTextStyle &e, C Str &t);
  31. static void ParamsAlign (EditTextStyle &e, C Str &t);
  32. static void ParamsSize (EditTextStyle &e, C Str &t);
  33. static void ParamsSpace (EditTextStyle &e, C Str &t);
  34. static void ParamsFont (EditTextStyle &e, C Str &t);
  35. static Str ParamsFont(C EditTextStyle &e);
  36. static void Undo (TextStyleEditor &editor);
  37. static void Redo (TextStyleEditor &editor);
  38. static void Locate(TextStyleEditor &editor);
  39. void create();
  40. void toGame();
  41. void toGui ();
  42. virtual TextStyleEditor& hide ( ) override;
  43. virtual Rect sizeLimit( )C override;
  44. virtual TextStyleEditor& rect (C Rect &rect) override;
  45. void flush();
  46. void setChanged();
  47. void set(Elm *elm);
  48. void activate(Elm *elm);
  49. void toggle (Elm *elm);
  50. void elmChanged(C UID &elm_id);
  51. void erasing(C UID &elm_id);
  52. void fontChanged();
  53. void drag(Memc<UID> &elms, GuiObj *obj, C Vec2 &screen_pos);
  54. public:
  55. TextStyleEditor();
  56. };
  57. /******************************************************************************/
  58. /******************************************************************************/
  59. extern TextStyleEditor TextStyleEdit;
  60. /******************************************************************************/