]>
Commit | Line | Data |
---|---|---|
4a3bdee6 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: proplist.h | |
3 | // Purpose: Property list classes | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
318c5e9f | 9 | // Licence: wxWindows licence |
4a3bdee6 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | /* | |
13 | ||
14 | TO DO: | |
15 | ||
16 | (1) Optional popup-help for each item, and an optional Help button | |
17 | for dialog. | |
18 | ||
19 | (2) Align Ok, Cancel, Help buttons properly. | |
20 | ||
21 | (3) Consider retrieving the rectangle on the panel that can be | |
22 | drawn into (where the value listbox is) and giving an example | |
23 | of editing graphically. May be too fancy. | |
24 | ||
25 | (4) Deriveable types for wxPropertyValue => may need to reorganise | |
26 | wxPropertyValue to use inheritance rather than present all-types-in-one | |
27 | scheme. | |
28 | ||
29 | (5) Optional popup panel for value list, perhaps. | |
30 | ||
31 | (6) Floating point checking routine still crashes with Floating | |
32 | point error for zany input. | |
33 | ||
34 | (7) Property sheet with choice (or listbox) to select alternative | |
35 | sheets... multiple views per panel, only one active. For this | |
36 | we really need a wxChoice that can be dynamically set: XView | |
37 | may be a problem; Motif? | |
38 | ||
39 | (8) More example validators, e.g. colour selector. | |
40 | */ | |
41 | ||
42 | #ifndef _WX_PROPLIST_H_ | |
43 | #define _WX_PROPLIST_H_ | |
44 | ||
4a3bdee6 JS |
45 | #include "wx/deprecated/setup.h" |
46 | ||
47 | #if wxUSE_PROPSHEET | |
48 | ||
49 | #include "wx/deprecated/prop.h" | |
50 | #include "wx/panel.h" | |
51 | ||
52 | #define wxPROP_BUTTON_CLOSE 1 | |
53 | #define wxPROP_BUTTON_OK 2 | |
54 | #define wxPROP_BUTTON_CANCEL 4 | |
55 | #define wxPROP_BUTTON_CHECK_CROSS 8 | |
56 | #define wxPROP_BUTTON_HELP 16 | |
57 | #define wxPROP_DYNAMIC_VALUE_FIELD 32 | |
58 | #define wxPROP_PULLDOWN 64 | |
59 | #define wxPROP_SHOWVALUES 128 | |
60 | ||
61 | // Show OK/Cancel buttons on X-based systems where window management is | |
62 | // more awkward | |
63 | #if defined(__WXMOTIF__) || defined(__WXGTK__) | |
64 | #define wxPROP_BUTTON_DEFAULT wxPROP_BUTTON_OK | wxPROP_BUTTON_CANCEL | wxPROP_BUTTON_CHECK_CROSS | wxPROP_PULLDOWN | |
65 | #else | |
66 | #define wxPROP_BUTTON_DEFAULT wxPROP_BUTTON_CHECK_CROSS | wxPROP_PULLDOWN | wxPROP_SHOWVALUES | |
67 | #endif | |
68 | ||
69 | #define wxID_PROP_CROSS 3000 | |
70 | #define wxID_PROP_CHECK 3001 | |
71 | #define wxID_PROP_EDIT 3002 | |
72 | #define wxID_PROP_TEXT 3003 | |
73 | #define wxID_PROP_SELECT 3004 | |
74 | #define wxID_PROP_VALUE_SELECT 3005 | |
75 | ||
76 | // Mediates between a physical panel and the property sheet | |
15e8daec | 77 | class WXDLLIMPEXP_DEPRECATED wxPropertyListView: public wxPropertyView |
4a3bdee6 JS |
78 | { |
79 | public: | |
80 | wxPropertyListView(wxPanel *propPanel = NULL, long flags = wxPROP_BUTTON_DEFAULT); | |
81 | ~wxPropertyListView(void); | |
82 | ||
83 | // Associates and shows the view | |
84 | virtual void ShowView(wxPropertySheet *propertySheet, wxPanel *panel); | |
85 | ||
86 | // Update this view of the viewed object, called e.g. by | |
87 | // the object itself. | |
88 | virtual bool OnUpdateView(void); | |
89 | ||
90 | wxString MakeNameValueString(wxString name, wxString value); | |
91 | ||
92 | // Update a single line in the list of properties | |
93 | virtual bool UpdatePropertyDisplayInList(wxProperty *property); | |
94 | ||
95 | // Update the whole list | |
b5982058 | 96 | virtual bool UpdatePropertyList(bool clearEditArea = true); |
4a3bdee6 JS |
97 | |
98 | // Find the wxListBox index corresponding to this property | |
99 | virtual int FindListIndexForProperty(wxProperty *property); | |
100 | ||
101 | // Select and show string representation in editor the given | |
102 | // property. NULL resets to show no property. | |
b5982058 | 103 | virtual bool ShowProperty(wxProperty *property, bool select = true); |
4a3bdee6 JS |
104 | virtual bool EditProperty(wxProperty *property); |
105 | ||
106 | // Update the display from the property | |
107 | virtual bool DisplayProperty(wxProperty *property); | |
108 | // Update the property from the display | |
109 | virtual bool RetrieveProperty(wxProperty *property); | |
110 | ||
111 | // Find appropriate validator and load property into value controls | |
112 | virtual bool BeginShowingProperty(wxProperty *property); | |
113 | // Find appropriate validator and unload property from value controls | |
114 | virtual bool EndShowingProperty(wxProperty *property); | |
115 | ||
116 | // Begin detailed editing (e.g. using value listbox) | |
117 | virtual void BeginDetailedEditing(void); | |
118 | ||
119 | // End detailed editing (e.g. using value listbox) | |
120 | virtual void EndDetailedEditing(void); | |
121 | ||
122 | // Called by the property listbox | |
123 | void OnPropertySelect(wxCommandEvent& event); | |
124 | ||
125 | // Called by the value listbox | |
126 | void OnValueListSelect(wxCommandEvent& event); | |
127 | ||
128 | virtual bool CreateControls(void); | |
129 | virtual void ShowTextControl(bool show); | |
130 | virtual void ShowListBoxControl(bool show); | |
131 | virtual void EnableCheck(bool show); | |
132 | virtual void EnableCross(bool show); | |
133 | ||
134 | void OnOk(wxCommandEvent& event); | |
135 | void OnCancel(wxCommandEvent& event); | |
136 | void OnHelp(wxCommandEvent& event); | |
137 | void OnPropertyDoubleClick(wxCommandEvent& event); | |
138 | // virtual void OnDoubleClick(void); | |
139 | ||
140 | void OnCheck(wxCommandEvent& event); | |
141 | void OnCross(wxCommandEvent& event); | |
142 | void OnEdit(wxCommandEvent& event); | |
143 | void OnText(wxCommandEvent& event); | |
144 | ||
145 | inline virtual wxListBox *GetPropertyScrollingList() const { return m_propertyScrollingList; } | |
146 | inline virtual wxListBox *GetValueList() const { return m_valueList; } | |
147 | inline virtual wxTextCtrl *GetValueText() const { return m_valueText; } | |
148 | inline virtual wxButton *GetConfirmButton() const { return m_confirmButton; } | |
149 | inline virtual wxButton *GetCancelButton() const { return m_cancelButton; } | |
150 | inline virtual wxButton *GetEditButton() const { return m_editButton; } | |
151 | inline virtual bool GetDetailedEditing(void) const { return m_detailedEditing; } | |
152 | ||
153 | inline virtual void AssociatePanel(wxPanel *win) { m_propertyWindow = win; } | |
154 | inline virtual wxPanel *GetPanel(void) const { return m_propertyWindow; } | |
155 | ||
156 | inline virtual void SetManagedWindow(wxWindow *win) { m_managedWindow = win; } | |
157 | inline virtual wxWindow *GetManagedWindow(void) const { return m_managedWindow; } | |
158 | ||
159 | inline virtual wxButton *GetWindowCloseButton() const { return m_windowCloseButton; } | |
160 | inline virtual wxButton *GetWindowCancelButton() const { return m_windowCancelButton; } | |
161 | inline virtual wxButton *GetHelpButton() const { return m_windowHelpButton; } | |
162 | ||
163 | bool OnClose(void); | |
164 | ||
165 | public: | |
166 | static bool sm_dialogCancelled; | |
167 | ||
168 | protected: | |
169 | wxListBox* m_propertyScrollingList; | |
170 | wxListBox* m_valueList; // Should really be a combobox, but we don't have one. | |
171 | wxTextCtrl* m_valueText; | |
172 | wxButton* m_confirmButton; // A tick, as in VB | |
173 | wxButton* m_cancelButton; // A cross, as in VB | |
174 | wxButton* m_editButton; // Invokes the custom validator, if any | |
175 | wxSizer* m_middleSizer; | |
176 | ||
177 | bool m_detailedEditing; // E.g. using listbox for choices | |
178 | ||
179 | wxPanel* m_propertyWindow; // Panel that the controls will appear on | |
180 | wxWindow* m_managedWindow; // Frame or dialog | |
181 | ||
182 | wxButton* m_windowCloseButton; // Or OK | |
183 | wxButton* m_windowCancelButton; | |
184 | wxButton* m_windowHelpButton; | |
185 | ||
186 | private: | |
187 | DECLARE_DYNAMIC_CLASS(wxPropertyListView) | |
188 | DECLARE_EVENT_TABLE() | |
318c5e9f | 189 | |
4a3bdee6 JS |
190 | virtual void ShowView(wxPropertySheet *propertySheet, wxWindow *window) |
191 | { wxPropertyView::ShowView(propertySheet, window); }; | |
192 | }; | |
193 | ||
15e8daec | 194 | class WXDLLIMPEXP_DEPRECATED wxPropertyTextEdit: public wxTextCtrl |
4a3bdee6 JS |
195 | { |
196 | public: | |
197 | wxPropertyTextEdit(wxPropertyListView *v = NULL, | |
198 | wxWindow *parent = NULL, | |
b5982058 | 199 | const wxWindowID id = wxID_ANY, |
4a3bdee6 JS |
200 | const wxString& value = wxEmptyString, |
201 | const wxPoint& pos = wxDefaultPosition, | |
202 | const wxSize& size = wxDefaultSize, | |
203 | long style = 0, | |
204 | const wxString& name = wxT("text")); | |
205 | ||
206 | void OnSetFocus(); | |
207 | void OnKillFocus(); | |
208 | ||
209 | wxPropertyListView* m_view; | |
210 | ||
211 | private: | |
212 | DECLARE_CLASS(wxPropertyTextEdit) | |
213 | }; | |
214 | ||
215 | #define wxPROP_ALLOW_TEXT_EDITING 1 | |
216 | ||
217 | /* | |
218 | * The type of validator used for property lists (Visual Basic style) | |
219 | */ | |
220 | ||
15e8daec | 221 | class WXDLLIMPEXP_DEPRECATED wxPropertyListValidator: public wxPropertyValidator |
4a3bdee6 JS |
222 | { |
223 | public: | |
224 | wxPropertyListValidator(long flags = wxPROP_ALLOW_TEXT_EDITING): wxPropertyValidator(flags) { } | |
225 | ~wxPropertyListValidator() {} | |
226 | ||
227 | // Called when the property is selected or deselected: typically displays the value | |
228 | // in the edit control (having chosen a suitable control to display: (non)editable text or listbox) | |
229 | virtual bool OnSelect(bool select, wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
230 | ||
231 | // Called when the property is double clicked. Extra functionality can be provided, such as | |
232 | // cycling through possible values. | |
233 | inline virtual bool OnDoubleClick( | |
234 | wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) | |
b5982058 | 235 | { return true; } |
4a3bdee6 JS |
236 | |
237 | // Called when the value listbox is selected. Default behaviour is to copy | |
238 | // string to text control, and retrieve the value into the property. | |
239 | virtual bool OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
240 | ||
241 | // Called when the property value is edited using standard text control | |
242 | inline virtual bool OnPrepareControls( | |
243 | wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) | |
b5982058 | 244 | { return true; } |
4a3bdee6 JS |
245 | |
246 | virtual bool OnClearControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
247 | ||
248 | // Called when the property is edited in detail | |
249 | inline virtual bool OnPrepareDetailControls( | |
250 | wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) | |
b5982058 | 251 | { return true; } |
4a3bdee6 JS |
252 | |
253 | // Called if focus lost, IF we're in a modeless property editing situation. | |
254 | inline virtual bool OnClearDetailControls( | |
255 | wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) | |
b5982058 | 256 | { return true; } |
4a3bdee6 JS |
257 | |
258 | // Called when the edit (...) button is pressed. The default implementation | |
259 | // calls view->BeginDetailedEditing; the filename validator (for example) overrides | |
260 | // this function to show the file selector. | |
261 | virtual void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
262 | ||
263 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 264 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
265 | inline virtual bool OnCheckValue( |
266 | wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) | |
b5982058 | 267 | { return true; } |
4a3bdee6 JS |
268 | |
269 | // Called when TICK is pressed or focus is lost or view wants to update | |
270 | // the property list. | |
271 | // Does the transferance from the property editing area to the property itself | |
272 | virtual bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
273 | ||
274 | virtual bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
318c5e9f | 275 | |
4a3bdee6 JS |
276 | private: |
277 | DECLARE_DYNAMIC_CLASS(wxPropertyListValidator) | |
278 | }; | |
279 | ||
280 | /* | |
281 | * A default dialog box class to use. | |
282 | */ | |
283 | ||
15e8daec | 284 | class WXDLLIMPEXP_DEPRECATED wxPropertyListDialog: public wxDialog |
4a3bdee6 JS |
285 | { |
286 | public: | |
287 | wxPropertyListDialog(wxPropertyListView *v = NULL, | |
288 | wxWindow *parent = NULL, | |
289 | const wxString& title = wxEmptyString, | |
290 | const wxPoint& pos = wxDefaultPosition, | |
291 | const wxSize& size = wxDefaultSize, | |
292 | long style = wxDEFAULT_DIALOG_STYLE, | |
293 | const wxString& name = wxT("dialogBox")); | |
294 | ||
295 | void OnCloseWindow(wxCloseEvent& event); | |
296 | void OnDefaultAction(wxControl *item); | |
297 | void OnCancel(wxCommandEvent& event); | |
298 | ||
299 | // Extend event processing to search the view's event table | |
300 | virtual bool ProcessEvent(wxEvent& event); | |
301 | ||
302 | private: | |
303 | wxPropertyListView* m_view; | |
304 | ||
305 | private: | |
306 | DECLARE_CLASS(wxPropertyListDialog) | |
307 | DECLARE_EVENT_TABLE() | |
308 | }; | |
309 | ||
310 | /* | |
311 | * A default panel class to use. | |
312 | */ | |
313 | ||
15e8daec | 314 | class WXDLLIMPEXP_DEPRECATED wxPropertyListPanel: public wxPanel |
4a3bdee6 JS |
315 | { |
316 | public: | |
317 | wxPropertyListPanel(wxPropertyListView *v = NULL, | |
318 | wxWindow *parent = NULL, | |
319 | const wxPoint& pos = wxDefaultPosition, | |
320 | const wxSize& size = wxDefaultSize, | |
321 | long style = 0, | |
322 | const wxString& name = wxT("panel")) | |
b5982058 | 323 | : wxPanel(parent, wxID_ANY, pos, size, style, name) |
4a3bdee6 JS |
324 | { |
325 | m_view = v; | |
326 | } | |
327 | ~wxPropertyListPanel(); | |
328 | void OnDefaultAction(wxControl *item); | |
329 | ||
330 | inline void SetView(wxPropertyListView* v) { m_view = v; } | |
331 | inline wxPropertyListView* GetView() const { return m_view; } | |
332 | ||
333 | // Extend event processing to search the view's event table | |
334 | virtual bool ProcessEvent(wxEvent& event); | |
335 | ||
336 | // Call Layout() | |
337 | void OnSize(wxSizeEvent& event); | |
338 | ||
339 | private: | |
340 | wxPropertyListView* m_view; | |
341 | ||
342 | private: | |
343 | DECLARE_EVENT_TABLE() | |
344 | DECLARE_CLASS(wxPropertyListPanel) | |
345 | }; | |
346 | ||
347 | /* | |
348 | * A default frame class to use. | |
349 | */ | |
350 | ||
15e8daec | 351 | class WXDLLIMPEXP_DEPRECATED wxPropertyListFrame: public wxFrame |
4a3bdee6 JS |
352 | { |
353 | public: | |
354 | wxPropertyListFrame(wxPropertyListView *v = NULL, | |
355 | wxFrame *parent = NULL, | |
356 | const wxString& title = wxEmptyString, | |
357 | const wxPoint& pos = wxDefaultPosition, | |
358 | const wxSize& size = wxDefaultSize, | |
359 | long style = wxDEFAULT_FRAME_STYLE, | |
360 | const wxString& name = _T("frame")) | |
b5982058 | 361 | : wxFrame(parent, wxID_ANY, title, pos, size, style, name) |
4a3bdee6 JS |
362 | { |
363 | m_view = v; | |
364 | m_propertyPanel = NULL; | |
365 | } | |
366 | void OnCloseWindow(wxCloseEvent& event); | |
367 | ||
368 | // Must call this to create panel and associate view | |
369 | virtual bool Initialize(void); | |
370 | virtual wxPropertyListPanel *OnCreatePanel(wxFrame *parent, wxPropertyListView *v); | |
371 | inline virtual wxPropertyListPanel *GetPropertyPanel(void) const { return m_propertyPanel; } | |
372 | inline wxPropertyListView* GetView() const { return m_view; } | |
373 | ||
374 | private: | |
375 | wxPropertyListView* m_view; | |
376 | wxPropertyListPanel* m_propertyPanel; | |
377 | ||
378 | private: | |
379 | DECLARE_EVENT_TABLE() | |
380 | DECLARE_CLASS(wxPropertyListFrame) | |
381 | }; | |
382 | ||
383 | /* | |
384 | * Some default validators | |
385 | */ | |
386 | ||
15e8daec | 387 | class WXDLLIMPEXP_DEPRECATED wxRealListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
388 | { |
389 | public: | |
390 | // 0.0, 0.0 means no range | |
391 | wxRealListValidator(float min = 0.0, float max = 0.0, long flags = wxPROP_ALLOW_TEXT_EDITING):wxPropertyListValidator(flags) | |
392 | { m_realMin = min; m_realMax = max; } | |
393 | ~wxRealListValidator() {} | |
394 | ||
395 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
396 | ||
397 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 398 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
399 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); |
400 | ||
401 | // Called when TICK is pressed or focus is lost or view wants to update | |
402 | // the property list. | |
403 | // Does the transfer from the property editing area to the property itself | |
404 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
405 | ||
406 | protected: | |
407 | float m_realMin; | |
408 | float m_realMax; | |
318c5e9f | 409 | |
4a3bdee6 JS |
410 | private: |
411 | DECLARE_DYNAMIC_CLASS(wxRealListValidator) | |
412 | }; | |
413 | ||
15e8daec | 414 | class WXDLLIMPEXP_DEPRECATED wxIntegerListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
415 | { |
416 | public: | |
417 | // 0, 0 means no range | |
418 | wxIntegerListValidator(long min = 0, long max = 0, long flags = wxPROP_ALLOW_TEXT_EDITING):wxPropertyListValidator(flags) | |
419 | { | |
420 | m_integerMin = min; m_integerMax = max; | |
421 | } | |
422 | ~wxIntegerListValidator() {} | |
423 | ||
424 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
425 | ||
426 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 427 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
428 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); |
429 | ||
430 | // Called when TICK is pressed or focus is lost or view wants to update | |
431 | // the property list. | |
432 | // Does the transfer from the property editing area to the property itself | |
433 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
434 | ||
435 | protected: | |
436 | long m_integerMin; | |
437 | long m_integerMax; | |
318c5e9f | 438 | |
4a3bdee6 JS |
439 | private: |
440 | DECLARE_DYNAMIC_CLASS(wxIntegerListValidator) | |
441 | }; | |
442 | ||
15e8daec | 443 | class WXDLLIMPEXP_DEPRECATED wxBoolListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
444 | { |
445 | public: | |
446 | wxBoolListValidator(long flags = 0):wxPropertyListValidator(flags) {} | |
447 | ~wxBoolListValidator() {} | |
448 | ||
449 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
450 | bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
451 | bool OnClearDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
452 | ||
453 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 454 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
455 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); |
456 | ||
457 | // Called when TICK is pressed or focus is lost or view wants to update | |
458 | // the property list. | |
459 | // Does the transfer from the property editing area to the property itself | |
460 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
461 | bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
462 | ||
463 | // Called when the property is double clicked. Extra functionality can be provided, | |
464 | // cycling through possible values. | |
465 | virtual bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
318c5e9f | 466 | |
4a3bdee6 JS |
467 | private: |
468 | DECLARE_DYNAMIC_CLASS(wxBoolListValidator) | |
469 | }; | |
470 | ||
15e8daec | 471 | class WXDLLIMPEXP_DEPRECATED wxStringListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
472 | { |
473 | public: | |
474 | wxStringListValidator(wxStringList *list = NULL, long flags = 0); | |
475 | ||
476 | ~wxStringListValidator() | |
477 | { | |
478 | if (m_strings) | |
479 | delete m_strings; | |
480 | } | |
481 | ||
482 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
483 | bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
484 | bool OnClearDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
485 | ||
486 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 487 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
488 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); |
489 | ||
490 | // Called when TICK is pressed or focus is lost or view wants to update | |
491 | // the property list. | |
492 | // Does the transfer from the property editing area to the property itself | |
493 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
494 | bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
495 | ||
496 | // Called when the property is double clicked. Extra functionality can be provided, | |
497 | // cycling through possible values. | |
498 | bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
499 | ||
500 | protected: | |
501 | wxStringList* m_strings; | |
318c5e9f | 502 | |
4a3bdee6 JS |
503 | private: |
504 | DECLARE_DYNAMIC_CLASS(wxStringListValidator) | |
505 | }; | |
506 | ||
15e8daec | 507 | class WXDLLIMPEXP_DEPRECATED wxFilenameListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
508 | { |
509 | public: | |
510 | wxFilenameListValidator(wxString message = wxT("Select a file"), wxString wildcard = wxALL_FILES_PATTERN, long flags = 0); | |
511 | ~wxFilenameListValidator(); | |
512 | ||
513 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 514 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
515 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); |
516 | ||
517 | // Called when TICK is pressed or focus is lost or view wants to update | |
518 | // the property list. | |
519 | // Does the transferance from the property editing area to the property itself | |
520 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
521 | bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
522 | ||
523 | bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
524 | ||
525 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
526 | ||
527 | // Called when the edit (...) button is pressed. | |
528 | void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
529 | ||
530 | protected: | |
531 | wxString m_filenameWildCard; | |
532 | wxString m_filenameMessage; | |
533 | ||
534 | private: | |
535 | DECLARE_DYNAMIC_CLASS(wxFilenameListValidator) | |
536 | }; | |
537 | ||
15e8daec | 538 | class WXDLLIMPEXP_DEPRECATED wxColourListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
539 | { |
540 | public: | |
541 | wxColourListValidator(long flags = 0); | |
542 | ~wxColourListValidator(); | |
543 | ||
544 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
545 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
546 | bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
547 | ||
548 | bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
549 | ||
550 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
551 | ||
552 | // Called when the edit (...) button is pressed. | |
553 | void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
318c5e9f | 554 | |
4a3bdee6 JS |
555 | private: |
556 | DECLARE_DYNAMIC_CLASS(wxColourListValidator) | |
557 | }; | |
558 | ||
15e8daec | 559 | class WXDLLIMPEXP_DEPRECATED wxListOfStringsListValidator: public wxPropertyListValidator |
4a3bdee6 JS |
560 | { |
561 | public: | |
562 | wxListOfStringsListValidator(long flags = 0); | |
563 | ~wxListOfStringsListValidator() {} | |
564 | ||
565 | bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
566 | ||
567 | // Called when TICK is pressed or focus is lost. | |
318c5e9f | 568 | // Return false if value didn't check out; signal to restore old value. |
4a3bdee6 JS |
569 | bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); |
570 | ||
571 | // Called when TICK is pressed or focus is lost or view wants to update | |
572 | // the property list. | |
573 | // Does the transfer from the property editing area to the property itself | |
574 | bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
575 | bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
576 | ||
577 | // Called when the property is double clicked. | |
578 | bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
579 | ||
580 | bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = wxT("String List Editor")); | |
581 | ||
582 | // Called when the edit (...) button is pressed. | |
583 | void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); | |
318c5e9f | 584 | |
4a3bdee6 JS |
585 | private: |
586 | DECLARE_DYNAMIC_CLASS(wxListOfStringsListValidator) | |
587 | }; | |
588 | ||
589 | #endif | |
590 | // wxUSE_PROPSHEET | |
591 | ||
592 | #endif | |
593 | // _WX_PROPLIST_H_ |