1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: common interface for different wxFontDialog classes
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1997-2002 wxWindows team
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FONTDLG_H_BASE_
13 #define _WX_FONTDLG_H_BASE_
15 #include "wx/defs.h" // for wxUSE_FONTDLG
19 #include "wx/dialog.h" // the base class
20 #include "wx/cmndata.h" // wxFontData
22 // ----------------------------------------------------------------------------
23 // wxFontDialog interface
24 // ----------------------------------------------------------------------------
26 class WXDLLEXPORT wxFontDialogBase
: public wxDialog
29 // create the font dialog
30 wxFontDialogBase() { }
31 wxFontDialogBase(wxWindow
*parent
) { }
32 wxFontDialogBase(wxWindow
*parent
, const wxFontData
& data
) { }
34 bool Create(wxWindow
*parent
)
35 { return DoCreate(parent
); }
36 bool Create(wxWindow
*parent
, const wxFontData
& data
)
37 { m_fontData
= data
; return Create(parent
); }
39 virtual ~wxFontDialogBase();
41 // retrieve the font data
42 const wxFontData
& GetFontData() const { return m_fontData
; }
43 wxFontData
& GetFontData() { return m_fontData
; }
45 // deprecated interface, for compatibility only, don't use
46 wxFontDialogBase(wxWindow
*parent
, const wxFontData
*data
)
47 { Init(); Create(parent
, data
); }
49 bool Create(wxWindow
*parent
, const wxFontData
*data
)
50 { if ( data
) m_fontData
= *data
; return Create(parent
); }
53 virtual bool DoCreate(wxWindow
*parent
) { m_parent
= parent
; return TRUE
; }
55 wxFontData m_fontData
;
58 // ----------------------------------------------------------------------------
59 // platform-specific wxFontDialog implementation
60 // ----------------------------------------------------------------------------
62 #if defined(__WXUNIVERSAL__) || defined(__WXMOTIF__) || defined(__WXMAC__)
63 #include "wx/generic/fontdlgg.h"
64 #define wxFontDialog wxGenericFontDialog
65 #define sm_classwxFontDialog sm_classwxGenericFontDialog
66 #elif defined(__WXMSW__)
67 #include "wx/msw/fontdlg.h"
68 #elif defined(__WXGTK__)
69 #include "wx/gtk/fontdlg.h"
70 #elif defined(__WXPM__)
71 #include "wx/os2/fontdlg.h"
74 // ----------------------------------------------------------------------------
75 // global public functions
76 // ----------------------------------------------------------------------------
78 // get the font from user and return it, returns wxNullFont if the dialog was
81 wxGetFontFromUser(wxWindow
*parent
= (wxWindow
*)NULL
,
82 const wxFont
& fontInit
= wxNullFont
);
84 #endif // wxUSE_FONTDLG
87 // _WX_FONTDLG_H_BASE_