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