fontdata.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: fontdata.h
  3. // Purpose: interface of wxFontData
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @class wxFontData
  9. This class holds a variety of information related to font dialogs.
  10. @library{wxcore}
  11. @category{cmndlg,data}
  12. @see @ref overview_cmndlg_font, wxFont, wxFontDialog
  13. */
  14. class wxFontData : public wxObject
  15. {
  16. public:
  17. /**
  18. Constructor. Initializes @e fontColour to black, @e showHelp to @false,
  19. @e allowSymbols to @true, @e enableEffects to @true, @e minSize to 0
  20. and @e maxSize to 0.
  21. */
  22. wxFontData();
  23. /**
  24. Enables or disables "effects" under Windows or generic only. This
  25. refers to the controls for manipulating colour, strikeout and underline
  26. properties.
  27. The default value is @true.
  28. */
  29. void EnableEffects(bool enable);
  30. /**
  31. Under Windows, returns a flag determining whether symbol fonts can be
  32. selected. Has no effect on other platforms.
  33. The default value is @true.
  34. */
  35. bool GetAllowSymbols() const;
  36. /**
  37. Gets the font chosen by the user if the user pressed OK
  38. (wxFontDialog::ShowModal() returned wxID_OK).
  39. */
  40. wxFont GetChosenFont() const;
  41. /**
  42. Gets the colour associated with the font dialog.
  43. The default value is black.
  44. */
  45. const wxColour& GetColour() const;
  46. /**
  47. Determines whether "effects" are enabled under Windows. This refers to
  48. the controls for manipulating colour, strikeout and underline
  49. properties.
  50. The default value is @true.
  51. */
  52. bool GetEnableEffects() const;
  53. /**
  54. Gets the font that will be initially used by the font dialog. This
  55. should have previously been set by the application.
  56. */
  57. wxFont GetInitialFont() const;
  58. /**
  59. Returns @true if the Help button will be shown (Windows only).
  60. The default value is @false.
  61. */
  62. bool GetShowHelp() const;
  63. /**
  64. Under Windows, determines whether symbol fonts can be selected. Has no
  65. effect on other platforms.
  66. The default value is @true.
  67. */
  68. void SetAllowSymbols(bool allowSymbols);
  69. /**
  70. Sets the font that will be returned to the user (for internal use
  71. only).
  72. */
  73. void SetChosenFont(const wxFont& font);
  74. /**
  75. Sets the colour that will be used for the font foreground colour.
  76. The default colour is black.
  77. */
  78. void SetColour(const wxColour& colour);
  79. /**
  80. Sets the font that will be initially used by the font dialog.
  81. */
  82. void SetInitialFont(const wxFont& font);
  83. /**
  84. Sets the valid range for the font point size (Windows only).
  85. The default is 0, 0 (unrestricted range).
  86. */
  87. void SetRange(int min, int max);
  88. /**
  89. Determines whether the Help button will be displayed in the font dialog
  90. (Windows only).
  91. The default value is @false.
  92. */
  93. void SetShowHelp(bool showHelp);
  94. /**
  95. Assignment operator for the font data.
  96. */
  97. wxFontData& operator =(const wxFontData& data);
  98. };