1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextbulletspage.h
4 // Author: Julian Smart
6 // Created: 10/4/2006 10:32:31 AM
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _RICHTEXTBULLETSPAGE_H_
13 #define _RICHTEXTBULLETSPAGE_H_
19 #include "wx/richtext/richtextdialogpage.h"
20 #include "wx/spinbutt.h" // for wxSpinEvent
23 * Forward declarations
26 ////@begin forward declarations
29 ////@end forward declarations
35 ////@begin control identifiers
36 #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
37 #define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxEmptyString
38 #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
39 #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
40 #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
41 ////@end control identifiers
44 * wxRichTextBulletsPage class declaration
47 class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage
: public wxRichTextDialogPage
49 DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage
)
51 DECLARE_HELP_PROVISION()
55 wxRichTextBulletsPage( );
56 wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
59 bool Create( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
61 /// Initialise members
64 /// Creates the controls and sizers
65 void CreateControls();
67 /// Updates the bullets preview
70 /// Transfer data from/to window
71 virtual bool TransferDataFromWindow();
72 virtual bool TransferDataToWindow();
74 /// Gets the attributes associated with the main formatting dialog
75 wxRichTextAttr
* GetAttributes();
77 /// Update for symbol-related controls
78 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
80 /// Update for number-related controls
81 void OnNumberUpdate( wxUpdateUIEvent
& event
);
83 /// Update for standard bullet-related controls
84 void OnStandardBulletUpdate( wxUpdateUIEvent
& event
);
86 ////@begin wxRichTextBulletsPage event handler declarations
88 /// wxEVT_LISTBOX event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
89 void OnStylelistboxSelected( wxCommandEvent
& event
);
91 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
92 void OnPeriodctrlClick( wxCommandEvent
& event
);
94 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
95 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
97 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
98 void OnParenthesesctrlClick( wxCommandEvent
& event
);
100 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
101 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
103 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
104 void OnRightParenthesisCtrlClick( wxCommandEvent
& event
);
106 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
107 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent
& event
);
109 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
110 void OnBulletAlignmentCtrlSelected( wxCommandEvent
& event
);
112 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
113 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
115 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
116 void OnSymbolctrlSelected( wxCommandEvent
& event
);
118 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
119 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
121 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
122 void OnSymbolctrlUpdate( wxUpdateUIEvent
& event
);
124 /// wxEVT_BUTTON event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
125 void OnChooseSymbolClick( wxCommandEvent
& event
);
127 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
128 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
130 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
131 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
133 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
134 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
136 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
137 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
139 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
140 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
142 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
143 void OnNamectrlSelected( wxCommandEvent
& event
);
145 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
146 void OnNamectrlUpdated( wxCommandEvent
& event
);
148 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
149 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
151 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
152 void OnNumberstaticUpdate( wxUpdateUIEvent
& event
);
154 /// wxEVT_SPINCTRL event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
155 void OnNumberctrlUpdated( wxSpinEvent
& event
);
157 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
158 void OnNumberctrlUp( wxSpinEvent
& event
);
160 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
161 void OnNumberctrlDown( wxSpinEvent
& event
);
163 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
164 void OnNumberctrlTextUpdated( wxCommandEvent
& event
);
166 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
167 void OnNumberctrlUpdate( wxUpdateUIEvent
& event
);
169 ////@end wxRichTextBulletsPage event handler declarations
171 ////@begin wxRichTextBulletsPage member function declarations
173 /// Retrieves bitmap resources
174 wxBitmap
GetBitmapResource( const wxString
& name
);
176 /// Retrieves icon resources
177 wxIcon
GetIconResource( const wxString
& name
);
178 ////@end wxRichTextBulletsPage member function declarations
180 /// Should we show tooltips?
181 static bool ShowToolTips();
183 ////@begin wxRichTextBulletsPage member variables
184 wxListBox
* m_styleListBox
;
185 wxCheckBox
* m_periodCtrl
;
186 wxCheckBox
* m_parenthesesCtrl
;
187 wxCheckBox
* m_rightParenthesisCtrl
;
188 wxComboBox
* m_bulletAlignmentCtrl
;
189 wxComboBox
* m_symbolCtrl
;
190 wxComboBox
* m_symbolFontCtrl
;
191 wxComboBox
* m_bulletNameCtrl
;
192 wxSpinCtrl
* m_numberCtrl
;
193 wxRichTextCtrl
* m_previewCtrl
;
194 /// Control identifiers
196 ID_RICHTEXTBULLETSPAGE
= 10300,
197 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
= 10305,
198 ID_RICHTEXTBULLETSPAGE_PERIODCTRL
= 10313,
199 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
= 10311,
200 ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
= 10306,
201 ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
= 10315,
202 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
= 10301,
203 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10307,
204 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10308,
205 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
= 10309,
206 ID_RICHTEXTBULLETSPAGE_NAMESTATIC
= 10303,
207 ID_RICHTEXTBULLETSPAGE_NAMECTRL
= 10304,
208 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
= 10302,
209 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
= 10310,
210 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
= 10314
212 ////@end wxRichTextBulletsPage member variables
214 bool m_hasBulletStyle
;
215 bool m_hasBulletNumber
;
216 bool m_hasBulletSymbol
;
221 // _RICHTEXTBULLETSPAGE_H_