]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/generic/fontdlgg.h
hacked around wxGTK wxStaticText which doesn't derive from wxStaticTextBase (argh...
[wxWidgets.git] / include / wx / generic / fontdlgg.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/generic/fontdlgg.h
3// Purpose: wxGenericFontDialog
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_GENERIC_FONTDLGG_H
13#define _WX_GENERIC_FONTDLGG_H
14
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16#pragma interface "fontdlgg.h"
17#endif
18
19#include "wx/setup.h"
20#include "wx/gdicmn.h"
21#include "wx/font.h"
22#include "wx/dialog.h"
23#include "wx/cmndata.h"
24
25/*
26 * FONT DIALOG
27 */
28
29class WXDLLEXPORT wxChoice;
30class WXDLLEXPORT wxText;
31class WXDLLEXPORT wxCheckBox;
32class WXDLLEXPORT wxFontPreviewer;
33
34enum
35{
36 wxID_FONT_UNDERLINE = 3000,
37 wxID_FONT_STYLE,
38 wxID_FONT_WEIGHT,
39 wxID_FONT_FAMILY,
40 wxID_FONT_COLOUR,
41 wxID_FONT_SIZE
42};
43
44class WXDLLEXPORT wxGenericFontDialog : public wxFontDialogBase
45{
46public:
47 wxGenericFontDialog() { Init(); }
48 wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
49 : wxFontDialogBase(parent, data) { Init(); }
50 virtual ~wxGenericFontDialog();
51
52 virtual int ShowModal();
53
54 // deprecated, for backwards compatibility only
55 wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
56 : wxFontDialogBase(parent, data) { Init(); }
57
58 // Internal functions
59 void OnCloseWindow(wxCloseEvent& event);
60
61 virtual void CreateWidgets();
62 virtual void InitializeFont();
63
64 void OnChangeFont(wxCommandEvent& event);
65
66protected:
67 // common part of all ctors
68 void Init();
69
70 virtual bool DoCreate(wxWindow *parent);
71
72 wxFont dialogFont;
73
74 wxChoice *familyChoice;
75 wxChoice *styleChoice;
76 wxChoice *weightChoice;
77 wxChoice *colourChoice;
78 wxCheckBox *underLineCheckBox;
79 wxChoice *pointSizeChoice;
80
81 wxFontPreviewer *m_previewer;
82 bool m_useEvents;
83
84 // static bool fontDialogCancelled;
85 DECLARE_EVENT_TABLE()
86 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
87};
88
89WXDLLEXPORT const wxChar *wxFontFamilyIntToString(int family);
90WXDLLEXPORT const wxChar *wxFontWeightIntToString(int weight);
91WXDLLEXPORT const wxChar *wxFontStyleIntToString(int style);
92WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family);
93WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight);
94WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style);
95
96#endif // _WX_GENERIC_FONTDLGG_H
97