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 wxTextAttrEx
* 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_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
121 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
123 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
124 void OnSymbolctrlSelected( wxCommandEvent
& event
);
126 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
127 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
129 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
130 void OnSymbolctrlUIUpdate( wxUpdateUIEvent
& event
);
132 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
133 void OnChooseSymbolClick( wxCommandEvent
& event
);
135 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
136 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
138 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
139 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
141 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
142 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
144 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
145 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
147 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
148 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
150 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
151 void OnNamectrlSelected( wxCommandEvent
& event
);
153 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
154 void OnNamectrlUpdated( wxCommandEvent
& event
);
156 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
157 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
159 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
160 void OnRichtextliststylepageAlignleftSelected( wxCommandEvent
& event
);
162 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
163 void OnRichtextliststylepageAlignrightSelected( wxCommandEvent
& event
);
165 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
166 void OnRichtextliststylepageJustifiedSelected( wxCommandEvent
& event
);
168 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED
169 void OnRichtextliststylepageCenteredSelected( wxCommandEvent
& event
);
171 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
172 void OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent
& event
);
174 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
175 void OnIndentLeftUpdated( wxCommandEvent
& event
);
177 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
178 void OnIndentFirstLineUpdated( wxCommandEvent
& event
);
180 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
181 void OnIndentRightUpdated( wxCommandEvent
& event
);
183 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
184 void OnSpacingBeforeUpdated( wxCommandEvent
& event
);
186 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
187 void OnSpacingAfterUpdated( wxCommandEvent
& event
);
189 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
190 void OnLineSpacingSelected( wxCommandEvent
& event
);
192 ////@end wxRichTextListStylePage event handler declarations
194 ////@begin wxRichTextListStylePage member function declarations
196 /// Retrieves bitmap resources
197 wxBitmap
GetBitmapResource( const wxString
& name
);
199 /// Retrieves icon resources
200 wxIcon
GetIconResource( const wxString
& name
);
201 ////@end wxRichTextListStylePage member function declarations
203 /// Should we show tooltips?
204 static bool ShowToolTips();
206 ////@begin wxRichTextListStylePage member variables
207 wxSpinCtrl
* m_levelCtrl
;
208 wxListBox
* m_styleListBox
;
209 wxCheckBox
* m_periodCtrl
;
210 wxCheckBox
* m_parenthesesCtrl
;
211 wxComboBox
* m_symbolCtrl
;
212 wxComboBox
* m_symbolFontCtrl
;
213 wxComboBox
* m_bulletNameCtrl
;
214 wxRadioButton
* m_alignmentLeft
;
215 wxRadioButton
* m_alignmentRight
;
216 wxRadioButton
* m_alignmentJustified
;
217 wxRadioButton
* m_alignmentCentred
;
218 wxRadioButton
* m_alignmentIndeterminate
;
219 wxTextCtrl
* m_indentLeft
;
220 wxTextCtrl
* m_indentLeftFirst
;
221 wxTextCtrl
* m_indentRight
;
222 wxTextCtrl
* m_spacingBefore
;
223 wxTextCtrl
* m_spacingAfter
;
224 wxComboBox
* m_spacingLine
;
225 wxRichTextCtrl
* m_previewCtrl
;
226 /// Control identifiers
228 ID_RICHTEXTLISTSTYLEPAGE
= 10616,
229 ID_RICHTEXTLISTSTYLEPAGE_LEVEL
= 10617,
230 ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
= 10604,
231 ID_RICHTEXTLISTSTYLEPAGE_BOOK
= 10618,
232 ID_RICHTEXTLISTSTYLEPAGE_BULLETS
= 10619,
233 ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
= 10620,
234 ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
= 10627,
235 ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
= 10626,
236 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
= 10621,
237 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10622,
238 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10623,
239 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
= 10625,
240 ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
= 10600,
241 ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
= 10601,
242 ID_RICHTEXTLISTSTYLEPAGE_SPACING
= 10628,
243 ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
= 10629,
244 ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
= 10630,
245 ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
= 10631,
246 ID_RICHTEXTLISTSTYLEPAGE_CENTERED
= 10632,
247 ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
= 10633,
248 ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
= 10634,
249 ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
= 10635,
250 ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
= 10636,
251 ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
= 10637,
252 ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
= 10638,
253 ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
= 10639,
254 ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL
= 10640
256 ////@end wxRichTextListStylePage member variables
263 // _RICHTEXTLISTSTYLEPAGE_H_