1 \section{\class{wxRichTextFormattingDialog
}}\label{wxrichtextformattingdialog
}
3 This dialog allows the user to edit a character and/or paragraph style.
5 In the constructor, specify the pages that will be created. Use GetStyle
6 to retrieve the common style for a given range, and then use ApplyStyle
7 to apply the user-selected formatting to a control. For example:
10 wxRichTextRange range;
11 if (m_richTextCtrl->HasSelection())
12 range = m_richTextCtrl->GetSelectionRange();
14 range = wxRichTextRange(
0, m_richTextCtrl->GetLastPosition()+
1);
16 int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;
18 wxRichTextFormattingDialog formatDlg(pages, this);
19 formatDlg.GetStyle(m_richTextCtrl, range);
21 if (formatDlg.ShowModal() == wxID_OK)
23 formatDlg.ApplyStyle(m_richTextCtrl, range);
27 \wxheading{Derived from
}
29 \helpref{wxPropertySheetDialog
}{wxpropertysheetdialog
}
31 \wxheading{Include files
}
33 <wx/richtext/richtextformatdlg.h>
35 \wxheading{Data structures
}
37 The following flags passed to the dialog constructor indicate the pages to
41 #define wxRICHTEXT_FORMAT_STYLE_EDITOR
0x0001
42 #define wxRICHTEXT_FORMAT_FONT
0x0002
43 #define wxRICHTEXT_FORMAT_TABS
0x0004
44 #define wxRICHTEXT_FORMAT_BULLETS
0x0008
45 #define wxRICHTEXT_FORMAT_INDENTS_SPACING
0x0010
48 \latexignore{\rtfignore{\wxheading{Members
}}}
51 \membersection{wxRichTextFormattingDialog::wxRichTextFormattingDialog
}\label{wxrichtextformattingdialogwxrichtextformattingdialog
}
53 \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}}
55 \func{}{wxRichTextFormattingDialog
}{\void}
59 \wxheading{Parameters
}
61 \docparam{flags
}{The pages to show.
}
63 \docparam{parent
}{The dialog's parent.
}
65 \docparam{id
}{The dialog's identifier.
}
67 \docparam{title
}{The dialog's caption.
}
69 \docparam{pos
}{The dialog's position.
}
71 \docparam{size
}{The dialog's size.
}
73 \docparam{style
}{The dialog's window style.
}
76 \membersection{wxRichTextFormattingDialog::
\destruct{wxRichTextFormattingDialog
}}\label{wxrichtextformattingdialogdtor
}
78 \func{}{\destruct{wxRichTextFormattingDialog
}}{\void}
82 \membersection{wxRichTextFormattingDialog::ApplyStyle
}\label{wxrichtextformattingdialogapplystyle
}
84 \func{bool
}{ApplyStyle
}{\param{wxRichTextCtrl*
}{ctrl
},
\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags = wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO|wxRICHTEXT
\_SETSTYLE\_OPTIMIZE}}
86 Apply attributes to the given range, only changing attributes that need to be changed.
88 \membersection{wxRichTextFormattingDialog::Create
}\label{wxrichtextformattingdialogcreate
}
90 \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}}
92 Creation: see
\helpref{the constructor
}{wxrichtextformattingdialog
} for details about the parameters.
94 \membersection{wxRichTextFormattingDialog::GetAttributes
}\label{wxrichtextformattingdialoggetattributes
}
96 \constfunc{const wxTextAttrEx\&
}{GetAttributes
}{\void}
98 \func{wxTextAttrEx\&
}{GetAttributes
}{\void}
100 Gets the attributes being edited.
102 \membersection{wxRichTextFormattingDialog::GetDialog
}\label{wxrichtextformattingdialoggetdialog
}
104 \func{wxRichTextFormattingDialog*
}{GetDialog
}{\param{wxWindow*
}{win
}}
106 Helper for pages to get the top-level dialog.
108 \membersection{wxRichTextFormattingDialog::GetDialogAttributes
}\label{wxrichtextformattingdialoggetdialogattributes
}
110 \func{wxTextAttrEx*
}{GetDialogAttributes
}{\param{wxWindow*
}{win
}}
112 Helper for pages to get the attributes.
114 \membersection{wxRichTextFormattingDialog::GetDialogStyleDefinition
}\label{wxrichtextformattingdialoggetdialogstyledefinition
}
116 \func{wxRichTextStyleDefinition*
}{GetDialogStyleDefinition
}{\param{wxWindow*
}{win
}}
118 Helper for pages to get the style.
120 \membersection{wxRichTextFormattingDialog::GetFormattingDialogFactory
}\label{wxrichtextformattingdialoggetformattingdialogfactory
}
122 \func{wxRichTextFormattingDialogFactory*
}{GetFormattingDialogFactory
}{\void}
124 Returns the object to be used to customize the dialog and provide pages.
126 \membersection{wxRichTextFormattingDialog::GetImageList
}\label{wxrichtextformattingdialoggetimagelist
}
128 \constfunc{wxImageList*
}{GetImageList
}{\void}
130 Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.
132 \membersection{wxRichTextFormattingDialog::GetStyle
}\label{wxrichtextformattingdialoggetstyle
}
134 \func{bool
}{GetStyle
}{\param{wxRichTextCtrl*
}{ctrl
},
\param{const wxRichTextRange\&
}{range
}}
136 Gets common attributes from the given range and calls SetAttributes. Attributes that do not have common values in the given range
137 will be omitted from the style's flags.
139 \membersection{wxRichTextFormattingDialog::GetStyleDefinition
}\label{wxrichtextformattingdialoggetstyledefinition
}
141 \constfunc{wxRichTextStyleDefinition*
}{GetStyleDefinition
}{\void}
143 Gets the associated style definition, if any.
145 \membersection{wxRichTextFormattingDialog::GetStyleSheet
}\label{wxrichtextformattingdialoggetstylesheet
}
147 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
149 Gets the associated style sheet, if any.
151 \membersection{wxRichTextFormattingDialog::SetAttributes
}\label{wxrichtextformattingdialogsetattributes
}
153 \func{void
}{SetAttributes
}{\param{const wxTextAttrEx\&
}{attr
}}
155 Sets the attributes to be edited.
157 \membersection{wxRichTextFormattingDialog::SetFormattingDialogFactory
}\label{wxrichtextformattingdialogsetformattingdialogfactory
}
159 \func{void
}{SetFormattingDialogFactory
}{\param{wxRichTextFormattingDialogFactory*
}{factory
}}
161 Sets the formatting factory object to be used for customization and page creation.
162 It deletes the existing factory object.
164 \membersection{wxRichTextFormattingDialog::SetImageList
}\label{wxrichtextformattingdialogsetimagelist
}
166 \func{void
}{SetImageList
}{\param{wxImageList*
}{imageList
}}
168 Sets the image list associated with the dialog's property sheet.
170 \membersection{wxRichTextFormattingDialog::SetStyle
}\label{wxrichtextformattingdialogsetstyle
}
172 \func{bool
}{SetStyle
}{\param{const wxTextAttrEx\&
}{style
},
\param{bool
}{update = true
}}
174 Sets the attributes and optionally updates the display, if
{\it update
} is
\true.
176 \membersection{wxRichTextFormattingDialog::SetStyleDefinition
}\label{wxrichtextformattingdialogsetstyledefinition
}
178 \func{bool
}{SetStyleDefinition
}{\param{const wxRichTextStyleDefinition\&
}{styleDef
},
\param{wxRichTextStyleSheet*
}{sheet
},
\param{bool
}{update = true
}}
180 Sets the style definition and optionally update the display, if
{\it update
} is
\true.
182 \membersection{wxRichTextFormattingDialog::UpdateDisplay
}\label{wxrichtextformattingdialogupdatedisplay
}
184 \func{bool
}{UpdateDisplay
}{\void}
190 % automatically generated by HelpGen $Revision$ from
191 % richtextformatdlg.h at 10/Oct/06 15:42:06
195 \section{\class{wxRichTextFormattingDialogFactory
}}\label{wxrichtextformattingdialogfactory
}
197 This class provides pages for wxRichTextFormattingDialog, and allows other customization of the dialog.
198 A default instance of this class is provided automatically. If you wish to change the behaviour of the
199 formatting dialog (for example add or replace a page), you may derive from this class,
200 override one or more functions, and call the static function wxRichTextFormattingDialog::SetFormattingDialogFactory.
202 \wxheading{Derived from
}
204 \helpref{wxObject
}{wxobject
}
206 \wxheading{Include files
}
208 <wx/richtext/richtextformatdlg.h>
210 \latexignore{\rtfignore{\wxheading{Members
}}}
213 \membersection{wxRichTextFormattingDialogFactory::wxRichTextFormattingDialogFactory
}\label{wxrichtextformattingdialogfactorywxrichtextformattingdialogfactory
}
215 \func{}{wxRichTextFormattingDialogFactory
}{\void}
219 \membersection{wxRichTextFormattingDialogFactory::
\destruct{wxRichTextFormattingDialogFactory
}}\label{wxrichtextformattingdialogfactorydtor
}
221 \func{}{\destruct{wxRichTextFormattingDialogFactory
}}{\void}
225 \membersection{wxRichTextFormattingDialogFactory::CreateButtons
}\label{wxrichtextformattingdialogfactorycreatebuttons
}
227 \func{virtual bool
}{CreateButtons
}{\param{wxRichTextFormattingDialog*
}{dialog
}}
229 Creates the main dialog buttons.
231 \membersection{wxRichTextFormattingDialogFactory::CreatePage
}\label{wxrichtextformattingdialogfactorycreatepage
}
233 \func{virtual wxPanel*
}{CreatePage
}{\param{int
}{page
},
\param{wxString\&
}{title
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
235 Creates a page, given a page identifier.
237 \membersection{wxRichTextFormattingDialogFactory::CreatePages
}\label{wxrichtextformattingdialogfactorycreatepages
}
239 \func{virtual bool
}{CreatePages
}{\param{long
}{pages
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
241 Creates all pages under the dialog's book control, also calling AddPage.
243 \membersection{wxRichTextFormattingDialogFactory::GetPageId
}\label{wxrichtextformattingdialogfactorygetpageid
}
245 \constfunc{virtual int
}{GetPageId
}{\param{int
}{i
}}
247 Enumerate all available page identifiers.
249 \membersection{wxRichTextFormattingDialogFactory::GetPageIdCount
}\label{wxrichtextformattingdialogfactorygetpageidcount
}
251 \constfunc{virtual int
}{GetPageIdCount
}{\void}
253 Gets the number of available page identifiers.
255 \membersection{wxRichTextFormattingDialogFactory::GetPageImage
}\label{wxrichtextformattingdialogfactorygetpageimage
}
257 \constfunc{virtual int
}{GetPageImage
}{\param{int
}{id
}}
259 Gets the image index for the given page identifier.
261 \membersection{wxRichTextFormattingDialogFactory::SetSheetStyle
}\label{wxrichtextformattingdialogfactorysetsheetstyle
}
263 \func{virtual bool
}{SetSheetStyle
}{\param{wxRichTextFormattingDialog*
}{dialog
}}
265 Set the property sheet style, called at the start of wxRichTextFormattingDialog::Create.
267 \membersection{wxRichTextFormattingDialogFactory::ShowHelp
}\label{wxrichtextformattingdialogfactoryshowhelp
}
269 \func{virtual bool
}{ShowHelp
}{\param{int
}{page
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
271 Invokes help for the dialog.