]>
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 | |
b5dbe15d | 23 | class WXDLLIMPEXP_FWD_CORE wxSpinEvent; |
6b775e66 JS |
24 | #else |
25 | #define USE_SPINCTRL_FOR_POINT_SIZE 0 | |
26 | #endif | |
27 | ||
c801d85f KB |
28 | /* |
29 | * FONT DIALOG | |
30 | */ | |
ca65c044 | 31 | |
b5dbe15d VS |
32 | class WXDLLIMPEXP_FWD_CORE wxChoice; |
33 | class WXDLLIMPEXP_FWD_CORE wxText; | |
34 | class WXDLLIMPEXP_FWD_CORE wxCheckBox; | |
35 | class WXDLLIMPEXP_FWD_CORE 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 | |
53a2db12 | 47 | class WXDLLIMPEXP_CORE wxGenericFontDialog : public wxFontDialogBase |
c801d85f | 48 | { |
c2c59b22 VZ |
49 | public: |
50 | wxGenericFontDialog() { Init(); } | |
063d8a57 JS |
51 | wxGenericFontDialog(wxWindow *parent) |
52 | : wxFontDialogBase(parent) { Init(); } | |
c2c59b22 VZ |
53 | wxGenericFontDialog(wxWindow *parent, const wxFontData& data) |
54 | : wxFontDialogBase(parent, data) { Init(); } | |
55 | virtual ~wxGenericFontDialog(); | |
56 | ||
57 | virtual int ShowModal(); | |
58 | ||
ca3e85cf | 59 | #if WXWIN_COMPATIBILITY_2_6 |
c2c59b22 | 60 | // deprecated, for backwards compatibility only |
ca3e85cf WS |
61 | wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) ); |
62 | #endif // WXWIN_COMPATIBILITY_2_6 | |
c801d85f | 63 | |
c2c59b22 VZ |
64 | // Internal functions |
65 | void OnCloseWindow(wxCloseEvent& event); | |
c801d85f | 66 | |
c2c59b22 VZ |
67 | virtual void CreateWidgets(); |
68 | virtual void InitializeFont(); | |
c801d85f | 69 | |
c2c59b22 | 70 | void OnChangeFont(wxCommandEvent& event); |
c801d85f | 71 | |
6b775e66 JS |
72 | #if USE_SPINCTRL_FOR_POINT_SIZE |
73 | void OnChangeSize(wxSpinEvent& event); | |
74 | #endif | |
75 | ||
c2c59b22 | 76 | protected: |
cececf4d WS |
77 | |
78 | virtual bool DoCreate(wxWindow *parent); | |
79 | ||
80 | private: | |
81 | ||
c2c59b22 VZ |
82 | // common part of all ctors |
83 | void Init(); | |
c801d85f | 84 | |
cececf4d | 85 | void DoChangeFont(); |
c801d85f | 86 | |
cececf4d | 87 | wxFont m_dialogFont; |
c2c59b22 | 88 | |
cececf4d WS |
89 | wxChoice *m_familyChoice; |
90 | wxChoice *m_styleChoice; | |
91 | wxChoice *m_weightChoice; | |
92 | wxChoice *m_colourChoice; | |
93 | wxCheckBox *m_underLineCheckBox; | |
6b775e66 JS |
94 | |
95 | #if !USE_SPINCTRL_FOR_POINT_SIZE | |
cececf4d | 96 | wxChoice *m_pointSizeChoice; |
6b775e66 | 97 | #endif |
c2c59b22 VZ |
98 | |
99 | wxFontPreviewer *m_previewer; | |
100 | bool m_useEvents; | |
101 | ||
102 | // static bool fontDialogCancelled; | |
103 | DECLARE_EVENT_TABLE() | |
104 | DECLARE_DYNAMIC_CLASS(wxGenericFontDialog) | |
c801d85f KB |
105 | }; |
106 | ||
ca3e85cf WS |
107 | #if WXWIN_COMPATIBILITY_2_6 |
108 | // deprecated, for backwards compatibility only | |
109 | inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data) | |
110 | :wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); } | |
111 | #endif // WXWIN_COMPATIBILITY_2_6 | |
112 | ||
c2c59b22 | 113 | #endif // _WX_GENERIC_FONTDLGG_H |