]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: richtext/richtextstyledlg.h | |
21b447dc | 3 | // Purpose: interface of wxRichTextStyleOrganiserDialog |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxRichTextStyleOrganiserDialog | |
11 | @headerfile richtextstyledlg.h wx/richtext/richtextstyledlg.h | |
7c913512 | 12 | |
23324ae1 FM |
13 | This class shows a style sheet and allows the user to edit, add and remove |
14 | styles. | |
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 | |
17 | present styles. | |
7c913512 | 18 | |
23324ae1 | 19 | @library{wxrichtext} |
21b447dc | 20 | @category{richtext} |
23324ae1 FM |
21 | */ |
22 | class wxRichTextStyleOrganiserDialog : public wxDialog | |
23 | { | |
24 | public: | |
25 | //@{ | |
26 | /** | |
27 | Constructors. | |
4cc4bfaf | 28 | To create a dialog, pass a bitlist of @a flags (see below), a style sheet, a |
23324ae1 | 29 | text control to apply a selected style to (or @NULL), followed by the usual window parameters. |
23324ae1 FM |
30 | To specify the operations available to the user, pass a combination of these |
31 | values to @e flags: | |
32 | ||
23324ae1 FM |
33 | @b wxRICHTEXT_ORGANISER_DELETE_STYLES |
34 | ||
23324ae1 FM |
35 | Provides a button for deleting styles. |
36 | ||
37 | @b wxRICHTEXT_ORGANISER_CREATE_STYLES | |
38 | ||
23324ae1 FM |
39 | Provides buttons for creating styles. |
40 | ||
41 | @b wxRICHTEXT_ORGANISER_APPLY_STYLES | |
42 | ||
23324ae1 FM |
43 | Provides a button for applying the currently selected style to the selection. |
44 | ||
45 | @b wxRICHTEXT_ORGANISER_EDIT_STYLES | |
46 | ||
23324ae1 FM |
47 | Provides a button for editing styles. |
48 | ||
49 | @b wxRICHTEXT_ORGANISER_RENAME_STYLES | |
50 | ||
23324ae1 FM |
51 | Provides a button for renaming styles. |
52 | ||
53 | @b wxRICHTEXT_ORGANISER_OK_CANCEL | |
54 | ||
23324ae1 FM |
55 | Provides OK and Cancel buttons. |
56 | ||
57 | @b wxRICHTEXT_ORGANISER_RENUMBER | |
58 | ||
23324ae1 FM |
59 | Provides a checkbox for specifying that the selection should be renumbered. |
60 | ||
61 | The following flags determine what will be displayed in the style list: | |
62 | ||
23324ae1 FM |
63 | @b wxRICHTEXT_ORGANISER_SHOW_CHARACTER |
64 | ||
23324ae1 FM |
65 | Displays character styles only. |
66 | ||
67 | @b wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH | |
68 | ||
23324ae1 FM |
69 | Displays paragraph styles only. |
70 | ||
71 | @b wxRICHTEXT_ORGANISER_SHOW_LIST | |
72 | ||
23324ae1 FM |
73 | Displays list styles only. |
74 | ||
75 | @b wxRICHTEXT_ORGANISER_SHOW_ALL | |
76 | ||
23324ae1 FM |
77 | Displays all styles. |
78 | ||
79 | The following symbols define commonly-used combinations of flags: | |
80 | ||
23324ae1 FM |
81 | @b wxRICHTEXT_ORGANISER_ORGANISE |
82 | ||
23324ae1 FM |
83 | Enable all style editing operations so the dialog behaves as a style organiser. |
84 | ||
85 | @b wxRICHTEXT_ORGANISER_BROWSE | |
86 | ||
23324ae1 FM |
87 | Show a list of all styles and their previews, but only allow application of a |
88 | style or | |
89 | cancellation of the dialog. This makes the dialog behave as a style browser. | |
90 | ||
91 | @b wxRICHTEXT_ORGANISER_BROWSE_NUMBERING | |
92 | ||
23324ae1 FM |
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. | |
95 | */ | |
96 | wxRichTextStyleOrganiserDialog(int flags, | |
97 | wxRichTextStyleSheet* sheet, | |
98 | wxRichTextCtrl* ctrl, | |
99 | wxWindow* parent, | |
100 | wxWindowID id = wxID_ANY); | |
7c913512 FM |
101 | const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX) |
102 | wxRichTextStyleOrganiserDialog(); | |
23324ae1 FM |
103 | //@} |
104 | ||
105 | /** | |
106 | Applies the selected style to selection in the given control or the control | |
107 | passed to the constructor. | |
108 | */ | |
4cc4bfaf | 109 | bool ApplyStyle(wxRichTextCtrl* ctrl = NULL); |
23324ae1 FM |
110 | |
111 | /** | |
328f5751 FM |
112 | , wxPoint&@e pos = wxDefaultPosition, wxSize&@e size = wxDefaultSize, @b |
113 | long@e style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX) | |
23324ae1 FM |
114 | Creates the dialog. See |
115 | */ | |
116 | bool Create(int flags, wxRichTextStyleSheet* sheet, | |
117 | wxRichTextCtrl* ctrl, | |
118 | wxWindow* parent, | |
328f5751 | 119 | wxWindowID id = wxID_ANY) const; |
23324ae1 FM |
120 | |
121 | /** | |
122 | Returns @true if the user has opted to restart numbering. | |
123 | */ | |
328f5751 | 124 | bool GetRestartNumbering() const; |
23324ae1 FM |
125 | |
126 | /** | |
127 | Returns the associated rich text control (if any). | |
128 | */ | |
328f5751 | 129 | wxRichTextCtrl* GetRichTextCtrl() const; |
23324ae1 FM |
130 | |
131 | /** | |
132 | Returns selected style name. | |
133 | */ | |
328f5751 | 134 | wxString GetSelectedStyle() const; |
23324ae1 FM |
135 | |
136 | /** | |
137 | Returns selected style definition. | |
138 | */ | |
328f5751 | 139 | wxRichTextStyleDefinition* GetSelectedStyleDefinition() const; |
23324ae1 FM |
140 | |
141 | /** | |
142 | Returns the associated style sheet. | |
143 | */ | |
328f5751 | 144 | wxRichTextStyleSheet* GetStyleSheet() const; |
23324ae1 FM |
145 | |
146 | /** | |
147 | Sets the flags used to control the interface presented to the user. | |
148 | */ | |
149 | void SetFlags(int flags); | |
150 | ||
151 | /** | |
152 | Checks or unchecks the restart numbering checkbox. | |
153 | */ | |
154 | void SetRestartNumbering(bool restartNumbering); | |
155 | ||
156 | /** | |
157 | Sets the control to be associated with the dialog, for the purposes of applying | |
158 | a style to the selection. | |
159 | */ | |
160 | void SetRichTextCtrl(wxRichTextCtrl* ctrl); | |
161 | ||
162 | /** | |
163 | Determines whether tooltips will be shown. | |
164 | */ | |
165 | void SetShowToolTips(bool show); | |
166 | ||
167 | /** | |
168 | Sets the associated style sheet. | |
169 | */ | |
170 | void SetStyleSheet(wxRichTextStyleSheet* sheet); | |
171 | ||
172 | /** | |
173 | Returns the flags used to control the interface presented to the user. | |
174 | */ | |
328f5751 | 175 | int GetFlags() const; |
23324ae1 | 176 | }; |
e54c96f1 | 177 |