]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/richtext/richtextbulletspage.h | |
3 | // Purpose: | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 10/4/2006 10:32:31 AM | |
7 | // Copyright: (c) Julian Smart | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _RICHTEXTBULLETSPAGE_H_ | |
12 | #define _RICHTEXTBULLETSPAGE_H_ | |
13 | ||
14 | /*! | |
15 | * Includes | |
16 | */ | |
17 | ||
18 | #include "wx/richtext/richtextdialogpage.h" | |
19 | #include "wx/spinbutt.h" // for wxSpinEvent | |
20 | ||
21 | /*! | |
22 | * Forward declarations | |
23 | */ | |
24 | ||
25 | ////@begin forward declarations | |
26 | class wxSpinCtrl; | |
27 | class wxRichTextCtrl; | |
28 | ////@end forward declarations | |
29 | ||
30 | /*! | |
31 | * Control identifiers | |
32 | */ | |
33 | ||
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 | |
41 | ||
42 | /*! | |
43 | * wxRichTextBulletsPage class declaration | |
44 | */ | |
45 | ||
46 | class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage: public wxRichTextDialogPage | |
47 | { | |
48 | DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage ) | |
49 | DECLARE_EVENT_TABLE() | |
50 | DECLARE_HELP_PROVISION() | |
51 | ||
52 | public: | |
53 | /// Constructors | |
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 ); | |
56 | ||
57 | /// Creation | |
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 ); | |
59 | ||
60 | /// Initialise members | |
61 | void Init(); | |
62 | ||
63 | /// Creates the controls and sizers | |
64 | void CreateControls(); | |
65 | ||
66 | /// Updates the bullets preview | |
67 | void UpdatePreview(); | |
68 | ||
69 | /// Transfer data from/to window | |
70 | virtual bool TransferDataFromWindow(); | |
71 | virtual bool TransferDataToWindow(); | |
72 | ||
73 | /// Gets the attributes associated with the main formatting dialog | |
74 | wxRichTextAttr* GetAttributes(); | |
75 | ||
76 | /// Update for symbol-related controls | |
77 | void OnSymbolUpdate( wxUpdateUIEvent& event ); | |
78 | ||
79 | /// Update for number-related controls | |
80 | void OnNumberUpdate( wxUpdateUIEvent& event ); | |
81 | ||
82 | /// Update for standard bullet-related controls | |
83 | void OnStandardBulletUpdate( wxUpdateUIEvent& event ); | |
84 | ||
85 | ////@begin wxRichTextBulletsPage event handler declarations | |
86 | ||
87 | /// wxEVT_LISTBOX event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX | |
88 | void OnStylelistboxSelected( wxCommandEvent& event ); | |
89 | ||
90 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL | |
91 | void OnPeriodctrlClick( wxCommandEvent& event ); | |
92 | ||
93 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL | |
94 | void OnPeriodctrlUpdate( wxUpdateUIEvent& event ); | |
95 | ||
96 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL | |
97 | void OnParenthesesctrlClick( wxCommandEvent& event ); | |
98 | ||
99 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL | |
100 | void OnParenthesesctrlUpdate( wxUpdateUIEvent& event ); | |
101 | ||
102 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL | |
103 | void OnRightParenthesisCtrlClick( wxCommandEvent& event ); | |
104 | ||
105 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL | |
106 | void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ); | |
107 | ||
108 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL | |
109 | void OnBulletAlignmentCtrlSelected( wxCommandEvent& event ); | |
110 | ||
111 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC | |
112 | void OnSymbolstaticUpdate( wxUpdateUIEvent& event ); | |
113 | ||
114 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL | |
115 | void OnSymbolctrlSelected( wxCommandEvent& event ); | |
116 | ||
117 | /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL | |
118 | void OnSymbolctrlUpdated( wxCommandEvent& event ); | |
119 | ||
120 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL | |
121 | void OnSymbolctrlUpdate( wxUpdateUIEvent& event ); | |
122 | ||
123 | /// wxEVT_BUTTON event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL | |
124 | void OnChooseSymbolClick( wxCommandEvent& event ); | |
125 | ||
126 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL | |
127 | void OnChooseSymbolUpdate( wxUpdateUIEvent& event ); | |
128 | ||
129 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL | |
130 | void OnSymbolfontctrlSelected( wxCommandEvent& event ); | |
131 | ||
132 | /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL | |
133 | void OnSymbolfontctrlUpdated( wxCommandEvent& event ); | |
134 | ||
135 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL | |
136 | void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ); | |
137 | ||
138 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC | |
139 | void OnNamestaticUpdate( wxUpdateUIEvent& event ); | |
140 | ||
141 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL | |
142 | void OnNamectrlSelected( wxCommandEvent& event ); | |
143 | ||
144 | /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL | |
145 | void OnNamectrlUpdated( wxCommandEvent& event ); | |
146 | ||
147 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL | |
148 | void OnNamectrlUIUpdate( wxUpdateUIEvent& event ); | |
149 | ||
150 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC | |
151 | void OnNumberstaticUpdate( wxUpdateUIEvent& event ); | |
152 | ||
153 | /// wxEVT_SPINCTRL event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL | |
154 | void OnNumberctrlUpdated( wxSpinEvent& event ); | |
155 | ||
156 | /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL | |
157 | void OnNumberctrlUp( wxSpinEvent& event ); | |
158 | ||
159 | /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL | |
160 | void OnNumberctrlDown( wxSpinEvent& event ); | |
161 | ||
162 | /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL | |
163 | void OnNumberctrlTextUpdated( wxCommandEvent& event ); | |
164 | ||
165 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL | |
166 | void OnNumberctrlUpdate( wxUpdateUIEvent& event ); | |
167 | ||
168 | ////@end wxRichTextBulletsPage event handler declarations | |
169 | ||
170 | ////@begin wxRichTextBulletsPage member function declarations | |
171 | ||
172 | /// Retrieves bitmap resources | |
173 | wxBitmap GetBitmapResource( const wxString& name ); | |
174 | ||
175 | /// Retrieves icon resources | |
176 | wxIcon GetIconResource( const wxString& name ); | |
177 | ////@end wxRichTextBulletsPage member function declarations | |
178 | ||
179 | /// Should we show tooltips? | |
180 | static bool ShowToolTips(); | |
181 | ||
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 | |
194 | enum { | |
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 | |
210 | }; | |
211 | ////@end wxRichTextBulletsPage member variables | |
212 | ||
213 | bool m_hasBulletStyle; | |
214 | bool m_hasBulletNumber; | |
215 | bool m_hasBulletSymbol; | |
216 | bool m_dontUpdate; | |
217 | }; | |
218 | ||
219 | #endif | |
220 | // _RICHTEXTBULLETSPAGE_H_ |