]>
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 | /* | |
22 | * FONT DIALOG | |
23 | */ | |
24 | ||
25 | class WXDLLEXPORT wxChoice; | |
26 | class WXDLLEXPORT wxText; | |
27 | class WXDLLEXPORT wxCheckBox; | |
28 | class WXDLLEXPORT wxFontPreviewer; | |
29 | ||
30 | enum | |
31 | { | |
32 | wxID_FONT_UNDERLINE = 3000, | |
33 | wxID_FONT_STYLE, | |
34 | wxID_FONT_WEIGHT, | |
35 | wxID_FONT_FAMILY, | |
36 | wxID_FONT_COLOUR, | |
37 | wxID_FONT_SIZE | |
38 | }; | |
39 | ||
40 | class WXDLLEXPORT wxGenericFontDialog : public wxFontDialogBase | |
41 | { | |
42 | public: | |
43 | wxGenericFontDialog() { Init(); } | |
44 | wxGenericFontDialog(wxWindow *parent, const wxFontData& data) | |
45 | : wxFontDialogBase(parent, data) { Init(); } | |
46 | virtual ~wxGenericFontDialog(); | |
47 | ||
48 | virtual int ShowModal(); | |
49 | ||
50 | // deprecated, for backwards compatibility only | |
51 | wxGenericFontDialog(wxWindow *parent, const wxFontData *data) | |
52 | : wxFontDialogBase(parent, data) { Init(); } | |
53 | ||
54 | // Internal functions | |
55 | void OnCloseWindow(wxCloseEvent& event); | |
56 | ||
57 | virtual void CreateWidgets(); | |
58 | virtual void InitializeFont(); | |
59 | ||
60 | void OnChangeFont(wxCommandEvent& event); | |
61 | ||
62 | protected: | |
63 | // common part of all ctors | |
64 | void Init(); | |
65 | ||
66 | virtual bool DoCreate(wxWindow *parent); | |
67 | ||
68 | wxFont dialogFont; | |
69 | ||
70 | wxChoice *familyChoice; | |
71 | wxChoice *styleChoice; | |
72 | wxChoice *weightChoice; | |
73 | wxChoice *colourChoice; | |
74 | wxCheckBox *underLineCheckBox; | |
75 | wxChoice *pointSizeChoice; | |
76 | ||
77 | wxFontPreviewer *m_previewer; | |
78 | bool m_useEvents; | |
79 | ||
80 | // static bool fontDialogCancelled; | |
81 | DECLARE_EVENT_TABLE() | |
82 | DECLARE_DYNAMIC_CLASS(wxGenericFontDialog) | |
83 | }; | |
84 | ||
85 | WXDLLEXPORT const wxChar *wxFontFamilyIntToString(int family); | |
86 | WXDLLEXPORT const wxChar *wxFontWeightIntToString(int weight); | |
87 | WXDLLEXPORT const wxChar *wxFontStyleIntToString(int style); | |
88 | WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family); | |
89 | WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight); | |
90 | WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style); | |
91 | ||
92 | #endif // _WX_GENERIC_FONTDLGG_H |