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
= SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE
);
60 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
);
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 wxTextAttrEx
* GetAttributes();
78 /// Update for symbol-related controls
79 void OnSymbolUpdate( wxUpdateUIEvent
& event
);
81 /// Update for number-related controls
82 void OnNumberUpdate( wxUpdateUIEvent
& event
);
84 ////@begin wxRichTextBulletsPage event handler declarations
86 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
87 void OnStylelistboxSelected( wxCommandEvent
& event
);
89 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
90 void OnSymbolstaticUpdate( wxUpdateUIEvent
& event
);
92 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
93 void OnSymbolctrlSelected( wxCommandEvent
& event
);
95 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
96 void OnSymbolctrlUpdated( wxCommandEvent
& event
);
98 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
99 void OnSymbolctrlUpdate( wxUpdateUIEvent
& event
);
101 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
102 void OnChooseSymbolClick( wxCommandEvent
& event
);
104 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
105 void OnChooseSymbolUpdate( wxUpdateUIEvent
& event
);
107 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
108 void OnSymbolfontctrlSelected( wxCommandEvent
& event
);
110 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
111 void OnSymbolfontctrlUpdated( wxCommandEvent
& event
);
113 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
114 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
);
116 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
117 void OnNumberstaticUpdate( wxUpdateUIEvent
& event
);
119 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
120 void OnNumberctrlUpdated( wxSpinEvent
& event
);
122 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
123 void OnNumberctrlUp( wxSpinEvent
& event
);
125 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
126 void OnNumberctrlDown( wxSpinEvent
& event
);
128 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
129 void OnNumberctrlTextUpdated( wxCommandEvent
& event
);
131 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
132 void OnNumberctrlUpdate( wxUpdateUIEvent
& event
);
134 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
135 void OnParenthesesctrlClick( wxCommandEvent
& event
);
137 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
138 void OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
);
140 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
141 void OnPeriodctrlClick( wxCommandEvent
& event
);
143 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
144 void OnPeriodctrlUpdate( wxUpdateUIEvent
& event
);
146 ////@end wxRichTextBulletsPage event handler declarations
148 ////@begin wxRichTextBulletsPage member function declarations
150 /// Retrieves bitmap resources
151 wxBitmap
GetBitmapResource( const wxString
& name
);
153 /// Retrieves icon resources
154 wxIcon
GetIconResource( const wxString
& name
);
155 ////@end wxRichTextBulletsPage member function declarations
157 /// Should we show tooltips?
158 static bool ShowToolTips();
160 ////@begin wxRichTextBulletsPage member variables
161 wxListBox
* m_styleListBox
;
162 wxComboBox
* m_symbolCtrl
;
163 wxComboBox
* m_symbolFontCtrl
;
164 wxSpinCtrl
* m_numberCtrl
;
165 wxCheckBox
* m_parenthesesCtrl
;
166 wxCheckBox
* m_periodCtrl
;
167 wxRichTextCtrl
* m_previewCtrl
;
168 /// Control identifiers
170 ID_RICHTEXTBULLETSPAGE
= 10300,
171 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
= 10305,
172 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
= 10301,
173 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
= 10307,
174 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
= 10308,
175 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
= 10309,
176 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
= 10302,
177 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
= 10310,
178 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
= 10311,
179 ID_RICHTEXTBULLETSPAGE_PERIODCTRL
= 10313,
180 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
= 10314
182 ////@end wxRichTextBulletsPage member variables
184 bool m_hasBulletStyle
;
185 bool m_hasBulletNumber
;
186 bool m_hasBulletSymbol
;
191 // _RICHTEXTBULLETSPAGE_H_