1 /////////////////////////////////////////////////////////////////////////////
2 // Name: richtext/richtextstyledlg.h
3 // Purpose: interface of wxRichTextStyleOrganiserDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxRichTextStyleOrganiserDialog
12 This class shows a style sheet and allows the user to edit, add and remove
14 It can also be used as a style browser, for example if the application is not
15 using a permanent wxRichTextStyleComboCtrl or wxRichTextStyleListCtrl to
21 class wxRichTextStyleOrganiserDialog
: public wxDialog
27 To create a dialog, pass a bitlist of @a flags (see below), a style sheet, a
28 text control to apply a selected style to (or @NULL), followed by the usual window parameters.
29 To specify the operations available to the user, pass a combination of these
32 @b wxRICHTEXT_ORGANISER_DELETE_STYLES
34 Provides a button for deleting styles.
36 @b wxRICHTEXT_ORGANISER_CREATE_STYLES
38 Provides buttons for creating styles.
40 @b wxRICHTEXT_ORGANISER_APPLY_STYLES
42 Provides a button for applying the currently selected style to the selection.
44 @b wxRICHTEXT_ORGANISER_EDIT_STYLES
46 Provides a button for editing styles.
48 @b wxRICHTEXT_ORGANISER_RENAME_STYLES
50 Provides a button for renaming styles.
52 @b wxRICHTEXT_ORGANISER_OK_CANCEL
54 Provides OK and Cancel buttons.
56 @b wxRICHTEXT_ORGANISER_RENUMBER
58 Provides a checkbox for specifying that the selection should be renumbered.
60 The following flags determine what will be displayed in the style list:
62 @b wxRICHTEXT_ORGANISER_SHOW_CHARACTER
64 Displays character styles only.
66 @b wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH
68 Displays paragraph styles only.
70 @b wxRICHTEXT_ORGANISER_SHOW_LIST
72 Displays list styles only.
74 @b wxRICHTEXT_ORGANISER_SHOW_ALL
78 The following symbols define commonly-used combinations of flags:
80 @b wxRICHTEXT_ORGANISER_ORGANISE
82 Enable all style editing operations so the dialog behaves as a style organiser.
84 @b wxRICHTEXT_ORGANISER_BROWSE
86 Show a list of all styles and their previews, but only allow application of a
88 cancellation of the dialog. This makes the dialog behave as a style browser.
90 @b wxRICHTEXT_ORGANISER_BROWSE_NUMBERING
92 Enables only list style browsing, plus a control to specify renumbering. This
93 allows the dialog to be used for applying list styles to the selection.
95 wxRichTextStyleOrganiserDialog(int flags
,
96 wxRichTextStyleSheet
* sheet
,
99 wxWindowID id
= wxID_ANY
);
100 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_DIALOG_STYLE
|wxRESIZE_BORDER
|wxSYSTEM_MENU
|wxCLOSE_BOX
)
101 wxRichTextStyleOrganiserDialog();
105 Applies the selected style to selection in the given control or the control
106 passed to the constructor.
108 bool ApplyStyle(wxRichTextCtrl
* ctrl
= NULL
);
111 , wxPoint&@e pos = wxDefaultPosition, wxSize&@e size = wxDefaultSize, @b
112 long@e style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX)
113 Creates the dialog. See
115 bool Create(int flags
, wxRichTextStyleSheet
* sheet
,
116 wxRichTextCtrl
* ctrl
,
118 wxWindowID id
= wxID_ANY
) const;
121 Returns @true if the user has opted to restart numbering.
123 bool GetRestartNumbering() const;
126 Returns the associated rich text control (if any).
128 wxRichTextCtrl
* GetRichTextCtrl() const;
131 Returns selected style name.
133 wxString
GetSelectedStyle() const;
136 Returns selected style definition.
138 wxRichTextStyleDefinition
* GetSelectedStyleDefinition() const;
141 Returns the associated style sheet.
143 wxRichTextStyleSheet
* GetStyleSheet() const;
146 Sets the flags used to control the interface presented to the user.
148 void SetFlags(int flags
);
151 Checks or unchecks the restart numbering checkbox.
153 void SetRestartNumbering(bool restartNumbering
);
156 Sets the control to be associated with the dialog, for the purposes of applying
157 a style to the selection.
159 void SetRichTextCtrl(wxRichTextCtrl
* ctrl
);
162 Determines whether tooltips will be shown.
164 void SetShowToolTips(bool show
);
167 Sets the associated style sheet.
169 void SetStyleSheet(wxRichTextStyleSheet
* sheet
);
172 Returns the flags used to control the interface presented to the user.
174 int GetFlags() const;