1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextbulletspage.h
4 // Author: Julian Smart
6 // Created: 10/4/2006 10:32:31 AM
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _RICHTEXTBULLETSPAGE_H_
12 #define _RICHTEXTBULLETSPAGE_H_
18 #include "wx/richtext/richtextdialogpage.h"
19 #include "wx/spinbutt.h" // for wxSpinEvent
22 * Forward declarations
25 ////@begin forward declarations
28 ////@end forward declarations
34 ////@begin control identifiers
35 #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
36 #define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxEmptyString
37 #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
38 #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
39 #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
40 ////@end control identifiers
43 * wxRichTextBulletsPage class declaration
46 class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage
: public wxRichTextDialogPage
48 DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage
)
50 DECLARE_HELP_PROVISION()
54 wxRichTextBulletsPage( );
55 wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
58 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
);
60 /// Initialise members
63 /// Creates the controls and sizers
64 void CreateControls();
66 /// Updates the bullets preview
69 /// Transfer data from/to window
70 virtual bool TransferDataFromWindow();
71 virtual bool TransferDataToWindow();
73 /// Gets the attributes associated with the main formatting dialog
74 wxRichTextAttr
* GetAttributes();
76 /// Update for symbol-related controls
77 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
79 /// Update for number-related controls
80 void OnNumberUpdate( wxUpdateUIEvent
& event
);
82 /// Update for standard bullet-related controls
83 void OnStandardBulletUpdate( wxUpdateUIEvent
& event
);
85 ////@begin wxRichTextBulletsPage event handler declarations
87 /// wxEVT_LISTBOX event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
88 void OnStylelistboxSelected( wxCommandEvent
& event
);
90 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
91 void OnPeriodctrlClick( wxCommandEvent
& event
);
93 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
94 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
96 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
97 void OnParenthesesctrlClick( wxCommandEvent
& event
);
99 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
100 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
102 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
103 void OnRightParenthesisCtrlClick( wxCommandEvent
& event
);
105 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
106 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent
& event
);
108 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
109 void OnBulletAlignmentCtrlSelected( wxCommandEvent
& event
);
111 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
112 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
114 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
115 void OnSymbolctrlSelected( wxCommandEvent
& event
);
117 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
118 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
120 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
121 void OnSymbolctrlUpdate( wxUpdateUIEvent
& event
);
123 /// wxEVT_BUTTON event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
124 void OnChooseSymbolClick( wxCommandEvent
& event
);
126 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
127 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
129 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
130 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
132 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
133 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
135 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
136 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
138 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
139 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
141 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
142 void OnNamectrlSelected( wxCommandEvent
& event
);
144 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
145 void OnNamectrlUpdated( wxCommandEvent
& event
);
147 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
148 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
150 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
151 void OnNumberstaticUpdate( wxUpdateUIEvent
& event
);
153 /// wxEVT_SPINCTRL event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
154 void OnNumberctrlUpdated( wxSpinEvent
& event
);
156 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
157 void OnNumberctrlUp( wxSpinEvent
& event
);
159 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
160 void OnNumberctrlDown( wxSpinEvent
& event
);
162 /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
163 void OnNumberctrlTextUpdated( wxCommandEvent
& event
);
165 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
166 void OnNumberctrlUpdate( wxUpdateUIEvent
& event
);
168 ////@end wxRichTextBulletsPage event handler declarations
170 ////@begin wxRichTextBulletsPage member function declarations
172 /// Retrieves bitmap resources
173 wxBitmap
GetBitmapResource( const wxString
& name
);
175 /// Retrieves icon resources
176 wxIcon
GetIconResource( const wxString
& name
);
177 ////@end wxRichTextBulletsPage member function declarations
179 /// Should we show tooltips?
180 static bool ShowToolTips();
182 ////@begin wxRichTextBulletsPage member variables
183 wxListBox
* m_styleListBox
;
184 wxCheckBox
* m_periodCtrl
;
185 wxCheckBox
* m_parenthesesCtrl
;
186 wxCheckBox
* m_rightParenthesisCtrl
;
187 wxComboBox
* m_bulletAlignmentCtrl
;
188 wxComboBox
* m_symbolCtrl
;
189 wxComboBox
* m_symbolFontCtrl
;
190 wxComboBox
* m_bulletNameCtrl
;
191 wxSpinCtrl
* m_numberCtrl
;
192 wxRichTextCtrl
* m_previewCtrl
;
193 /// Control identifiers
195 ID_RICHTEXTBULLETSPAGE
= 10300,
196 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
= 10305,
197 ID_RICHTEXTBULLETSPAGE_PERIODCTRL
= 10313,
198 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
= 10311,
199 ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
= 10306,
200 ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
= 10315,
201 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
= 10301,
202 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10307,
203 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10308,
204 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
= 10309,
205 ID_RICHTEXTBULLETSPAGE_NAMESTATIC
= 10303,
206 ID_RICHTEXTBULLETSPAGE_NAMECTRL
= 10304,
207 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
= 10302,
208 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
= 10310,
209 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
= 10314
211 ////@end wxRichTextBulletsPage member variables
213 bool m_hasBulletStyle
;
214 bool m_hasBulletNumber
;
215 bool m_hasBulletSymbol
;
220 // _RICHTEXTBULLETSPAGE_H_