]> git.saurik.com Git - wxWidgets.git/blame - include/wx/fontdlg.h
Small speed up to fonts and support for scaling.
[wxWidgets.git] / include / wx / fontdlg.h
CommitLineData
dbc65e27
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/fontdlg.h
3// Purpose: common interface for different wxFontDialog classes
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 12.05.02
7// RCS-ID: $Id$
8// Copyright: (c) 1997-2002 wxWindows team
9// Licence: wxWindows license
10///////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_FONTDLG_H_BASE_
13#define _WX_FONTDLG_H_BASE_
c801d85f 14
dbc65e27
VZ
15#include "wx/defs.h" // for wxUSE_FONTDLG
16
1e6feb95
VZ
17#if wxUSE_FONTDLG
18
dbc65e27
VZ
19#include "wx/dialog.h" // the base class
20#include "wx/cmndata.h" // wxFontData
21
22// ----------------------------------------------------------------------------
23// wxFontDialog interface
24// ----------------------------------------------------------------------------
25
26class WXDLLEXPORT wxFontDialogBase : public wxDialog
27{
28public:
29 // create the font dialog
30 wxFontDialogBase() { }
3fde374f
VZ
31 wxFontDialogBase(wxWindow *parent) { m_parent = parent; }
32 wxFontDialogBase(wxWindow *parent, const wxFontData& data)
33 { m_parent = parent; InitFontData(&data); }
dbc65e27
VZ
34
35 bool Create(wxWindow *parent)
36 { return DoCreate(parent); }
37 bool Create(wxWindow *parent, const wxFontData& data)
3fde374f 38 { InitFontData(&data); return Create(parent); }
dbc65e27
VZ
39
40 virtual ~wxFontDialogBase();
41
42 // retrieve the font data
43 const wxFontData& GetFontData() const { return m_fontData; }
44 wxFontData& GetFontData() { return m_fontData; }
45
46 // deprecated interface, for compatibility only, don't use
47 wxFontDialogBase(wxWindow *parent, const wxFontData *data)
3fde374f 48 { m_parent = parent; InitFontData(data); }
dbc65e27
VZ
49
50 bool Create(wxWindow *parent, const wxFontData *data)
3fde374f 51 { InitFontData(data); return Create(parent); }
dbc65e27
VZ
52
53protected:
54 virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return TRUE; }
55
3fde374f
VZ
56 void InitFontData(const wxFontData *data = NULL)
57 { if ( data ) m_fontData = *data; }
58
dbc65e27
VZ
59 wxFontData m_fontData;
60};
61
62// ----------------------------------------------------------------------------
63// platform-specific wxFontDialog implementation
64// ----------------------------------------------------------------------------
65
4234ea8b 66#if defined(__WXUNIVERSAL__) || defined(__WXMOTIF__) || defined(__WXMAC__)
dbc65e27
VZ
67 #include "wx/generic/fontdlgg.h"
68 #define wxFontDialog wxGenericFontDialog
69 #define sm_classwxFontDialog sm_classwxGenericFontDialog
4234ea8b 70#elif defined(__WXMSW__)
dbc65e27 71 #include "wx/msw/fontdlg.h"
2049ba38 72#elif defined(__WXGTK__)
dbc65e27 73 #include "wx/gtk/fontdlg.h"
1777b9bb 74#elif defined(__WXPM__)
dbc65e27 75 #include "wx/os2/fontdlg.h"
c801d85f
KB
76#endif
77
dbc65e27
VZ
78// ----------------------------------------------------------------------------
79// global public functions
80// ----------------------------------------------------------------------------
81
65d877d2
VZ
82// get the font from user and return it, returns wxNullFont if the dialog was
83// cancelled
bf31fa26
VZ
84wxFont WXDLLEXPORT
85wxGetFontFromUser(wxWindow *parent = (wxWindow *)NULL,
86 const wxFont& fontInit = wxNullFont);
87
1e6feb95
VZ
88#endif // wxUSE_FONTDLG
89
c801d85f 90#endif
34138703 91 // _WX_FONTDLG_H_BASE_