]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/fontdlg.h
add support for asynchronous execution in wxBase (patch 1906889)
[wxWidgets.git] / include / wx / mac / carbon / fontdlg.h
CommitLineData
8cf73271 1/////////////////////////////////////////////////////////////////////////////
1b88201f
WS
2// Name: wx/mac/carbon/fontdlg.h
3// Purpose: wxFontDialog class using fonts window services (10.2+).
72fcdc75 4// Author: Ryan Norton
8cf73271 5// Modified by:
72fcdc75 6// Created: 2004-09-25
8cf73271 7// RCS-ID: $Id$
72fcdc75 8// Copyright: (c) Ryan Norton
65571936 9// Licence: wxWindows licence
8cf73271
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FONTDLG_H_
13#define _WX_FONTDLG_H_
14
8cf73271
SC
15#include "wx/dialog.h"
16#include "wx/cmndata.h"
17
509b4ecc
SC
18/*
19 * Font dialog
20 */
21
22#ifndef wxMAC_USE_EXPERIMENTAL_FONTDIALOG
3a4abf80 23#define wxMAC_USE_EXPERIMENTAL_FONTDIALOG 1
509b4ecc
SC
24#endif
25
26#if wxMAC_USE_EXPERIMENTAL_FONTDIALOG
27
28class WXDLLEXPORT wxFontDialog : public wxDialog
29{
30public:
31 wxFontDialog();
32 wxFontDialog(wxWindow *parent, const wxFontData& data);
d3c7fc99 33 virtual ~wxFontDialog();
509b4ecc
SC
34
35 bool Create(wxWindow *parent, const wxFontData& data);
36
37 int ShowModal();
38 wxFontData& GetFontData() { return m_fontData; }
39
40protected:
41 wxFontData m_fontData;
42
43 DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog)
44};
45
46extern "C" int RunMixedFontDialog(wxFontDialog* dialog) ;
47
48#else // wxMAC_USE_EXPERIMENTAL_FONTDIALOG
49
cfe590ae
JS
50#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
51
52/*!
53 * Forward declarations
54 */
55
56class wxFontColourSwatchCtrl;
57class wxFontPreviewCtrl;
b5dbe15d
VS
58class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
59class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
60class WXDLLIMPEXP_FWD_CORE wxListBox;
61class WXDLLIMPEXP_FWD_CORE wxChoice;
62class WXDLLIMPEXP_FWD_CORE wxButton;
63class WXDLLIMPEXP_FWD_CORE wxStaticText;
64class WXDLLIMPEXP_FWD_CORE wxCheckBox;
cfe590ae
JS
65
66/*!
67 * Control identifiers
68 */
69
70#define wxID_FONTDIALOG_FACENAME 20001
71#define wxID_FONTDIALOG_FONTSIZE 20002
72#define wxID_FONTDIALOG_BOLD 20003
73#define wxID_FONTDIALOG_ITALIC 20004
74#define wxID_FONTDIALOG_UNDERLINED 20005
75#define wxID_FONTDIALOG_COLOUR 20006
76#define wxID_FONTDIALOG_PREVIEW 20007
77
78#endif
79 // !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
80
8cf73271
SC
81class WXDLLEXPORT wxFontDialog: public wxDialog
82{
83DECLARE_DYNAMIC_CLASS(wxFontDialog)
72fcdc75 84
cfe590ae
JS
85#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
86DECLARE_EVENT_TABLE()
87#endif
88
8cf73271
SC
89public:
90 wxFontDialog();
91 wxFontDialog(wxWindow *parent, const wxFontData& data);
d3c7fc99 92 virtual ~wxFontDialog();
8cf73271
SC
93
94 bool Create(wxWindow *parent, const wxFontData& data);
95
96 int ShowModal();
97 wxFontData& GetFontData() { return m_fontData; }
72fcdc75
RN
98 bool IsShown() const;
99 void OnPanelClose();
fbfb8bcc 100 void SetData(const wxFontData& data);
8cf73271 101
cfe590ae
JS
102#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
103
104 /// Creates the controls and sizers
105 void CreateControls();
106
107 /// Initialize font
108 void InitializeFont();
109
110 /// Set controls according to current font
111 void InitializeControls();
112
113 /// Respond to font change
114 void ChangeFont();
115
116 /// Respond to colour change
117 void OnColourChanged(wxCommandEvent& event);
118
119 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for wxID_FONTDIALOG_FACENAME
120 void OnFontdialogFacenameSelected( wxCommandEvent& event );
121
122 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for wxID_FONTDIALOG_FONTSIZE
123 void OnFontdialogFontsizeUpdated( wxSpinEvent& event );
124
125 /// wxEVT_COMMAND_TEXT_UPDATED event handler for wxID_FONTDIALOG_FONTSIZE
126 void OnFontdialogFontsizeTextUpdated( wxCommandEvent& event );
127
128 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for wxID_FONTDIALOG_BOLD
129 void OnFontdialogBoldClick( wxCommandEvent& event );
130
131 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for wxID_FONTDIALOG_ITALIC
132 void OnFontdialogItalicClick( wxCommandEvent& event );
133
134 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for wxID_FONTDIALOG_UNDERLINED
135 void OnFontdialogUnderlinedClick( wxCommandEvent& event );
136
137 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
138 void OnOkClick( wxCommandEvent& event );
139
140 /// Should we show tooltips?
141 static bool ShowToolTips();
142
143 wxListBox* m_facenameCtrl;
144 wxSpinCtrl* m_sizeCtrl;
145 wxCheckBox* m_boldCtrl;
146 wxCheckBox* m_italicCtrl;
147 wxCheckBox* m_underlinedCtrl;
148 wxFontColourSwatchCtrl* m_colourCtrl;
149 wxFontPreviewCtrl* m_previewCtrl;
150
151 wxFont m_dialogFont;
152 bool m_suppressUpdates;
153
154#endif
155 // !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
156
8cf73271
SC
157protected:
158 wxWindow* m_dialogParent;
159 wxFontData m_fontData;
1b88201f 160 void* m_pEventHandlerRef;
8cf73271
SC
161};
162
509b4ecc
SC
163#endif
164
8cf73271
SC
165#endif
166 // _WX_FONTDLG_H_