]> git.saurik.com Git - wxWidgets.git/blob - interface/richtext/richtextstyledlg.h
fixed category
[wxWidgets.git] / interface / richtext / richtextstyledlg.h
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 @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{richtext}
21 */
22 class wxRichTextStyleOrganiserDialog : public wxDialog
23 {
24 public:
25 //@{
26 /**
27 Constructors.
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
31 values to @e flags:
32
33 @b wxRICHTEXT_ORGANISER_DELETE_STYLES
34
35 Provides a button for deleting styles.
36
37 @b wxRICHTEXT_ORGANISER_CREATE_STYLES
38
39 Provides buttons for creating styles.
40
41 @b wxRICHTEXT_ORGANISER_APPLY_STYLES
42
43 Provides a button for applying the currently selected style to the selection.
44
45 @b wxRICHTEXT_ORGANISER_EDIT_STYLES
46
47 Provides a button for editing styles.
48
49 @b wxRICHTEXT_ORGANISER_RENAME_STYLES
50
51 Provides a button for renaming styles.
52
53 @b wxRICHTEXT_ORGANISER_OK_CANCEL
54
55 Provides OK and Cancel buttons.
56
57 @b wxRICHTEXT_ORGANISER_RENUMBER
58
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
63 @b wxRICHTEXT_ORGANISER_SHOW_CHARACTER
64
65 Displays character styles only.
66
67 @b wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH
68
69 Displays paragraph styles only.
70
71 @b wxRICHTEXT_ORGANISER_SHOW_LIST
72
73 Displays list styles only.
74
75 @b wxRICHTEXT_ORGANISER_SHOW_ALL
76
77 Displays all styles.
78
79 The following symbols define commonly-used combinations of flags:
80
81 @b wxRICHTEXT_ORGANISER_ORGANISE
82
83 Enable all style editing operations so the dialog behaves as a style organiser.
84
85 @b wxRICHTEXT_ORGANISER_BROWSE
86
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
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);
101 const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX)
102 wxRichTextStyleOrganiserDialog();
103 //@}
104
105 /**
106 Applies the selected style to selection in the given control or the control
107 passed to the constructor.
108 */
109 bool ApplyStyle(wxRichTextCtrl* ctrl = NULL);
110
111 /**
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
115 */
116 bool Create(int flags, wxRichTextStyleSheet* sheet,
117 wxRichTextCtrl* ctrl,
118 wxWindow* parent,
119 wxWindowID id = wxID_ANY) const;
120
121 /**
122 Returns @true if the user has opted to restart numbering.
123 */
124 bool GetRestartNumbering() const;
125
126 /**
127 Returns the associated rich text control (if any).
128 */
129 wxRichTextCtrl* GetRichTextCtrl() const;
130
131 /**
132 Returns selected style name.
133 */
134 wxString GetSelectedStyle() const;
135
136 /**
137 Returns selected style definition.
138 */
139 wxRichTextStyleDefinition* GetSelectedStyleDefinition() const;
140
141 /**
142 Returns the associated style sheet.
143 */
144 wxRichTextStyleSheet* GetStyleSheet() const;
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 */
175 int GetFlags() const;
176 };