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_
18 #include "wx/spinbutt.h" // for wxSpinEvent
21 * Forward declarations
24 ////@begin forward declarations
27 ////@end forward declarations
33 ////@begin control identifiers
34 #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
35 #define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxT("")
36 #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
37 #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
38 #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
39 ////@end control identifiers
42 * wxRichTextBulletsPage class declaration
45 class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage
: public wxPanel
47 DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage
)
52 wxRichTextBulletsPage( );
53 wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
56 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
);
58 /// Initialise members
61 /// Creates the controls and sizers
62 void CreateControls();
64 /// Updates the bullets preview
67 /// Transfer data from/to window
68 virtual bool TransferDataFromWindow();
69 virtual bool TransferDataToWindow();
71 /// Gets the attributes associated with the main formatting dialog
72 wxRichTextAttr
* GetAttributes();
74 /// Update for symbol-related controls
75 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
77 /// Update for number-related controls
78 void OnNumberUpdate( wxUpdateUIEvent
& event
);
80 /// Update for standard bullet-related controls
81 void OnStandardBulletUpdate( wxUpdateUIEvent
& event
);
83 ////@begin wxRichTextBulletsPage event handler declarations
85 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
86 void OnStylelistboxSelected( wxCommandEvent
& event
);
88 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
89 void OnPeriodctrlClick( wxCommandEvent
& event
);
91 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
92 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
94 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
95 void OnParenthesesctrlClick( wxCommandEvent
& event
);
97 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
98 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
100 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
101 void OnRightParenthesisCtrlClick( wxCommandEvent
& event
);
103 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
104 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent
& event
);
106 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
107 void OnBulletAlignmentCtrlSelected( wxCommandEvent
& event
);
109 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
110 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
112 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
113 void OnSymbolctrlSelected( wxCommandEvent
& event
);
115 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
116 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
118 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
119 void OnSymbolctrlUpdate( wxUpdateUIEvent
& event
);
121 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
122 void OnChooseSymbolClick( wxCommandEvent
& event
);
124 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
125 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
127 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
128 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
130 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
131 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
133 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
134 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
136 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
137 void OnNamestaticUpdate( wxUpdateUIEvent
& event
);
139 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
140 void OnNamectrlSelected( wxCommandEvent
& event
);
142 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
143 void OnNamectrlUpdated( wxCommandEvent
& event
);
145 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
146 void OnNamectrlUIUpdate( wxUpdateUIEvent
& event
);
148 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
149 void OnNumberstaticUpdate( wxUpdateUIEvent
& event
);
151 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
152 void OnNumberctrlUpdated( wxSpinEvent
& event
);
154 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
155 void OnNumberctrlUp( wxSpinEvent
& event
);
157 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
158 void OnNumberctrlDown( wxSpinEvent
& event
);
160 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
161 void OnNumberctrlTextUpdated( wxCommandEvent
& event
);
163 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
164 void OnNumberctrlUpdate( wxUpdateUIEvent
& event
);
166 ////@end wxRichTextBulletsPage event handler declarations
168 ////@begin wxRichTextBulletsPage member function declarations
170 /// Retrieves bitmap resources
171 wxBitmap
GetBitmapResource( const wxString
& name
);
173 /// Retrieves icon resources
174 wxIcon
GetIconResource( const wxString
& name
);
175 ////@end wxRichTextBulletsPage member function declarations
177 /// Should we show tooltips?
178 static bool ShowToolTips();
180 ////@begin wxRichTextBulletsPage member variables
181 wxListBox
* m_styleListBox
;
182 wxCheckBox
* m_periodCtrl
;
183 wxCheckBox
* m_parenthesesCtrl
;
184 wxCheckBox
* m_rightParenthesisCtrl
;
185 wxComboBox
* m_bulletAlignmentCtrl
;
186 wxComboBox
* m_symbolCtrl
;
187 wxComboBox
* m_symbolFontCtrl
;
188 wxComboBox
* m_bulletNameCtrl
;
189 wxSpinCtrl
* m_numberCtrl
;
190 wxRichTextCtrl
* m_previewCtrl
;
191 /// Control identifiers
193 ID_RICHTEXTBULLETSPAGE
= 10300,
194 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
= 10305,
195 ID_RICHTEXTBULLETSPAGE_PERIODCTRL
= 10313,
196 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
= 10311,
197 ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
= 10306,
198 ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
= 10315,
199 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
= 10301,
200 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10307,
201 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10308,
202 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
= 10309,
203 ID_RICHTEXTBULLETSPAGE_NAMESTATIC
= 10303,
204 ID_RICHTEXTBULLETSPAGE_NAMECTRL
= 10304,
205 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
= 10302,
206 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
= 10310,
207 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
= 10314
209 ////@end wxRichTextBulletsPage member variables
211 bool m_hasBulletStyle
;
212 bool m_hasBulletNumber
;
213 bool m_hasBulletSymbol
;
218 // _RICHTEXTBULLETSPAGE_H_