- DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
- protected:
- wxFontData fontData;
- wxFont dialogFont;
- wxWindow *dialogParent;
-
- wxChoice *familyChoice;
- wxChoice *styleChoice;
- wxChoice *weightChoice;
- wxChoice *colourChoice;
- wxCheckBox *underLineCheckBox;
- wxChoice *pointSizeChoice;
- wxFontPreviewer *m_previewer;
- bool m_useEvents;
-
-// static bool fontDialogCancelled;
- public:
-
- wxGenericFontDialog(void);
- wxGenericFontDialog(wxWindow *parent, const wxFontData& data);
- ~wxGenericFontDialog(void);
-
- bool Create(wxWindow *parent, const wxFontData& data);
-
- int ShowModal(void);
-
- inline wxFontData& GetFontData(void) { return fontData; }
-
- // Internal functions
- void OnCloseWindow(wxCloseEvent& event);
-
- virtual void CreateWidgets(void);
- virtual void InitializeFont(void);
-
- void OnChangeFont(wxCommandEvent& event);
-
-DECLARE_EVENT_TABLE()
+public:
+ wxGenericFontDialog() { Init(); }
+ wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
+ : wxFontDialogBase(parent, data) { Init(); }
+ virtual ~wxGenericFontDialog();
+
+ virtual int ShowModal();
+
+ // deprecated, for backwards compatibility only
+ wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
+ : wxFontDialogBase(parent, data) { Init(); }
+
+ // Internal functions
+ void OnCloseWindow(wxCloseEvent& event);
+
+ virtual void CreateWidgets();
+ virtual void InitializeFont();
+
+ void OnChangeFont(wxCommandEvent& event);
+
+protected:
+ // common part of all ctors
+ void Init();
+
+ virtual bool DoCreate(wxWindow *parent);
+
+ wxFont dialogFont;
+
+ wxChoice *familyChoice;
+ wxChoice *styleChoice;
+ wxChoice *weightChoice;
+ wxChoice *colourChoice;
+ wxCheckBox *underLineCheckBox;
+ wxChoice *pointSizeChoice;
+
+ wxFontPreviewer *m_previewer;
+ bool m_useEvents;
+
+ // static bool fontDialogCancelled;
+ DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)