1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextliststylepage.h
4 // Author: Julian Smart
6 // Created: 10/18/2006 11:36:37 AM
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _RICHTEXTLISTSTYLEPAGE_H_
13 #define _RICHTEXTLISTSTYLEPAGE_H_
19 #include "wx/richtext/richtextdialogpage.h"
22 #include "wx/spinctrl.h"
23 #include "wx/notebook.h"
24 #include "wx/statline.h"
31 ////@begin control identifiers
32 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
33 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE wxEmptyString
34 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_IDNAME ID_RICHTEXTLISTSTYLEPAGE
35 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE wxSize(400, 300)
36 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION wxDefaultPosition
37 ////@end control identifiers
40 * wxRichTextListStylePage class declaration
43 class WXDLLIMPEXP_RICHTEXT wxRichTextListStylePage
: public wxRichTextDialogPage
45 DECLARE_DYNAMIC_CLASS( wxRichTextListStylePage
)
47 DECLARE_HELP_PROVISION()
51 wxRichTextListStylePage( );
52 wxRichTextListStylePage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE
);
55 bool Create( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE
);
57 /// Initialises member variables
60 /// Creates the controls and sizers
61 void CreateControls();
63 /// Updates the bullets preview
66 /// Transfer data from/to window
67 virtual bool TransferDataFromWindow();
68 virtual bool TransferDataToWindow();
70 /// Get attributes for selected level
71 wxRichTextAttr
* GetAttributesForSelection();
73 /// Update for symbol-related controls
74 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
76 /// Update for number-related controls
77 void OnNumberUpdate( wxUpdateUIEvent
& event
);
79 /// Update for standard bullet-related controls
80 void OnStandardBulletUpdate( wxUpdateUIEvent
& event
);
82 /// Just transfer to the window
83 void DoTransferDataToWindow();
85 /// Transfer from the window and preview
86 void TransferAndPreview();
88 ////@begin wxRichTextListStylePage event handler declarations
90 /// wxEVT_SPINCTRL event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
91 void OnLevelUpdated( wxSpinEvent
& event
);
93 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
94 void OnLevelUp( wxSpinEvent
& event
);
96 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
97 void OnLevelDown( wxSpinEvent
& event
);
99 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
100 void OnLevelTextUpdated( wxCommandEvent
& event
);
102 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
103 void OnLevelUIUpdate( wxUpdateUIEvent
& event
);
105 /// wxEVT_BUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
106 void OnChooseFontClick( wxCommandEvent
& event
);
108 /// wxEVT_LISTBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
109 void OnStylelistboxSelected( wxCommandEvent
& event
);
111 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
112 void OnPeriodctrlClick( wxCommandEvent
& event
);
114 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
115 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
117 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
118 void OnParenthesesctrlClick( wxCommandEvent
& event
);
120 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
121 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
123 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
124 void OnRightParenthesisCtrlClick( wxCommandEvent
& event
);
126 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
127 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent
& event
);
129 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL
130 void OnBulletAlignmentCtrlSelected( wxCommandEvent
& event
);
132 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
133 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
135 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
136 void OnSymbolctrlSelected( wxCommandEvent
& event
);
138 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
139 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
141 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
142 void OnSymbolctrlUIUpdate( wxUpdateUIEvent
& event
);
144 /// wxEVT_BUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL
145 void OnChooseSymbolClick( wxCommandEvent
& event
);
147 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL
148 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
150 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
151 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
153 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
154 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
156 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
157 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
159 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
160 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
162 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
163 void OnNamectrlSelected( wxCommandEvent
& event
);
165 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
166 void OnNamectrlUpdated( wxCommandEvent
& event
);
168 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
169 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
171 /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
172 void OnRichtextliststylepageAlignleftSelected( wxCommandEvent
& event
);
174 /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
175 void OnRichtextliststylepageAlignrightSelected( wxCommandEvent
& event
);
177 /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
178 void OnRichtextliststylepageJustifiedSelected( wxCommandEvent
& event
);
180 /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED
181 void OnRichtextliststylepageCenteredSelected( wxCommandEvent
& event
);
183 /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
184 void OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent
& event
);
186 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
187 void OnIndentLeftUpdated( wxCommandEvent
& event
);
189 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
190 void OnIndentFirstLineUpdated( wxCommandEvent
& event
);
192 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
193 void OnIndentRightUpdated( wxCommandEvent
& event
);
195 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
196 void OnSpacingBeforeUpdated( wxCommandEvent
& event
);
198 /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
199 void OnSpacingAfterUpdated( wxCommandEvent
& event
);
201 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
202 void OnLineSpacingSelected( wxCommandEvent
& event
);
204 ////@end wxRichTextListStylePage event handler declarations
206 ////@begin wxRichTextListStylePage member function declarations
208 /// Retrieves bitmap resources
209 wxBitmap
GetBitmapResource( const wxString
& name
);
211 /// Retrieves icon resources
212 wxIcon
GetIconResource( const wxString
& name
);
213 ////@end wxRichTextListStylePage member function declarations
215 /// Should we show tooltips?
216 static bool ShowToolTips();
218 ////@begin wxRichTextListStylePage member variables
219 wxSpinCtrl
* m_levelCtrl
;
220 wxListBox
* m_styleListBox
;
221 wxCheckBox
* m_periodCtrl
;
222 wxCheckBox
* m_parenthesesCtrl
;
223 wxCheckBox
* m_rightParenthesisCtrl
;
224 wxComboBox
* m_bulletAlignmentCtrl
;
225 wxComboBox
* m_symbolCtrl
;
226 wxComboBox
* m_symbolFontCtrl
;
227 wxComboBox
* m_bulletNameCtrl
;
228 wxRadioButton
* m_alignmentLeft
;
229 wxRadioButton
* m_alignmentRight
;
230 wxRadioButton
* m_alignmentJustified
;
231 wxRadioButton
* m_alignmentCentred
;
232 wxRadioButton
* m_alignmentIndeterminate
;
233 wxTextCtrl
* m_indentLeft
;
234 wxTextCtrl
* m_indentLeftFirst
;
235 wxTextCtrl
* m_indentRight
;
236 wxTextCtrl
* m_spacingBefore
;
237 wxTextCtrl
* m_spacingAfter
;
238 wxComboBox
* m_spacingLine
;
239 wxRichTextCtrl
* m_previewCtrl
;
240 /// Control identifiers
242 ID_RICHTEXTLISTSTYLEPAGE
= 10616,
243 ID_RICHTEXTLISTSTYLEPAGE_LEVEL
= 10617,
244 ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
= 10604,
245 ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK
= 10618,
246 ID_RICHTEXTLISTSTYLEPAGE_BULLETS
= 10619,
247 ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
= 10620,
248 ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
= 10627,
249 ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
= 10626,
250 ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
= 10602,
251 ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL
= 10603,
252 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
= 10621,
253 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
= 10622,
254 ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL
= 10623,
255 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
= 10625,
256 ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
= 10600,
257 ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
= 10601,
258 ID_RICHTEXTLISTSTYLEPAGE_SPACING
= 10628,
259 ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
= 10629,
260 ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
= 10630,
261 ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
= 10631,
262 ID_RICHTEXTLISTSTYLEPAGE_CENTERED
= 10632,
263 ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
= 10633,
264 ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
= 10634,
265 ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
= 10635,
266 ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
= 10636,
267 ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
= 10637,
268 ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
= 10638,
269 ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
= 10639,
270 ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL
= 10640
272 ////@end wxRichTextListStylePage member variables
279 // _RICHTEXTLISTSTYLEPAGE_H_