1 /////////////////////////////////////////////////////////////////////////////
2 // Name: richtext/richtextstyledlg.h
3 // Purpose: interface of wxRichTextStyleOrganiserDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxRichTextStyleOrganiserDialog
11 @headerfile richtextstyledlg.h wx/richtext/richtextstyledlg.h
13 This class shows a style sheet and allows the user to edit, add and remove
15 It can also be used as a style browser, for example if the application is not
16 using a permanent wxRichTextStyleComboCtrl or wxRichTextStyleListCtrl to
22 class wxRichTextStyleOrganiserDialog
: public wxDialog
28 To create a dialog, pass a bitlist of @a flags (see below), a style sheet, a
29 text control to apply a selected style to (or @NULL), followed by the usual window parameters.
30 To specify the operations available to the user, pass a combination of these
33 @b wxRICHTEXT_ORGANISER_DELETE_STYLES
35 Provides a button for deleting styles.
37 @b wxRICHTEXT_ORGANISER_CREATE_STYLES
39 Provides buttons for creating styles.
41 @b wxRICHTEXT_ORGANISER_APPLY_STYLES
43 Provides a button for applying the currently selected style to the selection.
45 @b wxRICHTEXT_ORGANISER_EDIT_STYLES
47 Provides a button for editing styles.
49 @b wxRICHTEXT_ORGANISER_RENAME_STYLES
51 Provides a button for renaming styles.
53 @b wxRICHTEXT_ORGANISER_OK_CANCEL
55 Provides OK and Cancel buttons.
57 @b wxRICHTEXT_ORGANISER_RENUMBER
59 Provides a checkbox for specifying that the selection should be renumbered.
61 The following flags determine what will be displayed in the style list:
63 @b wxRICHTEXT_ORGANISER_SHOW_CHARACTER
65 Displays character styles only.
67 @b wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH
69 Displays paragraph styles only.
71 @b wxRICHTEXT_ORGANISER_SHOW_LIST
73 Displays list styles only.
75 @b wxRICHTEXT_ORGANISER_SHOW_ALL
79 The following symbols define commonly-used combinations of flags:
81 @b wxRICHTEXT_ORGANISER_ORGANISE
83 Enable all style editing operations so the dialog behaves as a style organiser.
85 @b wxRICHTEXT_ORGANISER_BROWSE
87 Show a list of all styles and their previews, but only allow application of a
89 cancellation of the dialog. This makes the dialog behave as a style browser.
91 @b wxRICHTEXT_ORGANISER_BROWSE_NUMBERING
93 Enables only list style browsing, plus a control to specify renumbering. This
94 allows the dialog to be used for applying list styles to the selection.
96 wxRichTextStyleOrganiserDialog(int flags
,
97 wxRichTextStyleSheet
* sheet
,
100 wxWindowID id
= wxID_ANY
);
101 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_DIALOG_STYLE
|wxRESIZE_BORDER
|wxSYSTEM_MENU
|wxCLOSE_BOX
)
102 wxRichTextStyleOrganiserDialog();
106 Applies the selected style to selection in the given control or the control
107 passed to the constructor.
109 bool ApplyStyle(wxRichTextCtrl
* ctrl
= NULL
);
112 , wxPoint&@e pos = wxDefaultPosition, wxSize&@e size = wxDefaultSize, @b
113 long@e style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX)
114 Creates the dialog. See
116 bool Create(int flags
, wxRichTextStyleSheet
* sheet
,
117 wxRichTextCtrl
* ctrl
,
119 wxWindowID id
= wxID_ANY
) const;
122 Returns @true if the user has opted to restart numbering.
124 bool GetRestartNumbering() const;
127 Returns the associated rich text control (if any).
129 wxRichTextCtrl
* GetRichTextCtrl() const;
132 Returns selected style name.
134 wxString
GetSelectedStyle() const;
137 Returns selected style definition.
139 wxRichTextStyleDefinition
* GetSelectedStyleDefinition() const;
142 Returns the associated style sheet.
144 wxRichTextStyleSheet
* GetStyleSheet() const;
147 Sets the flags used to control the interface presented to the user.
149 void SetFlags(int flags
);
152 Checks or unchecks the restart numbering checkbox.
154 void SetRestartNumbering(bool restartNumbering
);
157 Sets the control to be associated with the dialog, for the purposes of applying
158 a style to the selection.
160 void SetRichTextCtrl(wxRichTextCtrl
* ctrl
);
163 Determines whether tooltips will be shown.
165 void SetShowToolTips(bool show
);
168 Sets the associated style sheet.
170 void SetStyleSheet(wxRichTextStyleSheet
* sheet
);
173 Returns the flags used to control the interface presented to the user.
175 int GetFlags() const;