1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/fontdlgg.h
3 // Purpose: wxGenericFontDialog
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_FONTDLGG_H
13 #define _WX_GENERIC_FONTDLGG_H
16 #include "wx/gdicmn.h"
18 #include "wx/dialog.h"
19 #include "wx/cmndata.h"
22 #define USE_SPINCTRL_FOR_POINT_SIZE 1
23 class WXDLLIMPEXP_FWD_CORE wxSpinEvent
;
25 #define USE_SPINCTRL_FOR_POINT_SIZE 0
32 class WXDLLIMPEXP_FWD_CORE wxChoice
;
33 class WXDLLIMPEXP_FWD_CORE wxText
;
34 class WXDLLIMPEXP_FWD_CORE wxCheckBox
;
35 class WXDLLIMPEXP_FWD_CORE wxFontPreviewer
;
39 wxID_FONT_UNDERLINE
= 3000,
47 class WXDLLIMPEXP_CORE wxGenericFontDialog
: public wxFontDialogBase
50 wxGenericFontDialog() { Init(); }
51 wxGenericFontDialog(wxWindow
*parent
)
52 : wxFontDialogBase(parent
) { Init(); }
53 wxGenericFontDialog(wxWindow
*parent
, const wxFontData
& data
)
54 : wxFontDialogBase(parent
, data
) { Init(); }
55 virtual ~wxGenericFontDialog();
57 virtual int ShowModal();
59 #if WXWIN_COMPATIBILITY_2_6
60 // deprecated, for backwards compatibility only
61 wxDEPRECATED( wxGenericFontDialog(wxWindow
*parent
, const wxFontData
*data
) );
62 #endif // WXWIN_COMPATIBILITY_2_6
65 void OnCloseWindow(wxCloseEvent
& event
);
67 virtual void CreateWidgets();
68 virtual void InitializeFont();
70 void OnChangeFont(wxCommandEvent
& event
);
72 #if USE_SPINCTRL_FOR_POINT_SIZE
73 void OnChangeSize(wxSpinEvent
& event
);
78 virtual bool DoCreate(wxWindow
*parent
);
82 // common part of all ctors
89 wxChoice
*m_familyChoice
;
90 wxChoice
*m_styleChoice
;
91 wxChoice
*m_weightChoice
;
92 wxChoice
*m_colourChoice
;
93 wxCheckBox
*m_underLineCheckBox
;
95 #if !USE_SPINCTRL_FOR_POINT_SIZE
96 wxChoice
*m_pointSizeChoice
;
99 wxFontPreviewer
*m_previewer
;
102 // static bool fontDialogCancelled;
103 DECLARE_EVENT_TABLE()
104 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog
)
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
113 #endif // _WX_GENERIC_FONTDLGG_H