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