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_
20 #include "wx/statline.h"
21 #include "wx/spinctrl.h"
25 * Forward declarations
28 ////@begin forward declarations
31 ////@end forward declarations
37 ////@begin control identifiers
38 #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
39 #define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE _("wxRichTextBulletsPage")
40 #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
41 #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
42 #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
43 ////@end control identifiers
46 * wxRichTextBulletsPage class declaration
49 class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage
: public wxPanel
51 DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage
)
56 wxRichTextBulletsPage( );
57 wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
60 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
);
62 /// Initialise members
65 /// Creates the controls and sizers
66 void CreateControls();
68 /// Updates the bullets preview
71 /// Transfer data from/to window
72 virtual bool TransferDataFromWindow();
73 virtual bool TransferDataToWindow();
75 /// Gets the attributes associated with the main formatting dialog
76 wxTextAttr
* GetAttributes();
78 /// Update for symbol-related controls
79 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
81 /// Update for number-related controls
82 void OnNumberUpdate( wxUpdateUIEvent
& event
);
84 /// Update for standard bullet-related controls
85 void OnStandardBulletUpdate( wxUpdateUIEvent
& event
);
87 ////@begin wxRichTextBulletsPage event handler declarations
89 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
90 void OnStylelistboxSelected( wxCommandEvent
& event
);
92 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
93 void OnPeriodctrlClick( wxCommandEvent
& event
);
95 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
96 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
98 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
99 void OnParenthesesctrlClick( wxCommandEvent
& event
);
101 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
102 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
104 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
105 void OnRightParenthesisCtrlClick( wxCommandEvent
& event
);
107 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
108 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent
& event
);
110 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
111 void OnBulletAlignmentCtrlSelected( wxCommandEvent
& event
);
113 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
114 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
116 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
117 void OnSymbolctrlSelected( wxCommandEvent
& event
);
119 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
120 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
122 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
123 void OnSymbolctrlUpdate( wxUpdateUIEvent
& event
);
125 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
126 void OnChooseSymbolClick( wxCommandEvent
& event
);
128 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
129 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
131 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
132 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
134 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
135 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
137 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
138 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
140 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
141 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
143 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
144 void OnNamectrlSelected( wxCommandEvent
& event
);
146 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
147 void OnNamectrlUpdated( wxCommandEvent
& event
);
149 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
150 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
152 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
153 void OnNumberstaticUpdate( wxUpdateUIEvent
& event
);
155 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
156 void OnNumberctrlUpdated( wxSpinEvent
& event
);
158 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
159 void OnNumberctrlUp( wxSpinEvent
& event
);
161 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
162 void OnNumberctrlDown( wxSpinEvent
& event
);
164 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
165 void OnNumberctrlTextUpdated( wxCommandEvent
& event
);
167 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
168 void OnNumberctrlUpdate( wxUpdateUIEvent
& event
);
170 ////@end wxRichTextBulletsPage event handler declarations
172 ////@begin wxRichTextBulletsPage member function declarations
174 /// Retrieves bitmap resources
175 wxBitmap
GetBitmapResource( const wxString
& name
);
177 /// Retrieves icon resources
178 wxIcon
GetIconResource( const wxString
& name
);
179 ////@end wxRichTextBulletsPage member function declarations
181 /// Should we show tooltips?
182 static bool ShowToolTips();
184 ////@begin wxRichTextBulletsPage member variables
185 wxListBox
* m_styleListBox
;
186 wxCheckBox
* m_periodCtrl
;
187 wxCheckBox
* m_parenthesesCtrl
;
188 wxCheckBox
* m_rightParenthesisCtrl
;
189 wxComboBox
* m_bulletAlignmentCtrl
;
190 wxComboBox
* m_symbolCtrl
;
191 wxComboBox
* m_symbolFontCtrl
;
192 wxComboBox
* m_bulletNameCtrl
;
193 wxSpinCtrl
* m_numberCtrl
;
194 wxRichTextCtrl
* m_previewCtrl
;
195 /// Control identifiers
197 ID_RICHTEXTBULLETSPAGE
= 10300,
198 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
= 10305,
199 ID_RICHTEXTBULLETSPAGE_PERIODCTRL
= 10313,
200 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
= 10311,
201 ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
= 10306,
202 ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
= 10315,
203 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
= 10301,
204 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10307,
205 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10308,
206 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
= 10309,
207 ID_RICHTEXTBULLETSPAGE_NAMESTATIC
= 10303,
208 ID_RICHTEXTBULLETSPAGE_NAMECTRL
= 10304,
209 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
= 10302,
210 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
= 10310,
211 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
= 10314
213 ////@end wxRichTextBulletsPage member variables
215 bool m_hasBulletStyle
;
216 bool m_hasBulletNumber
;
217 bool m_hasBulletSymbol
;
222 // _RICHTEXTBULLETSPAGE_H_