]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/fontdlgg.h
Fix bug in GetTimeZone where timezone wasn't set.
[wxWidgets.git] / include / wx / generic / fontdlgg.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
c2c59b22 2// Name: wx/generic/fontdlgg.h
c801d85f
KB
3// Purpose: wxGenericFontDialog
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
99d80019 8// Copyright: (c) Julian Smart
ca65c044 9// Licence: wxWindows licence
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
c2c59b22
VZ
12#ifndef _WX_GENERIC_FONTDLGG_H
13#define _WX_GENERIC_FONTDLGG_H
c801d85f 14
b73e73f9 15#include "wx/defs.h"
c801d85f
KB
16#include "wx/gdicmn.h"
17#include "wx/font.h"
18#include "wx/dialog.h"
19#include "wx/cmndata.h"
20
6b775e66
JS
21#ifdef __WXWINCE__
22#define USE_SPINCTRL_FOR_POINT_SIZE 1
23class WXDLLEXPORT wxSpinEvent;
24#else
25#define USE_SPINCTRL_FOR_POINT_SIZE 0
26#endif
27
c801d85f
KB
28/*
29 * FONT DIALOG
30 */
ca65c044 31
c801d85f
KB
32class WXDLLEXPORT wxChoice;
33class WXDLLEXPORT wxText;
34class WXDLLEXPORT wxCheckBox;
53cf79fa 35class WXDLLEXPORT wxFontPreviewer;
c801d85f 36
c2c59b22
VZ
37enum
38{
39 wxID_FONT_UNDERLINE = 3000,
40 wxID_FONT_STYLE,
41 wxID_FONT_WEIGHT,
42 wxID_FONT_FAMILY,
43 wxID_FONT_COLOUR,
44 wxID_FONT_SIZE
45};
c801d85f 46
c2c59b22 47class WXDLLEXPORT wxGenericFontDialog : public wxFontDialogBase
c801d85f 48{
c2c59b22
VZ
49public:
50 wxGenericFontDialog() { Init(); }
51 wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
52 : wxFontDialogBase(parent, data) { Init(); }
53 virtual ~wxGenericFontDialog();
54
55 virtual int ShowModal();
56
ca3e85cf 57#if WXWIN_COMPATIBILITY_2_6
c2c59b22 58 // deprecated, for backwards compatibility only
ca3e85cf
WS
59 wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) );
60#endif // WXWIN_COMPATIBILITY_2_6
c801d85f 61
c2c59b22
VZ
62 // Internal functions
63 void OnCloseWindow(wxCloseEvent& event);
c801d85f 64
c2c59b22
VZ
65 virtual void CreateWidgets();
66 virtual void InitializeFont();
c801d85f 67
c2c59b22 68 void OnChangeFont(wxCommandEvent& event);
c801d85f 69
6b775e66
JS
70#if USE_SPINCTRL_FOR_POINT_SIZE
71 void OnChangeSize(wxSpinEvent& event);
72#endif
73
c2c59b22 74protected:
cececf4d
WS
75
76 virtual bool DoCreate(wxWindow *parent);
77
78private:
79
c2c59b22
VZ
80 // common part of all ctors
81 void Init();
c801d85f 82
cececf4d 83 void DoChangeFont();
c801d85f 84
cececf4d 85 wxFont m_dialogFont;
c2c59b22 86
cececf4d
WS
87 wxChoice *m_familyChoice;
88 wxChoice *m_styleChoice;
89 wxChoice *m_weightChoice;
90 wxChoice *m_colourChoice;
91 wxCheckBox *m_underLineCheckBox;
6b775e66
JS
92
93#if !USE_SPINCTRL_FOR_POINT_SIZE
cececf4d 94 wxChoice *m_pointSizeChoice;
6b775e66 95#endif
c2c59b22
VZ
96
97 wxFontPreviewer *m_previewer;
98 bool m_useEvents;
99
100 // static bool fontDialogCancelled;
101 DECLARE_EVENT_TABLE()
102 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
c801d85f
KB
103};
104
e9c9f9d4
VS
105WXDLLEXPORT const wxChar *wxFontFamilyIntToString(int family);
106WXDLLEXPORT const wxChar *wxFontWeightIntToString(int weight);
107WXDLLEXPORT const wxChar *wxFontStyleIntToString(int style);
108WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family);
109WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight);
110WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style);
c801d85f 111
ca3e85cf
WS
112#if WXWIN_COMPATIBILITY_2_6
113 // deprecated, for backwards compatibility only
114inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
115 :wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); }
116#endif // WXWIN_COMPATIBILITY_2_6
117
c2c59b22 118#endif // _WX_GENERIC_FONTDLGG_H