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