]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/generic/fontdlgg.h | |
3 | // Purpose: wxGenericFontDialog | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_GENERIC_FONTDLGG_H | |
13 | #define _WX_GENERIC_FONTDLGG_H | |
14 | ||
15 | #include "wx/defs.h" | |
16 | #include "wx/gdicmn.h" | |
17 | #include "wx/font.h" | |
18 | #include "wx/dialog.h" | |
19 | #include "wx/cmndata.h" | |
20 | ||
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 | ||
28 | /* | |
29 | * FONT DIALOG | |
30 | */ | |
31 | ||
32 | class WXDLLEXPORT wxChoice; | |
33 | class WXDLLEXPORT wxText; | |
34 | class WXDLLEXPORT wxCheckBox; | |
35 | class WXDLLEXPORT wxFontPreviewer; | |
36 | ||
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 | }; | |
46 | ||
47 | class WXDLLEXPORT wxGenericFontDialog : public wxFontDialogBase | |
48 | { | |
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(); } | |
60 | ||
61 | // Internal functions | |
62 | void OnCloseWindow(wxCloseEvent& event); | |
63 | ||
64 | virtual void CreateWidgets(); | |
65 | virtual void InitializeFont(); | |
66 | ||
67 | void OnChangeFont(wxCommandEvent& event); | |
68 | ||
69 | #if USE_SPINCTRL_FOR_POINT_SIZE | |
70 | void OnChangeSize(wxSpinEvent& event); | |
71 | #endif | |
72 | ||
73 | protected: | |
74 | ||
75 | virtual bool DoCreate(wxWindow *parent); | |
76 | ||
77 | private: | |
78 | ||
79 | // common part of all ctors | |
80 | void Init(); | |
81 | ||
82 | void DoChangeFont(); | |
83 | ||
84 | wxFont m_dialogFont; | |
85 | ||
86 | wxChoice *m_familyChoice; | |
87 | wxChoice *m_styleChoice; | |
88 | wxChoice *m_weightChoice; | |
89 | wxChoice *m_colourChoice; | |
90 | wxCheckBox *m_underLineCheckBox; | |
91 | ||
92 | #if !USE_SPINCTRL_FOR_POINT_SIZE | |
93 | wxChoice *m_pointSizeChoice; | |
94 | #endif | |
95 | ||
96 | wxFontPreviewer *m_previewer; | |
97 | bool m_useEvents; | |
98 | ||
99 | // static bool fontDialogCancelled; | |
100 | DECLARE_EVENT_TABLE() | |
101 | DECLARE_DYNAMIC_CLASS(wxGenericFontDialog) | |
102 | }; | |
103 | ||
104 | WXDLLEXPORT const wxChar *wxFontFamilyIntToString(int family); | |
105 | WXDLLEXPORT const wxChar *wxFontWeightIntToString(int weight); | |
106 | WXDLLEXPORT const wxChar *wxFontStyleIntToString(int style); | |
107 | WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family); | |
108 | WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight); | |
109 | WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style); | |
110 | ||
111 | #endif // _WX_GENERIC_FONTDLGG_H |