]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/fontdlgg.h
No changes, just simplify preprocessor checks in wxMSW wxTextEntry.
[wxWidgets.git] / include / wx / generic / fontdlgg.h
CommitLineData
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
c801d85f
KB
15#include "wx/gdicmn.h"
16#include "wx/font.h"
c801d85f 17
6b775e66
JS
18#ifdef __WXWINCE__
19#define USE_SPINCTRL_FOR_POINT_SIZE 1
b5dbe15d 20class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
6b775e66
JS
21#else
22#define USE_SPINCTRL_FOR_POINT_SIZE 0
23#endif
24
c801d85f
KB
25/*
26 * FONT DIALOG
27 */
ca65c044 28
b5dbe15d
VS
29class WXDLLIMPEXP_FWD_CORE wxChoice;
30class WXDLLIMPEXP_FWD_CORE wxText;
31class WXDLLIMPEXP_FWD_CORE wxCheckBox;
32class WXDLLIMPEXP_FWD_CORE wxFontPreviewer;
c801d85f 33
c2c59b22
VZ
34enum
35{
36 wxID_FONT_UNDERLINE = 3000,
37 wxID_FONT_STYLE,
38 wxID_FONT_WEIGHT,
39 wxID_FONT_FAMILY,
40 wxID_FONT_COLOUR,
41 wxID_FONT_SIZE
42};
c801d85f 43
53a2db12 44class WXDLLIMPEXP_CORE wxGenericFontDialog : public wxFontDialogBase
c801d85f 45{
c2c59b22
VZ
46public:
47 wxGenericFontDialog() { Init(); }
063d8a57
JS
48 wxGenericFontDialog(wxWindow *parent)
49 : wxFontDialogBase(parent) { Init(); }
c2c59b22
VZ
50 wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
51 : wxFontDialogBase(parent, data) { Init(); }
52 virtual ~wxGenericFontDialog();
53
54 virtual int ShowModal();
55
ca3e85cf 56#if WXWIN_COMPATIBILITY_2_6
c2c59b22 57 // deprecated, for backwards compatibility only
ca3e85cf
WS
58 wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) );
59#endif // WXWIN_COMPATIBILITY_2_6
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 73protected:
cececf4d
WS
74
75 virtual bool DoCreate(wxWindow *parent);
76
77private:
78
c2c59b22
VZ
79 // common part of all ctors
80 void Init();
c801d85f 81
cececf4d 82 void DoChangeFont();
c801d85f 83
cececf4d 84 wxFont m_dialogFont;
c2c59b22 85
cececf4d
WS
86 wxChoice *m_familyChoice;
87 wxChoice *m_styleChoice;
88 wxChoice *m_weightChoice;
89 wxChoice *m_colourChoice;
90 wxCheckBox *m_underLineCheckBox;
6b775e66
JS
91
92#if !USE_SPINCTRL_FOR_POINT_SIZE
cececf4d 93 wxChoice *m_pointSizeChoice;
6b775e66 94#endif
c2c59b22
VZ
95
96 wxFontPreviewer *m_previewer;
97 bool m_useEvents;
98
99 // static bool fontDialogCancelled;
100 DECLARE_EVENT_TABLE()
101 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
c801d85f
KB
102};
103
ca3e85cf
WS
104#if WXWIN_COMPATIBILITY_2_6
105 // deprecated, for backwards compatibility only
106inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
107 :wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); }
108#endif // WXWIN_COMPATIBILITY_2_6
109
c2c59b22 110#endif // _WX_GENERIC_FONTDLGG_H