1 /////////////////////////////////////////////////////////////////////////////
2 // Name: richtextbulletspage.h
4 // Author: Julian Smart
6 // Created: 10/4/2006 10:32:31 AM
8 // Copyright: (c) Julian Smart
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
50 #define wxCLOSE_BOX 0x1000
54 * wxRichTextBulletsPage class declaration
57 class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage
: public wxPanel
59 DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage
)
64 wxRichTextBulletsPage( );
65 wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
= SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
68 bool Create( wxWindow
* parent
, wxWindowID id
= SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
70 /// Initialise members
73 /// Creates the controls and sizers
74 void CreateControls();
76 /// Updates the bullets preview
79 /// Transfer data from/to window
80 virtual bool TransferDataFromWindow();
81 virtual bool TransferDataToWindow();
83 /// Gets the attributes associated with the main formatting dialog
84 wxTextAttrEx
* GetAttributes();
86 /// Update for symbol-related controls
87 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
89 /// Update for number-related controls
90 void OnNumberUpdate( wxUpdateUIEvent
& event
);
92 ////@begin wxRichTextBulletsPage event handler declarations
94 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
95 void OnStylelistboxSelected( wxCommandEvent
& event
);
97 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
98 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
100 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
101 void OnSymbolctrlSelected( wxCommandEvent
& event
);
103 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
104 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
106 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
107 void OnSymbolctrlUpdate( wxUpdateUIEvent
& event
);
109 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
110 void OnChooseSymbolClick( wxCommandEvent
& event
);
112 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
113 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
115 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
116 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
118 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
119 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
121 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
122 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
124 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
125 void OnNumberstaticUpdate( wxUpdateUIEvent
& event
);
127 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
128 void OnNumberctrlUpdated( wxSpinEvent
& event
);
130 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
131 void OnNumberctrlUp( wxSpinEvent
& event
);
133 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
134 void OnNumberctrlDown( wxSpinEvent
& event
);
136 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
137 void OnNumberctrlTextUpdated( wxCommandEvent
& event
);
139 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
140 void OnNumberctrlUpdate( wxUpdateUIEvent
& event
);
142 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
143 void OnParenthesesctrlClick( wxCommandEvent
& event
);
145 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
146 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
148 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
149 void OnPeriodctrlClick( wxCommandEvent
& event
);
151 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
152 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
154 ////@end wxRichTextBulletsPage event handler declarations
156 ////@begin wxRichTextBulletsPage member function declarations
158 /// Retrieves bitmap resources
159 wxBitmap
GetBitmapResource( const wxString
& name
);
161 /// Retrieves icon resources
162 wxIcon
GetIconResource( const wxString
& name
);
163 ////@end wxRichTextBulletsPage member function declarations
165 /// Should we show tooltips?
166 static bool ShowToolTips();
168 ////@begin wxRichTextBulletsPage member variables
169 wxListBox
* m_styleListBox
;
170 wxComboBox
* m_symbolCtrl
;
171 wxComboBox
* m_symbolFontCtrl
;
172 wxSpinCtrl
* m_numberCtrl
;
173 wxCheckBox
* m_parenthesesCtrl
;
174 wxCheckBox
* m_periodCtrl
;
175 wxRichTextCtrl
* m_previewCtrl
;
176 /// Control identifiers
178 ID_RICHTEXTBULLETSPAGE
= 10300,
179 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
= 10305,
180 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
= 10301,
181 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10307,
182 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10308,
183 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
= 10309,
184 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
= 10302,
185 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
= 10310,
186 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
= 10311,
187 ID_RICHTEXTBULLETSPAGE_PERIODCTRL
= 10313,
188 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
= 10314
190 ////@end wxRichTextBulletsPage member variables
192 bool m_hasBulletStyle
;
193 bool m_hasBulletNumber
;
194 bool m_hasBulletSymbol
;
199 // _RICHTEXTBULLETSPAGE_H_