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