]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
c2c59b22 | 2 | // Name: wx/generic/fontdlgg.h |
c801d85f KB |
3 | // Purpose: wxGenericFontDialog |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
99d80019 | 8 | // Copyright: (c) Julian Smart |
ca65c044 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
c2c59b22 VZ |
12 | #ifndef _WX_GENERIC_FONTDLGG_H |
13 | #define _WX_GENERIC_FONTDLGG_H | |
c801d85f | 14 | |
b73e73f9 | 15 | #include "wx/defs.h" |
c801d85f KB |
16 | #include "wx/gdicmn.h" |
17 | #include "wx/font.h" | |
18 | #include "wx/dialog.h" | |
19 | #include "wx/cmndata.h" | |
20 | ||
6b775e66 JS |
21 | #ifdef __WXWINCE__ |
22 | #define USE_SPINCTRL_FOR_POINT_SIZE 1 | |
23 | class WXDLLEXPORT wxSpinEvent; | |
24 | #else | |
25 | #define USE_SPINCTRL_FOR_POINT_SIZE 0 | |
26 | #endif | |
27 | ||
c801d85f KB |
28 | /* |
29 | * FONT DIALOG | |
30 | */ | |
ca65c044 | 31 | |
c801d85f KB |
32 | class WXDLLEXPORT wxChoice; |
33 | class WXDLLEXPORT wxText; | |
34 | class WXDLLEXPORT wxCheckBox; | |
53cf79fa | 35 | class WXDLLEXPORT wxFontPreviewer; |
c801d85f | 36 | |
c2c59b22 VZ |
37 | enum |
38 | { | |
39 | wxID_FONT_UNDERLINE = 3000, | |
40 | wxID_FONT_STYLE, | |
41 | wxID_FONT_WEIGHT, | |
42 | wxID_FONT_FAMILY, | |
43 | wxID_FONT_COLOUR, | |
44 | wxID_FONT_SIZE | |
45 | }; | |
c801d85f | 46 | |
c2c59b22 | 47 | class WXDLLEXPORT wxGenericFontDialog : public wxFontDialogBase |
c801d85f | 48 | { |
c2c59b22 VZ |
49 | public: |
50 | wxGenericFontDialog() { Init(); } | |
51 | wxGenericFontDialog(wxWindow *parent, const wxFontData& data) | |
52 | : wxFontDialogBase(parent, data) { Init(); } | |
53 | virtual ~wxGenericFontDialog(); | |
54 | ||
55 | virtual int ShowModal(); | |
56 | ||
57 | // deprecated, for backwards compatibility only | |
58 | wxGenericFontDialog(wxWindow *parent, const wxFontData *data) | |
59 | : wxFontDialogBase(parent, data) { Init(); } | |
c801d85f | 60 | |
c2c59b22 VZ |
61 | // Internal functions |
62 | void OnCloseWindow(wxCloseEvent& event); | |
c801d85f | 63 | |
c2c59b22 VZ |
64 | virtual void CreateWidgets(); |
65 | virtual void InitializeFont(); | |
c801d85f | 66 | |
c2c59b22 | 67 | void OnChangeFont(wxCommandEvent& event); |
c801d85f | 68 | |
6b775e66 JS |
69 | #if USE_SPINCTRL_FOR_POINT_SIZE |
70 | void OnChangeSize(wxSpinEvent& event); | |
71 | #endif | |
72 | ||
c2c59b22 VZ |
73 | protected: |
74 | // common part of all ctors | |
75 | void Init(); | |
c801d85f | 76 | |
c2c59b22 | 77 | virtual bool DoCreate(wxWindow *parent); |
c801d85f | 78 | |
c2c59b22 VZ |
79 | wxFont dialogFont; |
80 | ||
81 | wxChoice *familyChoice; | |
82 | wxChoice *styleChoice; | |
83 | wxChoice *weightChoice; | |
84 | wxChoice *colourChoice; | |
85 | wxCheckBox *underLineCheckBox; | |
6b775e66 JS |
86 | |
87 | #if !USE_SPINCTRL_FOR_POINT_SIZE | |
c2c59b22 | 88 | wxChoice *pointSizeChoice; |
6b775e66 | 89 | #endif |
c2c59b22 VZ |
90 | |
91 | wxFontPreviewer *m_previewer; | |
92 | bool m_useEvents; | |
93 | ||
94 | // static bool fontDialogCancelled; | |
95 | DECLARE_EVENT_TABLE() | |
96 | DECLARE_DYNAMIC_CLASS(wxGenericFontDialog) | |
c801d85f KB |
97 | }; |
98 | ||
e9c9f9d4 VS |
99 | WXDLLEXPORT const wxChar *wxFontFamilyIntToString(int family); |
100 | WXDLLEXPORT const wxChar *wxFontWeightIntToString(int weight); | |
101 | WXDLLEXPORT const wxChar *wxFontStyleIntToString(int style); | |
102 | WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family); | |
103 | WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight); | |
104 | WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style); | |
c801d85f | 105 | |
c2c59b22 | 106 | #endif // _WX_GENERIC_FONTDLGG_H |