File: richtextformattingdialog.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (272 lines) | stat: -rw-r--r-- 10,467 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
\section{\class{wxRichTextFormattingDialog}}\label{wxrichtextformattingdialog}

This dialog allows the user to edit a character and/or paragraph style.

In the constructor, specify the pages that will be created. Use GetStyle
to retrieve the common style for a given range, and then use ApplyStyle
to apply the user-selected formatting to a control. For example:

\begin{verbatim}
    wxRichTextRange range;
    if (m_richTextCtrl->HasSelection())
        range = m_richTextCtrl->GetSelectionRange();
    else
        range = wxRichTextRange(0, m_richTextCtrl->GetLastPosition()+1);

    int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;

    wxRichTextFormattingDialog formatDlg(pages, this);
    formatDlg.GetStyle(m_richTextCtrl, range);

    if (formatDlg.ShowModal() == wxID_OK)
    {
        formatDlg.ApplyStyle(m_richTextCtrl, range);
    }
\end{verbatim}
 
\wxheading{Derived from}

\helpref{wxPropertySheetDialog}{wxpropertysheetdialog}

\wxheading{Include files}

<wx/richtext/richtextformatdlg.h>

\wxheading{Data structures}

The following flags passed to the dialog constructor indicate the pages to
be created:

\begin{verbatim}
#define wxRICHTEXT_FORMAT_STYLE_EDITOR      0x0001
#define wxRICHTEXT_FORMAT_FONT              0x0002
#define wxRICHTEXT_FORMAT_TABS              0x0004
#define wxRICHTEXT_FORMAT_BULLETS           0x0008
#define wxRICHTEXT_FORMAT_INDENTS_SPACING   0x0010
\end{verbatim}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxRichTextFormattingDialog::wxRichTextFormattingDialog}\label{wxrichtextformattingdialogwxrichtextformattingdialog}

\func{}{wxRichTextFormattingDialog}{\param{long }{flags}, \param{wxWindow* }{parent}, \param{const wxString\& }{title = \_("Formatting")}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{sz = wxDefaultSize}, \param{long }{style = wxDEFAULT\_DIALOG\_STYLE}}

\func{}{wxRichTextFormattingDialog}{\void}

Constructors.

\wxheading{Parameters}

\docparam{flags}{The pages to show.}

