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_IDNAME ID_RICHTEXTLISTSTYLEPAGE
32 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE wxSize(400, 300)
33 #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION wxDefaultPosition
34 ////@end control identifiers
37 * wxRichTextListStylePage class declaration
40 class WXDLLIMPEXP_RICHTEXT wxRichTextListStylePage
: public wxPanel
42 DECLARE_DYNAMIC_CLASS( wxRichTextListStylePage
)
47 wxRichTextListStylePage( );
48 wxRichTextListStylePage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE
);
51 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
);
53 /// Initialises member variables
56 /// Creates the controls and sizers
57 void CreateControls();
59 /// Updates the bullets preview
62 /// Transfer data from/to window
63 virtual bool TransferDataFromWindow();
64 virtual bool TransferDataToWindow();
66 /// Get attributes for selected level
67 wxTextAttr
* GetAttributesForSelection();
69 /// Update for symbol-related controls
70 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
72 /// Update for number-related controls
73 void OnNumberUpdate( wxUpdateUIEvent
& event
);
75 /// Update for standard bullet-related controls
76 void OnStandardBulletUpdate( wxUpdateUIEvent
& event
);
78 /// Just transfer to the window
79 void DoTransferDataToWindow();
81 /// Transfer from the window and preview
82 void TransferAndPreview();
84 ////@begin wxRichTextListStylePage event handler declarations
86 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
87 void OnLevelUpdated( wxSpinEvent
& event
);
89 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
90 void OnLevelUp( wxSpinEvent
& event
);
92 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
93 void OnLevelDown( wxSpinEvent
& event
);
95 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
96 void OnLevelTextUpdated( wxCommandEvent
& event
);
98 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
99 void OnLevelUIUpdate( wxUpdateUIEvent
& event
);
101 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
102 void OnChooseFontClick( wxCommandEvent
& event
);
104 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
105 void OnStylelistboxSelected( wxCommandEvent
& event
);
107 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
108 void OnPeriodctrlClick( wxCommandEvent
& event
);
110 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
111 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
113 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
114 void OnParenthesesctrlClick( wxCommandEvent
& event
);
116 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
117 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
119 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
120 void OnRightParenthesisCtrlClick( wxCommandEvent
& event
);
122 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
123 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent
& event
);
125 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL
126 void OnBulletAlignmentCtrlSelected( wxCommandEvent
& event
);
128 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
129 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
131 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
132 void OnSymbolctrlSelected( wxCommandEvent
& event
);
134 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
135 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
137 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
138 void OnSymbolctrlUIUpdate( wxUpdateUIEvent
& event
);
140 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL
141 void OnChooseSymbolClick( wxCommandEvent
& event
);
143 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL
144 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
146 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
147 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
149 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
150 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
152 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
153 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
155 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
156 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
158 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
159 void OnNamectrlSelected( wxCommandEvent
& event
);
161 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
162 void OnNamectrlUpdated( wxCommandEvent
& event
);
164 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
165 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
167 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
168 void OnRichtextliststylepageAlignleftSelected( wxCommandEvent
& event
);
170 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
171 void OnRichtextliststylepageAlignrightSelected( wxCommandEvent
& event
);
173 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
174 void OnRichtextliststylepageJustifiedSelected( wxCommandEvent
& event
);
176 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED
177 void OnRichtextliststylepageCenteredSelected( wxCommandEvent
& event
);
179 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
180 void OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent
& event
);
182 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
183 void OnIndentLeftUpdated( wxCommandEvent
& event
);
185 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
186 void OnIndentFirstLineUpdated( wxCommandEvent
& event
);
188 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
189 void OnIndentRightUpdated( wxCommandEvent
& event
);
191 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
192 void OnSpacingBeforeUpdated( wxCommandEvent
& event
);
194 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
195 void OnSpacingAfterUpdated( wxCommandEvent
& event
);
197 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
198 void OnLineSpacingSelected( wxCommandEvent
& event
);
200 ////@end wxRichTextListStylePage event handler declarations
202 ////@begin wxRichTextListStylePage member function declarations
204 /// Retrieves bitmap resources
205 wxBitmap
GetBitmapResource( const wxString
& name
);
207 /// Retrieves icon resources
208 wxIcon
GetIconResource( const wxString
& name
);
209 ////@end wxRichTextListStylePage member function declarations
211 /// Should we show tooltips?
212 static bool ShowToolTips();
214 ////@begin wxRichTextListStylePage member variables
215 wxSpinCtrl
* m_levelCtrl
;
216 wxListBox
* m_styleListBox
;
217 wxCheckBox
* m_periodCtrl
;
218 wxCheckBox
* m_parenthesesCtrl
;
219 wxCheckBox
* m_rightParenthesisCtrl
;
220 wxComboBox
* m_bulletAlignmentCtrl
;
221 wxComboBox
* m_symbolCtrl
;
222 wxComboBox
* m_symbolFontCtrl
;
223 wxComboBox
* m_bulletNameCtrl
;
224 wxRadioButton
* m_alignmentLeft
;
225 wxRadioButton
* m_alignmentRight
;
226 wxRadioButton
* m_alignmentJustified
;
227 wxRadioButton
* m_alignmentCentred
;
228 wxRadioButton
* m_alignmentIndeterminate
;
229 wxTextCtrl
* m_indentLeft
;
230 wxTextCtrl
* m_indentLeftFirst
;
231 wxTextCtrl
* m_indentRight
;
232 wxTextCtrl
* m_spacingBefore
;
233 wxTextCtrl
* m_spacingAfter
;
234 wxComboBox
* m_spacingLine
;
235 wxRichTextCtrl
* m_previewCtrl
;
236 /// Control identifiers
238 ID_RICHTEXTLISTSTYLEPAGE
= 10616,
239 ID_RICHTEXTLISTSTYLEPAGE_LEVEL
= 10617,
240 ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
= 10604,
241 ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK
= 10618,
242 ID_RICHTEXTLISTSTYLEPAGE_BULLETS
= 10619,
243 ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
= 10620,
244 ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
= 10627,
245 ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
= 10626,
246 ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
= 10602,
247 ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL
= 10603,
248 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
= 10621,
249 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL
= 10622,
250 ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL
= 10623,
251 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
= 10625,
252 ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
= 10600,
253 ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
= 10601,
254 ID_RICHTEXTLISTSTYLEPAGE_SPACING
= 10628,
255 ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
= 10629,
256 ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
= 10630,
257 ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
= 10631,
258 ID_RICHTEXTLISTSTYLEPAGE_CENTERED
= 10632,
259 ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
= 10633,
260 ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
= 10634,
261 ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
= 10635,
262 ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
= 10636,
263 ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
= 10637,
264 ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
= 10638,
265 ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
= 10639,
266 ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL
= 10640
268 ////@end wxRichTextListStylePage member variables
275 // _RICHTEXTLISTSTYLEPAGE_H_