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 /// Just transfer to the window
77 void DoTransferDataToWindow();
79 /// Transfer from the window and preview
80 void TransferAndPreview();
82 ////@begin wxRichTextListStylePage event handler declarations
84 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
85 void OnLevelUpdated( wxSpinEvent
& event
);
87 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
88 void OnLevelUp( wxSpinEvent
& event
);
90 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
91 void OnLevelDown( wxSpinEvent
& event
);
93 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
94 void OnLevelTextUpdated( wxCommandEvent
& event
);
96 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
97 void OnLevelUIUpdate( wxUpdateUIEvent
& event
);
99 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
100 void OnChooseFontClick( wxCommandEvent
& event
);
102 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
103 void OnStylelistboxSelected( wxCommandEvent
& event
);
105 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
106 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
108 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
109 void OnSymbolctrlSelected( wxCommandEvent
& event
);
111 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
112 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
114 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
115 void OnSymbolctrlUIUpdate( wxUpdateUIEvent
& event
);
117 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
118 void OnChooseSymbolClick( wxCommandEvent
& event
);
120 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
121 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
123 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
124 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
126 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
127 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
129 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
130 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
132 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
133 void OnParenthesesctrlClick( wxCommandEvent
& event
);
135 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
136 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
138 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
139 void OnPeriodctrlClick( wxCommandEvent
& event
);
141 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
142 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
144 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
145 void OnRichtextliststylepageAlignleftSelected( wxCommandEvent
& event
);
147 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
148 void OnRichtextliststylepageAlignrightSelected( wxCommandEvent
& event
);
150 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
151 void OnRichtextliststylepageJustifiedSelected( wxCommandEvent
& event
);
153 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED
154 void OnRichtextliststylepageCenteredSelected( wxCommandEvent
& event
);
156 /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
157 void OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent
& event
);
159 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
160 void OnIndentLeftUpdated( wxCommandEvent
& event
);
162 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
163 void OnIndentFirstLineUpdated( wxCommandEvent
& event
);
165 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
166 void OnIndentRightUpdated( wxCommandEvent
& event
);
168 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
169 void OnSpacingBeforeUpdated( wxCommandEvent
& event
);
171 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
172 void OnSpacingAfterUpdated( wxCommandEvent
& event
);
174 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
175 void OnLineSpacingSelected( wxCommandEvent
& event
);
177 ////@end wxRichTextListStylePage event handler declarations
179 ////@begin wxRichTextListStylePage member function declarations
181 /// Retrieves bitmap resources
182 wxBitmap
GetBitmapResource( const wxString
& name
);
184 /// Retrieves icon resources
185 wxIcon
GetIconResource( const wxString
& name
);
186 ////@end wxRichTextListStylePage member function declarations
188 /// Should we show tooltips?
189 static bool ShowToolTips();
191 ////@begin wxRichTextListStylePage member variables
192 wxSpinCtrl
* m_levelCtrl
;
193 wxListBox
* m_styleListBox
;
194 wxComboBox
* m_symbolCtrl
;
195 wxComboBox
* m_symbolFontCtrl
;
196 wxCheckBox
* m_parenthesesCtrl
;
197 wxCheckBox
* m_periodCtrl
;
198 wxRadioButton
* m_alignmentLeft
;
199 wxRadioButton
* m_alignmentRight
;
200 wxRadioButton
* m_alignmentJustified
;
201 wxRadioButton
* m_alignmentCentred
;
202 wxRadioButton
* m_alignmentIndeterminate
;
203 wxTextCtrl
* m_indentLeft
;
204 wxTextCtrl
* m_indentLeftFirst
;
205 wxTextCtrl
* m_indentRight
;
206 wxTextCtrl
* m_spacingBefore
;
207 wxTextCtrl
* m_spacingAfter
;
208 wxComboBox
* m_spacingLine
;
209 wxRichTextCtrl
* m_previewCtrl
;
210 /// Control identifiers
212 ID_RICHTEXTLISTSTYLEPAGE
= 10616,
213 ID_RICHTEXTLISTSTYLEPAGE_LEVEL
= 10617,
214 ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
= 10604,
215 ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK
= 10618,
216 ID_RICHTEXTLISTSTYLEPAGE_BULLETS
= 10619,
217 ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
= 10620,
218 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
= 10621,
219 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10622,
220 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10623,
221 ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
= 10625,
222 ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
= 10626,
223 ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
= 10627,
224 ID_RICHTEXTLISTSTYLEPAGE_SPACING
= 10628,
225 ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
= 10629,
226 ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
= 10630,
227 ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
= 10631,
228 ID_RICHTEXTLISTSTYLEPAGE_CENTERED
= 10632,
229 ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
= 10633,
230 ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
= 10634,
231 ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
= 10635,
232 ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
= 10636,
233 ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
= 10637,
234 ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
= 10638,
235 ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
= 10639,
236 ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL
= 10640
238 ////@end wxRichTextListStylePage member variables
245 // _RICHTEXTLISTSTYLEPAGE_H_