\docparam{parent}{The dialog's parent.}

\docparam{id}{The dialog's identifier.}

\docparam{title}{The dialog's caption.}

\docparam{pos}{The dialog's position.}

\docparam{size}{The dialog's size.}

\docparam{style}{The dialog's window style.}


\membersection{wxRichTextFormattingDialog::\destruct{wxRichTextFormattingDialog}}\label{wxrichtextformattingdialogdtor}

\func{}{\destruct{wxRichTextFormattingDialog}}{\void}

Destructor.

\membersection{wxRichTextFormattingDialog::ApplyStyle}\label{wxrichtextformattingdialogapplystyle}

\func{bool}{ApplyStyle}{\param{wxRichTextCtrl* }{ctrl}, \param{const wxRichTextRange\& }{range}, \param{int }{flags = wxRICHTEXT\_SETSTYLE\_WITH\_UNDO|wxRICHTEXT\_SETSTYLE\_OPTIMIZE}}

Apply attributes to the given range, only changing attributes that need to be changed.

\membersection{wxRichTextFormattingDialog::Create}\label{wxrichtextformattingdialogcreate}

\func{bool}{Create}{\param{long }{flags}, \param{wxWindow* }{parent}, \param{const wxString\& }{title}, \param{wxWindowID }{id}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{sz = wxDefaultSize}, \param{long }{style = wxDEFAULT\_DIALOG\_STYLE}}

Creation: see \helpref{the constructor}{wxrichtextformattingdialog} for details about the parameters.

\membersection{wxRichTextFormattingDialog::GetAttributes}\label{wxrichtextformattingdialoggetattributes}

\constfunc{const wxTextAttrEx\&}{GetAttributes}{\void}

\func{wxTextAttrEx\&}{GetAttributes}{\void}

Gets the attributes being edited.

\membersection{wxRichTextFormattingDialog::GetDialog}\label{wxrichtextformattingdialoggetdialog}

\func{wxRichTextFormattingDialog*}{GetDialog}{\param{wxWindow* }{win}}

Helper for pages to get the top-level dialog.

\membersection{wxRichTextFormattingDialog::GetDialogAttributes}\label{wxrichtextformattingdialoggetdialogattributes}

\func{wxTextAttrEx*}{GetDialogAttributes}{\param{wxWindow* }{win}}

Helper for pages to get the attributes.

\membersection{wxRichTextFormattingDialog::GetDialogStyleDefinition}\label{wxrichtextformattingdialoggetdialogstyledefinition}

\func{wxRichTextStyleDefinition*}{GetDialogStyleDefinition}{\param{wxWindow* }{win}}

Helper for pages to get the style.

\membersection{wxRichTextFormattingDialog::GetFormattingDialogFactory}\label{wxrichtextformattingdialoggetformattingdialogfactory}

\func{wxRichTextFormattingDialogFactory*}{GetFormattingDialogFactory}{\void}

Returns the object to be used to customize the dialog and provide pages.

\membersection{wxRichTextFormattingDialog::GetImageList}\label{wxrichtextformattingdialoggetimagelist}

\constfunc{wxImageList*}{GetImageList}{\void}

Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.

\membersection{wxRichTextFormattingDialog::GetStyle}\label{wxrichtextformattingdialoggetstyle}

\func{bool}{GetStyle}{\param{wxRichTextCtrl* }{ctrl}, \param{const wxRichTextRange\& }{range}}

Gets common attributes from the given range and calls SetAttributes. Attributes that do not have common values in the given range
will be omitted from the style's flags.

\membersection{wxRichTextFormattingDialog::GetStyleDefinition}\label{wxrichtextformattingdialoggetstyledefinition}

\constfunc{wxRichTextStyleDefinition*}{GetStyleDefinition}{\void}

Gets the associated style definition, if any.

\membersection{wxRichTextFormattingDialog::GetStyleSheet}\label{wxrichtextformattingdialoggetstylesheet}

\constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}

Gets the associated style sheet, if any.

\membersection{wxRichTextFormattingDialog::SetAttributes}\label{wxrichtextformattingdialogsetattributes}

\func{void}{SetAttributes}{\param{const wxTextAttrEx\& }{attr}}

Sets the attributes to be edited.

\membersection{wxRichTextFormattingDialog::SetFormattingDialogFactory}\label{wxrichtextformattingdialogsetformattingdialogfactory}

\func{void}{SetFormattingDialogFactory}{\param{wxRichTextFormattingDialogFactory* }{factory}}

Sets the formatting factory object to be used for customization and page creation.
It deletes the existing factory object.

\membersection{wxRichTextFormattingDialog::SetImageList}\label{wxrichtextformattingdialogsetimagelist}

\func{void}{SetImageList}{\param{wxImageList* }{imageList}}

Sets the image list associated with the dialog's property sheet.

\membersection{wxRichTextFormattingDialog::SetStyle}\label{wxrichtextformattingdialogsetstyle}

\func{bool}{SetStyle}{\param{const wxTextAttrEx\& }{style}, \param{bool }{update = true}}

Sets the attributes and optionally updates the display, if {\it update} is \true.

\membersection{wxRichTextFormattingDialog::SetStyleDefinition}\label{wxrichtextformattingdialogsetstyledefinition}

\func{bool}{SetStyleDefinition}{\param{const wxRichTextStyleDefinition\& }{styleDef}, \param{wxRichTextStyleSheet* }{sheet}, \param{bool }{update = true}}

Sets the style definition and optionally update the display, if {\it update} is \true.

\membersection{wxRichTextFormattingDialog::UpdateDisplay}\label{wxrichtextformattingdialogupdatedisplay}

\func{bool}{UpdateDisplay}{\void}

Updates the display.


%
% automatically generated by HelpGen $Revision: 41898 $ from
% richtextformatdlg.h at 10/Oct/06 15:42:06
%


\section{\class{wxRichTextFormattingDialogFactory}}\label{wxrichtextformattingdialogfactory}

This class provides pages for wxRichTextFormattingDialog, and allows other customization of the dialog.
A default instance of this class is provided automatically. If you wish to change the behaviour of the
formatting dialog (for example add or replace a page), you may derive from this class,
override one or more functions, and call the static function wxRichTextFormattingDialog::SetFormattingDialogFactory.
 
\wxheading{Derived from}

\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/richtext/richtextformatdlg.h>

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxRichTextFormattingDialogFactory::wxRichTextFormattingDialogFactory}\label{wxrichtextformattingdialogfactorywxrichtextformattingdialogfactory}

\func{}{wxRichTextFormattingDialogFactory}{\void}

Constructor.

\membersection{wxRichTextFormattingDialogFactory::\destruct{wxRichTextFormattingDialogFactory}}\label{wxrichtextformattingdialogfactorydtor}

\func{}{\destruct{wxRichTextFormattingDialogFactory}}{\void}

Destructor.

\membersection{wxRichTextFormattingDialogFactory::CreateButtons}\label{wxrichtextformattingdialogfactorycreatebuttons}

\func{virtual bool}{CreateButtons}{\param{wxRichTextFormattingDialog* }{dialog}}

Creates the main dialog buttons.

\membersection{wxRichTextFormattingDialogFactory::CreatePage}\label{wxrichtextformattingdialogfactorycreatepage}

\func{virtual wxPanel*}{CreatePage}{\param{int }{page}, \param{wxString\& }{title}, \param{wxRichTextFormattingDialog* }{dialog}}

Creates a page, given a page identifier.

\membersection{wxRichTextFormattingDialogFactory::CreatePages}\label{wxrichtextformattingdialogfactorycreatepages}

\func{virtual bool}{CreatePages}{\param{long }{pages}, \param{wxRichTextFormattingDialog* }{dialog}}

Creates all pages under the dialog's book control, also calling AddPage.

\membersection{wxRichTextFormattingDialogFactory::GetPageId}\label{wxrichtextformattingdialogfactorygetpageid}

\constfunc{virtual int}{GetPageId}{\param{int }{i}}

Enumerate all available page identifiers.

\membersection{wxRichTextFormattingDialogFactory::GetPageIdCount}\label{wxrichtextformattingdialogfactorygetpageidcount}

\constfunc{virtual int}{GetPageIdCount}{\void}

Gets the number of available page identifiers.

\membersection{wxRichTextFormattingDialogFactory::GetPageImage}\label{wxrichtextformattingdialogfactorygetpageimage}

\constfunc{virtual int}{GetPageImage}{\param{int }{id}}

Gets the image index for the given page identifier.

\membersection{wxRichTextFormattingDialogFactory::SetSheetStyle}\label{wxrichtextformattingdialogfactorysetsheetstyle}

\func{virtual bool}{SetSheetStyle}{\param{wxRichTextFormattingDialog* }{dialog}}

Set the property sheet style, called at the start of wxRichTextFormattingDialog::Create.

\membersection{wxRichTextFormattingDialogFactory::ShowHelp}\label{wxrichtextformattingdialogfactoryshowhelp}

\func{virtual bool}{ShowHelp}{\param{int }{page}, \param{wxRichTextFormattingDialog* }{dialog}}

Invokes help for the dialog.