- 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);
+
+#if USE_SPINCTRL_FOR_POINT_SIZE
+ void OnChangeSize(wxSpinEvent& event);
+#endif
+
+protected:
+
+ virtual bool DoCreate(wxWindow *parent);
+
+private:
+
+ // common part of all ctors
+ void Init();
+
+ void DoChangeFont();
+
+ wxFont m_dialogFont;
+
+ wxChoice *m_familyChoice;
+ wxChoice *m_styleChoice;
+ wxChoice *m_weightChoice;
+ wxChoice *m_colourChoice;
+ wxCheckBox *m_underLineCheckBox;
+
+#if !USE_SPINCTRL_FOR_POINT_SIZE
+ wxChoice *m_pointSizeChoice;
+#endif
+
+ wxFontPreviewer *m_previewer;
+ bool m_useEvents;
+
+ // static bool fontDialogCancelled;
+ DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)