]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/fontdlgg.h
Fix wxOSX warnings about int-to-void* casts.
[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
99d80019 7// Copyright: (c) Julian Smart
ca65c044 8// Licence: wxWindows licence
c801d85f
KB
9/////////////////////////////////////////////////////////////////////////////
10
c2c59b22
VZ
11#ifndef _WX_GENERIC_FONTDLGG_H
12#define _WX_GENERIC_FONTDLGG_H
c801d85f 13
c801d85f
KB
14#include "wx/gdicmn.h"
15#include "wx/font.h"
c801d85f 16
6b775e66
JS
17#ifdef __WXWINCE__
18#define USE_SPINCTRL_FOR_POINT_SIZE 1
b5dbe15d 19class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
6b775e66
JS
20#else
21#define USE_SPINCTRL_FOR_POINT_SIZE 0
22#endif
23
c801d85f
KB
24/*
25 * FONT DIALOG
26 */
ca65c044 27
b5dbe15d
VS
28class WXDLLIMPEXP_FWD_CORE wxChoice;
29class WXDLLIMPEXP_FWD_CORE wxText;
30class WXDLLIMPEXP_FWD_CORE wxCheckBox;
31class WXDLLIMPEXP_FWD_CORE wxFontPreviewer;
c801d85f 32
c2c59b22
VZ
33enum
34{
35 wxID_FONT_UNDERLINE = 3000,
36 wxID_FONT_STYLE,
37 wxID_FONT_WEIGHT,
38 wxID_FONT_FAMILY,
39 wxID_FONT_COLOUR,
40 wxID_FONT_SIZE
41};
c801d85f 42
53a2db12 43class WXDLLIMPEXP_CORE wxGenericFontDialog : public wxFontDialogBase
c801d85f 44{
c2c59b22
VZ
45public:
46 wxGenericFontDialog() { Init(); }
063d8a57
JS
47 wxGenericFontDialog(wxWindow *parent)
48 : wxFontDialogBase(parent) { Init(); }
c2c59b22
VZ
49 wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
50 : wxFontDialogBase(parent, data) { Init(); }
51 virtual ~wxGenericFontDialog();
52
53 virtual int ShowModal();
54
ca3e85cf 55#if WXWIN_COMPATIBILITY_2_6
c2c59b22 56 // deprecated, for backwards compatibility only
ca3e85cf
WS
57 wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) );
58#endif // WXWIN_COMPATIBILITY_2_6
c801d85f 59
c2c59b22
VZ
60 // Internal functions
61 void OnCloseWindow(wxCloseEvent& event);
c801d85f 62
c2c59b22
VZ
63 virtual void CreateWidgets();
64 virtual void InitializeFont();
c801d85f 65
c2c59b22 66 void OnChangeFont(wxCommandEvent& event);
c801d85f 67
6b775e66
JS
68#if USE_SPINCTRL_FOR_POINT_SIZE
69 void OnChangeSize(wxSpinEvent& event);
70#endif
71
c2c59b22 72protected:
cececf4d
WS
73
74 virtual bool DoCreate(wxWindow *parent);
75
76private:
77
c2c59b22
VZ
78 // common part of all ctors
79 void Init();
c801d85f 80
cececf4d 81 void DoChangeFont();
c801d85f 82
cececf4d 83 wxFont m_dialogFont;
c2c59b22 84
cececf4d
WS
85 wxChoice *m_familyChoice;
86 wxChoice *m_styleChoice;
87 wxChoice *m_weightChoice;
88 wxChoice *m_colourChoice;
89 wxCheckBox *m_underLineCheckBox;
6b775e66
JS
90
91#if !USE_SPINCTRL_FOR_POINT_SIZE
cececf4d 92 wxChoice *m_pointSizeChoice;
6b775e66 93#endif
c2c59b22
VZ
94
95 wxFontPreviewer *m_previewer;
96 bool m_useEvents;
97
98 // static bool fontDialogCancelled;
99 DECLARE_EVENT_TABLE()
100 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
c801d85f
KB
101};
102
ca3e85cf
WS
103#if WXWIN_COMPATIBILITY_2_6
104 // deprecated, for backwards compatibility only
105inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
106 :wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); }
107#endif // WXWIN_COMPATIBILITY_2_6
108
c2c59b22 109#endif // _WX_GENERIC_FONTDLGG_H