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
}\\
30 \helpref{wxDialog
}{wxdialog
}\\
31 \helpref{wxTopLevelWindow
}{wxtoplevelwindow
}\\
32 \helpref{wxWindow
}{wxwindow
}\\
33 \helpref{wxEvtHandler
}{wxevthandler
}\\
34 \helpref{wxObject
}{wxobject
}
36 \wxheading{Include files
}
38 <wx/richtext/richtextformatdlg.h>
42 \helpref{wxRichtext
}{librarieslist
}
44 \wxheading{Data structures
}
46 The following flags passed to the dialog constructor indicate the pages to
50 #define wxRICHTEXT_FORMAT_STYLE_EDITOR
0x0001
51 #define wxRICHTEXT_FORMAT_FONT
0x0002
52 #define wxRICHTEXT_FORMAT_TABS
0x0004
53 #define wxRICHTEXT_FORMAT_BULLETS
0x0008
54 #define wxRICHTEXT_FORMAT_INDENTS_SPACING
0x0010
57 \latexignore{\rtfignore{\wxheading{Members
}}}
60 \membersection{wxRichTextFormattingDialog::wxRichTextFormattingDialog
}\label{wxrichtextformattingdialogwxrichtextformattingdialog
}
62 \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}}
64 \func{}{wxRichTextFormattingDialog
}{\void}
68 \wxheading{Parameters
}
70 \docparam{flags
}{The pages to show.
}
72 \docparam{parent
}{The dialog's parent.
}
74 \docparam{id
}{The dialog's identifier.
}
76 \docparam{title
}{The dialog's caption.
}
78 \docparam{pos
}{The dialog's position.
}
80 \docparam{size
}{The dialog's size.
}
82 \docparam{style
}{The dialog's window style.
}
85 \membersection{wxRichTextFormattingDialog::
\destruct{wxRichTextFormattingDialog
}}\label{wxrichtextformattingdialogdtor
}
87 \func{}{\destruct{wxRichTextFormattingDialog
}}{\void}
91 \membersection{wxRichTextFormattingDialog::ApplyStyle
}\label{wxrichtextformattingdialogapplystyle
}
93 \func{bool
}{ApplyStyle
}{\param{wxRichTextCtrl*
}{ctrl
},
\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags = wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO|wxRICHTEXT
\_SETSTYLE\_OPTIMIZE}}
95 Apply attributes to the given range, only changing attributes that need to be changed.
97 \membersection{wxRichTextFormattingDialog::Create
}\label{wxrichtextformattingdialogcreate
}
99 \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}}
101 Creation: see
\helpref{the constructor
}{wxrichtextformattingdialog
} for details about the parameters.
103 \membersection{wxRichTextFormattingDialog::GetAttributes
}\label{wxrichtextformattingdialoggetattributes
}
105 \constfunc{const wxTextAttrEx\&
}{GetAttributes
}{\void}
107 \func{wxTextAttrEx\&
}{GetAttributes
}{\void}
109 Gets the attributes being edited.
111 \membersection{wxRichTextFormattingDialog::GetDialog
}\label{wxrichtextformattingdialoggetdialog
}
113 \func{wxRichTextFormattingDialog*
}{GetDialog
}{\param{wxWindow*
}{win
}}
115 Helper for pages to get the top-level dialog.
117 \membersection{wxRichTextFormattingDialog::GetDialogAttributes
}\label{wxrichtextformattingdialoggetdialogattributes
}
119 \func{wxTextAttrEx*
}{GetDialogAttributes
}{\param{wxWindow*
}{win
}}
121 Helper for pages to get the attributes.
123 \membersection{wxRichTextFormattingDialog::GetDialogStyleDefinition
}\label{wxrichtextformattingdialoggetdialogstyledefinition
}
125 \func{wxRichTextStyleDefinition*
}{GetDialogStyleDefinition
}{\param{wxWindow*
}{win
}}
127 Helper for pages to get the style.
129 \membersection{wxRichTextFormattingDialog::GetFormattingDialogFactory
}\label{wxrichtextformattingdialoggetformattingdialogfactory
}
131 \func{wxRichTextFormattingDialogFactory*
}{GetFormattingDialogFactory
}{\void}
133 Returns the object to be used to customize the dialog and provide pages.
135 \membersection{wxRichTextFormattingDialog::GetImageList
}\label{wxrichtextformattingdialoggetimagelist
}
137 \constfunc{wxImageList*
}{GetImageList
}{\void}
139 Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.
141 \membersection{wxRichTextFormattingDialog::GetStyle
}\label{wxrichtextformattingdialoggetstyle
}
143 \func{bool
}{GetStyle
}{\param{wxRichTextCtrl*
}{ctrl
},
\param{const wxRichTextRange\&
}{range
}}
145 Gets common attributes from the given range and calls SetAttributes. Attributes that do not have common values in the given range
146 will be omitted from the style's flags.
148 \membersection{wxRichTextFormattingDialog::GetStyleDefinition
}\label{wxrichtextformattingdialoggetstyledefinition
}
150 \constfunc{wxRichTextStyleDefinition*
}{GetStyleDefinition
}{\void}
152 Gets the associated style definition, if any.
154 \membersection{wxRichTextFormattingDialog::GetStyleSheet
}\label{wxrichtextformattingdialoggetstylesheet
}
156 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
158 Gets the associated style sheet, if any.
160 \membersection{wxRichTextFormattingDialog::SetAttributes
}\label{wxrichtextformattingdialogsetattributes
}
162 \func{void
}{SetAttributes
}{\param{const wxTextAttrEx\&
}{attr
}}
164 Sets the attributes to be edited.
166 \membersection{wxRichTextFormattingDialog::SetFormattingDialogFactory
}\label{wxrichtextformattingdialogsetformattingdialogfactory
}
168 \func{void
}{SetFormattingDialogFactory
}{\param{wxRichTextFormattingDialogFactory*
}{factory
}}
170 Sets the formatting factory object to be used for customization and page creation.
171 It deletes the existing factory object.
173 \membersection{wxRichTextFormattingDialog::SetImageList
}\label{wxrichtextformattingdialogsetimagelist
}
175 \func{void
}{SetImageList
}{\param{wxImageList*
}{imageList
}}
177 Sets the image list associated with the dialog's property sheet.
179 \membersection{wxRichTextFormattingDialog::SetStyle
}\label{wxrichtextformattingdialogsetstyle
}
181 \func{bool
}{SetStyle
}{\param{const wxTextAttrEx\&
}{style
},
\param{bool
}{update = true
}}
183 Sets the attributes and optionally updates the display, if
{\it update
} is
\true.
185 \membersection{wxRichTextFormattingDialog::SetStyleDefinition
}\label{wxrichtextformattingdialogsetstyledefinition
}
187 \func{bool
}{SetStyleDefinition
}{\param{const wxRichTextStyleDefinition\&
}{styleDef
},
\param{wxRichTextStyleSheet*
}{sheet
},
\param{bool
}{update = true
}}
189 Sets the style definition and optionally update the display, if
{\it update
} is
\true.
191 \membersection{wxRichTextFormattingDialog::UpdateDisplay
}\label{wxrichtextformattingdialogupdatedisplay
}
193 \func{bool
}{UpdateDisplay
}{\void}
199 % automatically generated by HelpGen $Revision$ from
200 % richtextformatdlg.h at 10/Oct/06 15:42:06
204 \section{\class{wxRichTextFormattingDialogFactory
}}\label{wxrichtextformattingdialogfactory
}
206 This class provides pages for wxRichTextFormattingDialog, and allows other customization of the dialog.
207 A default instance of this class is provided automatically. If you wish to change the behaviour of the
208 formatting dialog (for example add or replace a page), you may derive from this class,
209 override one or more functions, and call the static function wxRichTextFormattingDialog::SetFormattingDialogFactory.
211 \wxheading{Derived from
}
213 \helpref{wxObject
}{wxobject
}
215 \wxheading{Include files
}
217 <wx/richtext/richtextformatdlg.h>
221 \helpref{wxRichtext
}{librarieslist
}
223 \latexignore{\rtfignore{\wxheading{Members
}}}
226 \membersection{wxRichTextFormattingDialogFactory::wxRichTextFormattingDialogFactory
}\label{wxrichtextformattingdialogfactorywxrichtextformattingdialogfactory
}
228 \func{}{wxRichTextFormattingDialogFactory
}{\void}
232 \membersection{wxRichTextFormattingDialogFactory::
\destruct{wxRichTextFormattingDialogFactory
}}\label{wxrichtextformattingdialogfactorydtor
}
234 \func{}{\destruct{wxRichTextFormattingDialogFactory
}}{\void}
238 \membersection{wxRichTextFormattingDialogFactory::CreateButtons
}\label{wxrichtextformattingdialogfactorycreatebuttons
}
240 \func{virtual bool
}{CreateButtons
}{\param{wxRichTextFormattingDialog*
}{dialog
}}
242 Creates the main dialog buttons.
244 \membersection{wxRichTextFormattingDialogFactory::CreatePage
}\label{wxrichtextformattingdialogfactorycreatepage
}
246 \func{virtual wxPanel*
}{CreatePage
}{\param{int
}{page
},
\param{wxString\&
}{title
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
248 Creates a page, given a page identifier.
250 \membersection{wxRichTextFormattingDialogFactory::CreatePages
}\label{wxrichtextformattingdialogfactorycreatepages
}
252 \func{virtual bool
}{CreatePages
}{\param{long
}{pages
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
254 Creates all pages under the dialog's book control, also calling AddPage.
256 \membersection{wxRichTextFormattingDialogFactory::GetPageId
}\label{wxrichtextformattingdialogfactorygetpageid
}
258 \constfunc{virtual int
}{GetPageId
}{\param{int
}{i
}}
260 Enumerate all available page identifiers.
262 \membersection{wxRichTextFormattingDialogFactory::GetPageIdCount
}\label{wxrichtextformattingdialogfactorygetpageidcount
}
264 \constfunc{virtual int
}{GetPageIdCount
}{\void}
266 Gets the number of available page identifiers.
268 \membersection{wxRichTextFormattingDialogFactory::GetPageImage
}\label{wxrichtextformattingdialogfactorygetpageimage
}
270 \constfunc{virtual int
}{GetPageImage
}{\param{int
}{id
}}
272 Gets the image index for the given page identifier.
274 \membersection{wxRichTextFormattingDialogFactory::SetSheetStyle
}\label{wxrichtextformattingdialogfactorysetsheetstyle
}
276 \func{virtual bool
}{SetSheetStyle
}{\param{wxRichTextFormattingDialog*
}{dialog
}}
278 Set the property sheet style, called at the start of wxRichTextFormattingDialog::Create.
280 \membersection{wxRichTextFormattingDialogFactory::ShowHelp
}\label{wxrichtextformattingdialogfactoryshowhelp
}
282 \func{virtual bool
}{ShowHelp
}{\param{int
}{page
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
284 Invokes help for the dialog.