]> git.saurik.com Git - wxWidgets.git/blob - include/wx/propgrid/propgrid.h
CanSetTransparent needs to be virtual
[wxWidgets.git] / include / wx / propgrid / propgrid.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/propgrid/propgrid.h
3 // Purpose: wxPropertyGrid
4 // Author: Jaakko Salli
5 // Modified by:
6 // Created: 2004-09-25
7 // RCS-ID: $Id$
8 // Copyright: (c) Jaakko Salli
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_PROPGRID_PROPGRID_H_
13 #define _WX_PROPGRID_PROPGRID_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_PROPGRID
18
19 #include "wx/thread.h"
20 #include "wx/dcclient.h"
21 #include "wx/scrolwin.h"
22 #include "wx/tooltip.h"
23 #include "wx/datetime.h"
24 #include "wx/recguard.h"
25
26 #include "wx/propgrid/property.h"
27 #include "wx/propgrid/propgridiface.h"
28
29
30 #ifndef SWIG
31 extern WXDLLIMPEXP_DATA_PROPGRID(const char) wxPropertyGridNameStr[];
32 #endif
33
34 class wxPGComboBox;
35
36 #if wxUSE_STATUSBAR
37 class WXDLLIMPEXP_FWD_CORE wxStatusBar;
38 #endif
39
40 // -----------------------------------------------------------------------
41 // Global variables
42 // -----------------------------------------------------------------------
43
44 // This is required for sharing common global variables.
45 class WXDLLIMPEXP_PROPGRID wxPGGlobalVarsClass
46 {
47 public:
48
49 wxPGGlobalVarsClass();
50 ~wxPGGlobalVarsClass();
51
52 #if wxUSE_THREADS
53 // Critical section for handling the globals. Generally it is not needed
54 // since GUI code is supposed to be in single thread. However,
55 // we do want the user to be able to convey wxPropertyGridEvents to other
56 // threads.
57 wxCriticalSection m_critSect;
58 #endif
59
60 // Used by advprops, but here to make things easier.
61 wxString m_pDefaultImageWildcard;
62
63 // Map of editor class instances (keys are name string).
64 wxPGHashMapS2P m_mapEditorClasses;
65
66 #if wxUSE_VALIDATORS
67 wxVector<wxValidator*> m_arrValidators; // These wxValidators need to be freed
68 #endif
69
70 wxPGHashMapS2P m_dictPropertyClassInfo; // PropertyName -> ClassInfo
71
72 wxPGChoices* m_fontFamilyChoices;
73
74 // Replace with your own to affect all properties using default renderer.
75 wxPGCellRenderer* m_defaultRenderer;
76
77 wxPGChoices m_boolChoices;
78
79 wxVariant m_vEmptyString;
80 wxVariant m_vZero;
81 wxVariant m_vMinusOne;
82 wxVariant m_vTrue;
83 wxVariant m_vFalse;
84
85 // Cached constant strings
86 wxPGCachedString m_strstring;
87 wxPGCachedString m_strlong;
88 wxPGCachedString m_strbool;
89 wxPGCachedString m_strlist;
90
91 wxPGCachedString m_strDefaultValue;
92 wxPGCachedString m_strMin;
93 wxPGCachedString m_strMax;
94 wxPGCachedString m_strUnits;
95 wxPGCachedString m_strHint;
96 #if wxPG_COMPATIBILITY_1_4
97 wxPGCachedString m_strInlineHelp;
98 #endif
99
100 // If true then some things are automatically translated
101 bool m_autoGetTranslation;
102
103 // > 0 if errors cannot or should not be shown in statusbar etc.
104 int m_offline;
105
106 int m_extraStyle; // global extra style
107
108 int m_warnings;
109
110 int HasExtraStyle( int style ) const { return (m_extraStyle & style); }
111 };
112
113 extern WXDLLIMPEXP_DATA_PROPGRID(wxPGGlobalVarsClass*) wxPGGlobalVars;
114
115 #define wxPGVariant_EmptyString (wxPGGlobalVars->m_vEmptyString)
116 #define wxPGVariant_Zero (wxPGGlobalVars->m_vZero)
117 #define wxPGVariant_MinusOne (wxPGGlobalVars->m_vMinusOne)
118 #define wxPGVariant_True (wxPGGlobalVars->m_vTrue)
119 #define wxPGVariant_False (wxPGGlobalVars->m_vFalse)
120
121 #define wxPGVariant_Bool(A) (A?wxPGVariant_True:wxPGVariant_False)
122
123 // When wxPG is loaded dynamically after the application is already running
124 // then the built-in module system won't pick this one up. Add it manually.
125 WXDLLIMPEXP_PROPGRID void wxPGInitResourceModule();
126
127 // -----------------------------------------------------------------------
128
129 /** @section propgrid_window_styles wxPropertyGrid Window Styles
130
131 SetWindowStyleFlag method can be used to modify some of these at run-time.
132 @{
133 */
134 enum wxPG_WINDOW_STYLES
135 {
136
137 /** This will cause Sort() automatically after an item is added.
138 When inserting a lot of items in this mode, it may make sense to
139 use Freeze() before operations and Thaw() afterwards to increase
140 performance.
141 */
142 wxPG_AUTO_SORT = 0x00000010,
143
144 /** Categories are not initially shown (even if added).
145 IMPORTANT NOTE: If you do not plan to use categories, then this
146 style will waste resources.
147 This flag can also be changed using wxPropertyGrid::EnableCategories method.
148 */
149 wxPG_HIDE_CATEGORIES = 0x00000020,
150
151 /* This style combines non-categoric mode and automatic sorting.
152 */
153 wxPG_ALPHABETIC_MODE = (wxPG_HIDE_CATEGORIES|wxPG_AUTO_SORT),
154
155 /** Modified values are shown in bold font. Changing this requires Refresh()
156 to show changes.
157 */
158 wxPG_BOLD_MODIFIED = 0x00000040,
159
160 /** Using this style, the column splitters move automatically based on column
161 proportions (default is equal proportion for every column). This behavior
162 stops once the user manually moves a splitter, and returns when a
163 splitter is double-clicked.
164
165 @see wxPropertyGridInterface::SetColumnProportion().
166 */
167 wxPG_SPLITTER_AUTO_CENTER = 0x00000080,
168
169 /** Display tooltips for cell text that cannot be shown completely. If
170 wxUSE_TOOLTIPS is 0, then this doesn't have any effect.
171 */
172 wxPG_TOOLTIPS = 0x00000100,
173
174 /** Disables margin and hides all expand/collapse buttons that would appear
175 outside the margin (for sub-properties). Toggling this style automatically
176 expands all collapsed items.
177 */
178 wxPG_HIDE_MARGIN = 0x00000200,
179
180 /** This style prevents user from moving the splitter.
181 */
182 wxPG_STATIC_SPLITTER = 0x00000400,
183
184 /** Combination of other styles that make it impossible for user to modify
185 the layout.
186 */
187 wxPG_STATIC_LAYOUT = (wxPG_HIDE_MARGIN|wxPG_STATIC_SPLITTER),
188
189 /** Disables wxTextCtrl based editors for properties which
190 can be edited in another way.
191
192 Equals calling wxPropertyGrid::LimitPropertyEditing for all added
193 properties.
194 */
195 wxPG_LIMITED_EDITING = 0x00000800,
196
197 /** wxPropertyGridManager only: Show toolbar for mode and page selection. */
198 wxPG_TOOLBAR = 0x00001000,
199
200 /** wxPropertyGridManager only: Show adjustable text box showing description
201 or help text, if available, for currently selected property.
202 */
203 wxPG_DESCRIPTION = 0x00002000,
204
205 /** wxPropertyGridManager only: don't show an internal border around the
206 property grid. Recommended if you use a header.
207 */
208 wxPG_NO_INTERNAL_BORDER = 0x00004000
209 };
210
211 #if wxPG_COMPATIBILITY_1_4
212 // In wxPG 1.4 this was used to enable now-default theme border support
213 // in wxPropertyGridManager.
214 #define wxPG_THEME_BORDER 0x00000000
215 #endif
216
217
218 enum wxPG_EX_WINDOW_STYLES
219 {
220
221 /**
222 NOTE: wxPG_EX_xxx are extra window styles and must be set using
223 SetExtraStyle() member function.
224
225 Speeds up switching to wxPG_HIDE_CATEGORIES mode. Initially, if
226 wxPG_HIDE_CATEGORIES is not defined, the non-categorized data storage is
227 not activated, and switching the mode first time becomes somewhat slower.
228 wxPG_EX_INIT_NOCAT activates the non-categorized data storage right away.
229 IMPORTANT NOTE: If you do plan not switching to non-categoric mode, or if
230 you don't plan to use categories at all, then using this style will result
231 in waste of resources.
232
233 */
234 wxPG_EX_INIT_NOCAT = 0x00001000,
235
236 /** Extended window style that sets wxPropertyGridManager toolbar to not
237 use flat style.
238 */
239 wxPG_EX_NO_FLAT_TOOLBAR = 0x00002000,
240
241 /** Shows alphabetic/categoric mode buttons from toolbar.
242 */
243 wxPG_EX_MODE_BUTTONS = 0x00008000,
244
245 /** Show property help strings as tool tips instead as text on the status bar.
246 You can set the help strings using SetPropertyHelpString member function.
247 */
248 wxPG_EX_HELP_AS_TOOLTIPS = 0x00010000,
249
250 /** Prevent TAB from focusing to wxButtons. This behavior was default
251 in version 1.2.0 and earlier.
252 NOTE! Tabbing to button doesn't work yet. Problem seems to be that on wxMSW
253 atleast the button doesn't properly propagate key events (yes, I'm using
254 wxWANTS_CHARS).
255 */
256 //wxPG_EX_NO_TAB_TO_BUTTON = 0x00020000,
257
258 /** Allows relying on native double-buffering.
259 */
260 wxPG_EX_NATIVE_DOUBLE_BUFFERING = 0x00080000,
261
262 /** Set this style to let user have ability to set values of properties to
263 unspecified state. Same as setting wxPG_PROP_AUTO_UNSPECIFIED for
264 all properties.
265 */
266 wxPG_EX_AUTO_UNSPECIFIED_VALUES = 0x00200000,
267
268 /**
269 If this style is used, built-in attributes (such as wxPG_FLOAT_PRECISION
270 and wxPG_STRING_PASSWORD) are not stored into property's attribute storage
271 (thus they are not readable).
272
273 Note that this option is global, and applies to all wxPG property
274 containers.
275 */
276 wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES = 0x00400000,
277
278 /** Hides page selection buttons from toolbar.
279 */
280 wxPG_EX_HIDE_PAGE_BUTTONS = 0x01000000,
281
282 /** Allows multiple properties to be selected by user (by pressing SHIFT
283 when clicking on a property, or by dragging with left mouse button
284 down).
285
286 You can get array of selected properties with
287 wxPropertyGridInterface::GetSelectedProperties(). In multiple selection
288 mode wxPropertyGridInterface::GetSelection() returns
289 property which has editor active (usually the first one
290 selected). Other useful member functions are ClearSelection(),
291 AddToSelection() and RemoveFromSelection().
292 */
293 wxPG_EX_MULTIPLE_SELECTION = 0x02000000,
294
295 /**
296 This enables top-level window tracking which allows wxPropertyGrid to
297 notify the application of last-minute property value changes by user.
298
299 This style is not enabled by default because it may cause crashes when
300 wxPropertyGrid is used in with wxAUI or similar system.
301
302 @remarks If you are not in fact using any system that may change
303 wxPropertyGrid's top-level parent window on its own, then you
304 are recommended to enable this style.
305 */
306 wxPG_EX_ENABLE_TLP_TRACKING = 0x04000000,
307
308 /** Don't show divider above toolbar, on Windows.
309 */
310 wxPG_EX_NO_TOOLBAR_DIVIDER = 0x08000000,
311
312 /** Show a separator below the toolbar.
313 */
314 wxPG_EX_TOOLBAR_SEPARATOR = 0x10000000
315
316 };
317
318 #if wxPG_COMPATIBILITY_1_4
319 #define wxPG_EX_DISABLE_TLP_TRACKING 0x00000000
320 #endif
321
322 /** Combines various styles.
323 */
324 #define wxPG_DEFAULT_STYLE (0)
325
326 /** Combines various styles.
327 */
328 #define wxPGMAN_DEFAULT_STYLE (0)
329
330 /** @}
331 */
332
333 // -----------------------------------------------------------------------
334
335 //
336 // Ids for sub-controls
337 // NB: It should not matter what these are.
338 #define wxPG_SUBID1 2
339 #define wxPG_SUBID2 3
340 #define wxPG_SUBID_TEMP1 4
341
342 // -----------------------------------------------------------------------
343
344 /** @class wxPGCommonValue
345
346 wxPropertyGrid stores information about common values in these
347 records.
348
349 NB: Common value feature is not complete, and thus not mentioned in
350 documentation.
351 */
352 class WXDLLIMPEXP_PROPGRID wxPGCommonValue
353 {
354 public:
355
356 wxPGCommonValue( const wxString& label, wxPGCellRenderer* renderer )
357 {
358 m_label = label;
359 m_renderer = renderer;
360 renderer->IncRef();
361 }
362 virtual ~wxPGCommonValue()
363 {
364 m_renderer->DecRef();
365 }
366
367 virtual wxString GetEditableText() const { return m_label; }
368 const wxString& GetLabel() const { return m_label; }
369 wxPGCellRenderer* GetRenderer() const { return m_renderer; }
370
371 protected:
372 wxString m_label;
373 wxPGCellRenderer* m_renderer;
374 };
375
376 // -----------------------------------------------------------------------
377
378 /** @section propgrid_vfbflags wxPropertyGrid Validation Failure Behavior Flags
379 @{
380 */
381
382 enum wxPG_VALIDATION_FAILURE_BEHAVIOR_FLAGS
383 {
384
385 /** Prevents user from leaving property unless value is valid. If this
386 behavior flag is not used, then value change is instead cancelled.
387 */
388 wxPG_VFB_STAY_IN_PROPERTY = 0x01,
389
390 /** Calls wxBell() on validation failure.
391 */
392 wxPG_VFB_BEEP = 0x02,
393
394 /** Cell with invalid value will be marked (with red colour).
395 */
396 wxPG_VFB_MARK_CELL = 0x04,
397
398 /**
399 Display a text message explaining the situation.
400
401 To customize the way the message is displayed, you need to
402 reimplement wxPropertyGrid::DoShowPropertyError() in a
403 derived class. Default behavior is to display the text on
404 the top-level frame's status bar, if present, and otherwise
405 using wxMessageBox.
406 */
407 wxPG_VFB_SHOW_MESSAGE = 0x08,
408
409 /**
410 Similar to wxPG_VFB_SHOW_MESSAGE, except always displays the
411 message using wxMessageBox.
412 */
413 wxPG_VFB_SHOW_MESSAGEBOX = 0x10,
414
415 /**
416 Similar to wxPG_VFB_SHOW_MESSAGE, except always displays the
417 message on the status bar (when present - you can reimplement
418 wxPropertyGrid::GetStatusBar() in a derived class to specify
419 this yourself).
420 */
421 wxPG_VFB_SHOW_MESSAGE_ON_STATUSBAR = 0x20,
422
423 /** Defaults. */
424 wxPG_VFB_DEFAULT = wxPG_VFB_MARK_CELL |
425 wxPG_VFB_SHOW_MESSAGEBOX,
426
427 /** Only used internally. */
428 wxPG_VFB_UNDEFINED = 0x80
429
430 };
431
432 /** @}
433 */
434
435 // Having this as define instead of wxByte typedef makes things easier for
436 // wxPython bindings (ignoring and redefining it in SWIG interface file
437 // seemed rather tricky)
438 #define wxPGVFBFlags unsigned char
439
440 /**
441 wxPGValidationInfo
442
443 Used to convey validation information to and from functions that
444 actually perform validation. Mostly used in custom property
445 classes.
446 */
447 class WXDLLIMPEXP_PROPGRID wxPGValidationInfo
448 {
449 friend class wxPropertyGrid;
450 public:
451 wxPGValidationInfo()
452 {
453 m_failureBehavior = 0;
454 m_isFailing = false;
455 }
456
457 ~wxPGValidationInfo()
458 {
459 }
460
461 /**
462 @return Returns failure behavior which is a combination of
463 @ref propgrid_vfbflags.
464 */
465 wxPGVFBFlags GetFailureBehavior() const
466 { return m_failureBehavior; }
467
468 /**
469 Returns current failure message.
470 */
471 const wxString& GetFailureMessage() const
472 { return m_failureMessage; }
473
474 /**
475 Returns reference to pending value.
476 */
477 wxVariant& GetValue()
478 {
479 wxASSERT(m_pValue);
480 return *m_pValue;
481 }
482
483 /** Set validation failure behavior
484
485 @param failureBehavior
486 Mixture of @ref propgrid_vfbflags.
487 */
488 void SetFailureBehavior(wxPGVFBFlags failureBehavior)
489 { m_failureBehavior = failureBehavior; }
490
491 /**
492 Set current failure message.
493 */
494 void SetFailureMessage(const wxString& message)
495 { m_failureMessage = message; }
496
497 private:
498 /** Value to be validated.
499 */
500 wxVariant* m_pValue;
501
502 /** Message displayed on validation failure.
503 */
504 wxString m_failureMessage;
505
506 /** Validation failure behavior. Use wxPG_VFB_XXX flags.
507 */
508 wxPGVFBFlags m_failureBehavior;
509
510 // True when validation is currently failing.
511 bool m_isFailing;
512 };
513
514 // -----------------------------------------------------------------------
515
516 /** @section propgrid_pgactions wxPropertyGrid Action Identifiers
517
518 These are used with wxPropertyGrid::AddActionTrigger() and
519 wxPropertyGrid::ClearActionTriggers().
520 @{
521 */
522
523 enum wxPG_KEYBOARD_ACTIONS
524 {
525 wxPG_ACTION_INVALID = 0,
526 wxPG_ACTION_NEXT_PROPERTY,
527 wxPG_ACTION_PREV_PROPERTY,
528 wxPG_ACTION_EXPAND_PROPERTY,
529 wxPG_ACTION_COLLAPSE_PROPERTY,
530 wxPG_ACTION_CANCEL_EDIT,
531 wxPG_ACTION_PRESS_BUTTON, // Causes editor button (if any) to be pressed
532 wxPG_ACTION_MAX
533 };
534
535 /** @}
536 */
537
538 // -----------------------------------------------------------------------
539
540
541 // wxPropertyGrid::DoSelectProperty flags (selFlags)
542
543 // Focuses to created editor
544 #define wxPG_SEL_FOCUS 0x0001
545 // Forces deletion and recreation of editor
546 #define wxPG_SEL_FORCE 0x0002
547 // For example, doesn't cause EnsureVisible
548 #define wxPG_SEL_NONVISIBLE 0x0004
549 // Do not validate editor's value before selecting
550 #define wxPG_SEL_NOVALIDATE 0x0008
551 // Property being deselected is about to be deleted
552 #define wxPG_SEL_DELETING 0x0010
553 // Property's values was set to unspecified by the user
554 #define wxPG_SEL_SETUNSPEC 0x0020
555 // Property's event handler changed the value
556 #define wxPG_SEL_DIALOGVAL 0x0040
557 // Set to disable sending of wxEVT_PG_SELECTED event
558 #define wxPG_SEL_DONT_SEND_EVENT 0x0080
559 // Don't make any graphics updates
560 #define wxPG_SEL_NO_REFRESH 0x0100
561
562 // -----------------------------------------------------------------------
563
564 // DoSetSplitterPosition() flags
565
566 enum wxPG_SET_SPLITTER_POSITION_SPLITTER_FLAGS
567 {
568 wxPG_SPLITTER_REFRESH = 0x0001,
569 wxPG_SPLITTER_ALL_PAGES = 0x0002,
570 wxPG_SPLITTER_FROM_EVENT = 0x0004,
571 wxPG_SPLITTER_FROM_AUTO_CENTER = 0x0008
572 };
573
574
575 // -----------------------------------------------------------------------
576
577 // Internal flags
578 #define wxPG_FL_INITIALIZED 0x0001
579 // Set when creating editor controls if it was clicked on.
580 #define wxPG_FL_ACTIVATION_BY_CLICK 0x0002
581 #define wxPG_FL_DONT_CENTER_SPLITTER 0x0004
582 #define wxPG_FL_FOCUSED 0x0008
583 #define wxPG_FL_MOUSE_CAPTURED 0x0010
584 #define wxPG_FL_MOUSE_INSIDE 0x0020
585 #define wxPG_FL_VALUE_MODIFIED 0x0040
586 // don't clear background of m_wndEditor
587 #define wxPG_FL_PRIMARY_FILLS_ENTIRE 0x0080
588 // currently active editor uses custom image
589 #define wxPG_FL_CUR_USES_CUSTOM_IMAGE 0x0100
590 // cell colours override selection colours for selected cell
591 #define wxPG_FL_CELL_OVERRIDES_SEL 0x0200
592 #define wxPG_FL_SCROLLED 0x0400
593 // set when all added/inserted properties get hideable flag
594 #define wxPG_FL_ADDING_HIDEABLES 0x0800
595 // Disables showing help strings on statusbar.
596 #define wxPG_FL_NOSTATUSBARHELP 0x1000
597 // Marks that we created the state, so we have to destroy it too.
598 #define wxPG_FL_CREATEDSTATE 0x2000
599 // Set if scrollbar's existence was detected in last onresize.
600 #define wxPG_FL_SCROLLBAR_DETECTED 0x4000
601 // Set if wxPGMan requires redrawing of description text box.
602 #define wxPG_FL_DESC_REFRESH_REQUIRED 0x8000
603 // Set if contained in wxPropertyGridManager
604 #define wxPG_FL_IN_MANAGER 0x00020000
605 // Set after wxPropertyGrid is shown in its initial good size
606 #define wxPG_FL_GOOD_SIZE_SET 0x00040000
607 // Set when in SelectProperty.
608 #define wxPG_FL_IN_SELECT_PROPERTY 0x00100000
609 // Set when help string is shown in status bar
610 #define wxPG_FL_STRING_IN_STATUSBAR 0x00200000
611 // Auto sort is enabled (for categorized mode)
612 #define wxPG_FL_CATMODE_AUTO_SORT 0x01000000
613 // Set after page has been inserted to manager
614 #define wxPG_MAN_FL_PAGE_INSERTED 0x02000000
615 // Active editor control is abnormally large
616 #define wxPG_FL_ABNORMAL_EDITOR 0x04000000
617 // Recursion guard for HandleCustomEditorEvent
618 #define wxPG_FL_IN_HANDLECUSTOMEDITOREVENT 0x08000000
619 #define wxPG_FL_VALUE_CHANGE_IN_EVENT 0x10000000
620 // Editor control width should not change on resize
621 #define wxPG_FL_FIXED_WIDTH_EDITOR 0x20000000
622 // Width of panel can be different than width of grid
623 #define wxPG_FL_HAS_VIRTUAL_WIDTH 0x40000000
624 // Prevents RecalculateVirtualSize re-entrancy
625 #define wxPG_FL_RECALCULATING_VIRTUAL_SIZE 0x80000000
626
627 #if !defined(__wxPG_SOURCE_FILE__)
628 // Reduce compile time, but still include in user app
629 #include "wx/propgrid/props.h"
630 #endif
631
632 // -----------------------------------------------------------------------
633
634 /** @class wxPropertyGrid
635
636 wxPropertyGrid is a specialized grid for editing properties
637 such as strings, numbers, flagsets, fonts, and colours. wxPropertySheet
638 used to do the very same thing, but it hasn't been updated for a while
639 and it is currently deprecated.
640
641 Please note that most member functions are inherited and as such not
642 documented on this page. This means you will probably also want to read
643 wxPropertyGridInterface class reference.
644
645 See also @ref overview_propgrid.
646
647 @section propgrid_window_styles_ Window Styles
648
649 See @ref propgrid_window_styles.
650
651 @section propgrid_event_handling Event Handling
652
653 To process input from a propertygrid control, use these event handler
654 macros to direct input to member functions that take a wxPropertyGridEvent
655 argument.
656
657 @beginEventTable{wxPropertyGridEvent}
658 @event{EVT_PG_SELECTED (id, func)}
659 Respond to wxEVT_PG_SELECTED event, generated when a property selection
660 has been changed, either by user action or by indirect program
661 function. For instance, collapsing a parent property programmatically
662 causes any selected child property to become unselected, and may
663 therefore cause this event to be generated.
664 @event{EVT_PG_CHANGING(id, func)}
665 Respond to wxEVT_PG_CHANGING event, generated when property value
666 is about to be changed by user. Use wxPropertyGridEvent::GetValue()
667 to take a peek at the pending value, and wxPropertyGridEvent::Veto()
668 to prevent change from taking place, if necessary.
669 @event{EVT_PG_HIGHLIGHTED(id, func)}
670 Respond to wxEVT_PG_HIGHLIGHTED event, which occurs when mouse
671 moves over a property. Event's property is NULL if hovered area does
672 not belong to any property.
673 @event{EVT_PG_RIGHT_CLICK(id, func)}
674 Respond to wxEVT_PG_RIGHT_CLICK event, which occurs when property is
675 clicked on with right mouse button.
676 @event{EVT_PG_DOUBLE_CLICK(id, func)}
677 Respond to wxEVT_PG_DOUBLE_CLICK event, which occurs when property is
678 double-clicked onwith left mouse button.
679 @event{EVT_PG_ITEM_COLLAPSED(id, func)}
680 Respond to wxEVT_PG_ITEM_COLLAPSED event, generated when user collapses
681 a property or category..
682 @event{EVT_PG_ITEM_EXPANDED(id, func)}
683 Respond to wxEVT_PG_ITEM_EXPANDED event, generated when user expands
684 a property or category..
685 @event{EVT_PG_LABEL_EDIT_BEGIN(id, func)}
686 Respond to wxEVT_PG_LABEL_EDIT_BEGIN event, generated when is about to
687 begin editing a property label. You can veto this event to prevent the
688 action.
689 @event{EVT_PG_LABEL_EDIT_ENDING(id, func)}
690 Respond to wxEVT_PG_LABEL_EDIT_ENDING event, generated when is about to
691 end editing of a property label. You can veto this event to prevent the
692 action.
693 @event{EVT_PG_COL_BEGIN_DRAG(id, func)}
694 Respond to wxEVT_PG_COL_BEGIN_DRAG event, generated when user
695 starts resizing a column - can be vetoed.
696 @event{EVT_PG_COL_DRAGGING,(id, func)}
697 Respond to wxEVT_PG_COL_DRAGGING, event, generated when a
698 column resize by user is in progress. This event is also generated
699 when user double-clicks the splitter in order to recenter
700 it.
701 @event{EVT_PG_COL_END_DRAG(id, func)}
702 Respond to wxEVT_PG_COL_END_DRAG event, generated after column
703 resize by user has finished.
704 @endEventTable
705
706 @remarks
707
708 - Use Freeze() and Thaw() respectively to disable and enable drawing. This
709 will also delay sorting etc. miscellaneous calculations to the last
710 possible moment.
711
712 @library{wxpropgrid}
713 @category{propgrid}
714 */
715 class WXDLLIMPEXP_PROPGRID
716 wxPropertyGrid : public wxScrolledWindow, public wxPropertyGridInterface
717 {
718 friend class wxPropertyGridEvent;
719 friend class wxPropertyGridPageState;
720 friend class wxPropertyGridInterface;
721 friend class wxPropertyGridManager;
722 friend class wxPGHeaderCtrl;
723
724 DECLARE_DYNAMIC_CLASS(wxPropertyGrid)
725 public:
726
727 #ifndef SWIG
728 /**
729 Two step constructor.
730
731 Call Create when this constructor is called to build up the
732 wxPropertyGrid
733 */
734 wxPropertyGrid();
735 #endif
736
737 /** The default constructor. The styles to be used are styles valid for
738 the wxWindow and wxScrolledWindow.
739
740 @see @link wndflags Additional Window Styles @endlink
741 */
742 wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY,
743 const wxPoint& pos = wxDefaultPosition,
744 const wxSize& size = wxDefaultSize,
745 long style = wxPG_DEFAULT_STYLE,
746 const wxString& name = wxPropertyGridNameStr );
747
748 /** Destructor */
749 virtual ~wxPropertyGrid();
750
751 /** Adds given key combination to trigger given action.
752
753 Here is a sample code to make Enter key press move focus to
754 the next property.
755
756 @code
757 propGrid->AddActionTrigger(wxPG_ACTION_NEXT_PROPERTY,
758 WXK_RETURN);
759 propGrid->DedicateKey(WXK_RETURN);
760 @endcode
761
762 @param action
763 Which action to trigger. See @link pgactions List of list of
764 wxPropertyGrid actions@endlink.
765 */
766 void AddActionTrigger( int action, int keycode, int modifiers = 0 );
767
768 /**
769 Dedicates a specific keycode to wxPropertyGrid. This means that such
770 key presses will not be redirected to editor controls.
771
772 Using this function allows, for example, navigation between
773 properties using arrow keys even when the focus is in the editor
774 control.
775 */
776 void DedicateKey( int keycode )
777 {
778 m_dedicatedKeys.push_back(keycode);
779 }
780
781 /**
782 This static function enables or disables automatic use of
783 wxGetTranslation for following strings: wxEnumProperty list labels,
784 wxFlagsProperty sub-property labels.
785
786 Default is false.
787 */
788 static void AutoGetTranslation( bool enable );
789
790 /**
791 Changes value of a property, as if from an editor.
792
793 Use this instead of SetPropertyValue() if you need the value to run
794 through validation process, and also send the property change event.
795
796 @return
797 Returns true if value was successfully changed.
798 */
799 bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue );
800
801 /**
802 Centers the splitter.
803
804 @param enableAutoResizing
805 If @true, automatic column resizing is enabled (only applicapple
806 if window style wxPG_SPLITTER_AUTO_CENTER is used).
807 */
808 void CenterSplitter( bool enableAutoResizing = false );
809
810 /** Deletes all properties.
811 */
812 virtual void Clear();
813
814 /** Clears action triggers for given action.
815 @param action
816 Which action to trigger. See @link pgactions List of list of
817 wxPropertyGrid actions@endlink.
818 */
819 void ClearActionTriggers( int action );
820
821 /** Forces updating the value of property from the editor control.
822
823 Note that wxEVT_PG_CHANGING and wxEVT_PG_CHANGED are dispatched using
824 ProcessEvent, meaning your event handlers will be called immediately.
825
826 @return
827 Returns true if anything was changed.
828 */
829 virtual bool CommitChangesFromEditor( wxUint32 flags = 0 );
830
831 /**
832 Two step creation.
833
834 Whenever the control is created without any parameters, use Create to
835 actually create it. Don't access the control's public methods before
836 this is called @see @link wndflags Additional Window Styles@endlink
837 */
838 bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
839 const wxPoint& pos = wxDefaultPosition,
840 const wxSize& size = wxDefaultSize,
841 long style = wxPG_DEFAULT_STYLE,
842 const wxString& name = wxPropertyGridNameStr );
843
844 /**
845 Call when editor widget's contents is modified.
846
847 For example, this is called when changes text in wxTextCtrl (used in
848 wxStringProperty and wxIntProperty).
849
850 @remarks
851 This function should only be called by custom properties.
852
853 @see wxPGProperty::OnEvent()
854 */
855 void EditorsValueWasModified() { m_iFlags |= wxPG_FL_VALUE_MODIFIED; }
856
857 /** Reverse of EditorsValueWasModified().
858
859 @remarks
860 This function should only be called by custom properties.
861 */
862 void EditorsValueWasNotModified()
863 {
864 m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED);
865 }
866
867 /**
868 Enables or disables (shows/hides) categories according to parameter
869 enable.
870 */
871 bool EnableCategories( bool enable );
872
873 /** Scrolls and/or expands items to ensure that the given item is visible.
874 Returns true if something was actually done.
875 */
876 bool EnsureVisible( wxPGPropArg id );
877
878 /**
879 Reduces column sizes to minimum possible that contents are still
880 visibly (naturally some margin space will be applied as well).
881
882 @return
883 Minimum size for the grid to still display everything.
884
885 @remarks
886 Does not work well with wxPG_SPLITTER_AUTO_CENTER window style.
887
888 This function only works properly if grid size prior to call was already
889 fairly large.
890
891 Note that you can also get calculated column widths by calling
892 GetState->GetColumnWidth() immediately after this function returns.
893 */
894 wxSize FitColumns()
895 {
896 wxSize sz = m_pState->DoFitColumns();
897 return sz;
898 }
899
900 /**
901 Returns wxWindow that the properties are painted on, and which should
902 be used as the parent for editor controls.
903 */
904 wxWindow* GetPanel()
905 {
906 return this;
907 }
908
909 /** Returns current category caption background colour. */
910 wxColour GetCaptionBackgroundColour() const { return m_colCapBack; }
911
912 wxFont& GetCaptionFont() { return m_captionFont; }
913
914 const wxFont& GetCaptionFont() const { return m_captionFont; }
915
916 /** Returns current category caption text colour. */
917 wxColour GetCaptionForegroundColour() const { return m_colCapFore; }
918
919 /** Returns current cell background colour. */
920 wxColour GetCellBackgroundColour() const { return m_colPropBack; }
921
922 /** Returns current cell text colour when disabled. */
923 wxColour GetCellDisabledTextColour() const { return m_colDisPropFore; }
924
925 /** Returns current cell text colour. */
926 wxColour GetCellTextColour() const { return m_colPropFore; }
927
928 /**
929 Returns number of columns currently on grid.
930 */
931 unsigned int GetColumnCount() const
932 {
933 return (unsigned int) m_pState->m_colWidths.size();
934 }
935
936 /** Returns colour of empty space below properties. */
937 wxColour GetEmptySpaceColour() const { return m_colEmptySpace; }
938
939 /** Returns height of highest characters of used font. */
940 int GetFontHeight() const { return m_fontHeight; }
941
942 /** Returns pointer to itself. Dummy function that enables same kind
943 of code to use wxPropertyGrid and wxPropertyGridManager.
944 */
945 wxPropertyGrid* GetGrid() { return this; }
946
947 /** Returns rectangle of custom paint image.
948 */
949 wxRect GetImageRect( wxPGProperty* p, int item ) const;
950
951 /** Returns size of the custom paint image in front of property.
952 If no argument is given, returns preferred size.
953 */
954 wxSize GetImageSize( wxPGProperty* p = NULL, int item = -1 ) const;
955
956 //@{
957 /** Returns last item which could be iterated using given flags.
958 @param flags
959 See @ref propgrid_iterator_flags.
960 */
961 wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT )
962 {
963 return m_pState->GetLastItem(flags);
964 }
965
966 const wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) const
967 {
968 return m_pState->GetLastItem(flags);
969 }
970 //@}
971
972 /** Returns colour of lines between cells. */
973 wxColour GetLineColour() const { return m_colLine; }
974
975 /** Returns background colour of margin. */
976 wxColour GetMarginColour() const { return m_colMargin; }
977
978 /** Returns margin width. */
979 int GetMarginWidth() const { return m_marginWidth; }
980
981 /**
982 Returns most up-to-date value of selected property. This will return
983 value different from GetSelectedProperty()->GetValue() only when text
984 editor is activate and string edited by user represents valid,
985 uncommitted property value.
986 */
987 wxVariant GetUncommittedPropertyValue();
988
989 /** Returns "root property". It does not have name, etc. and it is not
990 visible. It is only useful for accessing its children.
991 */
992 wxPGProperty* GetRoot() const { return m_pState->m_properties; }
993
994 /** Returns height of a single grid row (in pixels). */
995 int GetRowHeight() const { return m_lineHeight; }
996
997 /** Returns currently selected property. */
998 wxPGProperty* GetSelectedProperty() const { return GetSelection(); }
999
1000 /** Returns current selection background colour. */
1001 wxColour GetSelectionBackgroundColour() const { return m_colSelBack; }
1002
1003 /** Returns current selection text colour. */
1004 wxColour GetSelectionForegroundColour() const { return m_colSelFore; }
1005
1006 /**
1007 Returns current splitter x position.
1008 */
1009 int GetSplitterPosition( unsigned int splitterIndex = 0 ) const
1010 {
1011 return m_pState->DoGetSplitterPosition(splitterIndex);
1012 }
1013
1014 /** Returns wxTextCtrl active in currently selected property, if any. Takes
1015 into account wxOwnerDrawnComboBox.
1016 */
1017 wxTextCtrl* GetEditorTextCtrl() const;
1018
1019 wxPGValidationInfo& GetValidationInfo()
1020 {
1021 return m_validationInfo;
1022 }
1023
1024 /** Returns current vertical spacing. */
1025 int GetVerticalSpacing() const { return (int)m_vspacing; }
1026
1027 /**
1028 Returns @true if a property editor control has focus.
1029 */
1030 bool IsEditorFocused() const;
1031
1032 /** Returns true if editor's value was marked modified.
1033 */
1034 bool IsEditorsValueModified() const
1035 { return ( m_iFlags & wxPG_FL_VALUE_MODIFIED ) ? true : false; }
1036
1037 /**
1038 Returns information about arbitrary position in the grid.
1039
1040 @param pt
1041 Coordinates in the virtual grid space. You may need to use
1042 wxScrolledWindow::CalcScrolledPosition() for translating
1043 wxPropertyGrid client coordinates into something this member
1044 function can use.
1045 */
1046 wxPropertyGridHitTestResult HitTest( const wxPoint& pt ) const;
1047
1048 /** Returns true if any property has been modified by the user. */
1049 bool IsAnyModified() const { return (m_pState->m_anyModified>0); }
1050
1051 /**
1052 Returns true if updating is frozen (ie Freeze() called but not yet
1053 Thaw() ).
1054 */
1055 bool IsFrozen() const { return (m_frozen>0)?true:false; }
1056
1057 /**
1058 It is recommended that you call this function any time your code causes
1059 wxPropertyGrid's top-level parent to change. wxPropertyGrid's OnIdle()
1060 handler should be able to detect most changes, but it is not perfect.
1061
1062 @param newTLP
1063 New top-level parent that is about to be set. Old top-level parent
1064 window should still exist as the current one.
1065
1066 @remarks This function is automatically called from wxPropertyGrid::
1067 Reparent() and wxPropertyGridManager::Reparent(). You only
1068 need to use it if you reparent wxPropertyGrid indirectly.
1069 */
1070 void OnTLPChanging( wxWindow* newTLP );
1071
1072 /** Redraws given property.
1073 */
1074 virtual void RefreshProperty( wxPGProperty* p );
1075
1076 /** Registers a new editor class.
1077 @return
1078 Pointer to the editor class instance that should be used.
1079 */
1080 static wxPGEditor* RegisterEditorClass( wxPGEditor* editor,
1081 bool noDefCheck = false )
1082 {
1083 return DoRegisterEditorClass(editor, wxEmptyString, noDefCheck);
1084 }
1085
1086 static wxPGEditor* DoRegisterEditorClass( wxPGEditor* editorClass,
1087 const wxString& editorName,
1088 bool noDefCheck = false );
1089
1090 /** Resets all colours to the original system values.
1091 */
1092 void ResetColours();
1093
1094 /**
1095 Resets column sizes and splitter positions, based on proportions.
1096
1097 @param enableAutoResizing
1098 If @true, automatic column resizing is enabled (only applicapple
1099 if window style wxPG_SPLITTER_AUTO_CENTER is used).
1100
1101 @see wxPropertyGridInterface::SetColumnProportion()
1102 */
1103 void ResetColumnSizes( bool enableAutoResizing = false );
1104
1105 /**
1106 Selects a property.
1107 Editor widget is automatically created, but not focused unless focus is
1108 true.
1109
1110 @param id
1111 Property to select.
1112
1113 @return
1114 True if selection finished successfully. Usually only fails if
1115 current value in editor is not valid.
1116
1117 @remarks In wxPropertyGrid 1.4, this member function used to generate
1118 wxEVT_PG_SELECTED. In wxWidgets 2.9 and later, it no longer
1119 does that.
1120
1121 @remarks This clears any previous selection.
1122 */
1123 bool SelectProperty( wxPGPropArg id, bool focus = false );
1124
1125 /**
1126 Set entire new selection from given list of properties.
1127 */
1128 void SetSelection( const wxArrayPGProperty& newSelection )
1129 {
1130 DoSetSelection( newSelection, wxPG_SEL_DONT_SEND_EVENT );
1131 }
1132
1133 /**
1134 Adds given property into selection. If wxPG_EX_MULTIPLE_SELECTION
1135 extra style is not used, then this has same effect as
1136 calling SelectProperty().
1137
1138 @remarks Multiple selection is not supported for categories. This
1139 means that if you have properties selected, you cannot
1140 add category to selection, and also if you have category
1141 selected, you cannot add other properties to selection.
1142 This member function will fail silently in these cases,
1143 even returning true.
1144 */
1145 bool AddToSelection( wxPGPropArg id )
1146 {
1147 wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
1148 return DoAddToSelection(p, wxPG_SEL_DONT_SEND_EVENT);
1149 }
1150
1151 /**
1152 Removes given property from selection. If property is not selected,
1153 an assertion failure will occur.
1154 */
1155 bool RemoveFromSelection( wxPGPropArg id )
1156 {
1157 wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
1158 return DoRemoveFromSelection(p, wxPG_SEL_DONT_SEND_EVENT);
1159 }
1160
1161 /**
1162 Makes given column editable by user.
1163
1164 @param editable
1165 Using @false here will disable column from being editable.
1166 */
1167 void MakeColumnEditable( unsigned int column, bool editable = true );
1168
1169 /**
1170 Creates label editor wxTextCtrl for given column, for property
1171 that is currently selected. When multiple selection is
1172 enabled, this applies to whatever property GetSelection()
1173 returns.
1174
1175 @param colIndex
1176 Which column's label to edit. Note that you should not
1177 use value 1, which is reserved for property value
1178 column.
1179
1180 @see EndLabelEdit(), MakeColumnEditable()
1181 */
1182 void BeginLabelEdit( unsigned int column = 0 )
1183 {
1184 DoBeginLabelEdit(column, wxPG_SEL_DONT_SEND_EVENT);
1185 }
1186
1187 /**
1188 Destroys label editor wxTextCtrl, if any.
1189
1190 @param commit
1191 Use @true (default) to store edited label text in
1192 property cell data.
1193
1194 @see BeginLabelEdit(), MakeColumnEditable()
1195 */
1196 void EndLabelEdit( bool commit = true )
1197 {
1198 DoEndLabelEdit(commit, wxPG_SEL_DONT_SEND_EVENT);
1199 }
1200
1201 /**
1202 Returns currently active label editor, NULL if none.
1203 */
1204 wxTextCtrl* GetLabelEditor() const
1205 {
1206 return m_labelEditor;
1207 }
1208
1209 /** Sets category caption background colour. */
1210 void SetCaptionBackgroundColour(const wxColour& col);
1211
1212 /** Sets category caption text colour. */
1213 void SetCaptionTextColour(const wxColour& col);
1214
1215 /** Sets default cell background colour - applies to property cells.
1216 Note that appearance of editor widgets may not be affected.
1217 */
1218 void SetCellBackgroundColour(const wxColour& col);
1219
1220 /** Sets cell text colour for disabled properties.
1221 */
1222 void SetCellDisabledTextColour(const wxColour& col);
1223
1224 /** Sets default cell text colour - applies to property name and value text.
1225 Note that appearance of editor widgets may not be affected.
1226 */
1227 void SetCellTextColour(const wxColour& col);
1228
1229 /** Set number of columns (2 or more).
1230 */
1231 void SetColumnCount( int colCount )
1232 {
1233 m_pState->SetColumnCount(colCount);
1234 Refresh();
1235 }
1236
1237 /**
1238 Sets the 'current' category - Append will add non-category properties
1239 under it.
1240 */
1241 void SetCurrentCategory( wxPGPropArg id )
1242 {
1243 wxPG_PROP_ARG_CALL_PROLOG()
1244 wxPropertyCategory* pc = wxDynamicCast(p, wxPropertyCategory);
1245 wxASSERT(pc);
1246 m_pState->m_currentCategory = pc;
1247 }
1248
1249 /** Sets colour of empty space below properties. */
1250 void SetEmptySpaceColour(const wxColour& col);
1251
1252 /** Sets colour of lines between cells. */
1253 void SetLineColour(const wxColour& col);
1254
1255 /** Sets background colour of margin. */
1256 void SetMarginColour(const wxColour& col);
1257
1258 /**
1259 Sets selection background colour - applies to selected property name
1260 background.
1261 */
1262 void SetSelectionBackgroundColour(const wxColour& col);
1263
1264 /**
1265 Sets selection foreground colour - applies to selected property name
1266 text.
1267 */
1268 void SetSelectionTextColour(const wxColour& col);
1269
1270 /** Sets x coordinate of the splitter.
1271 @remarks
1272 Splitter position cannot exceed grid size, and therefore setting it
1273 during form creation may fail as initial grid size is often smaller
1274 than desired splitter position, especially when sizers are being used.
1275 */
1276 void SetSplitterPosition( int newXPos, int col = 0 )
1277 {
1278 DoSetSplitterPosition(newXPos, col, wxPG_SPLITTER_REFRESH);
1279 }
1280
1281 /**
1282 Sets the property sorting function.
1283
1284 @param sortFunction
1285 The sorting function to be used. It should return a value greater
1286 than 0 if position of p1 is after p2. So, for instance, when
1287 comparing property names, you can use following implementation:
1288
1289 @code
1290 int MyPropertySortFunction(wxPropertyGrid* propGrid,
1291 wxPGProperty* p1,
1292 wxPGProperty* p2)
1293 {
1294 return p1->GetBaseName().compare( p2->GetBaseName() );
1295 }
1296 @endcode
1297
1298 @remarks
1299 Default property sort function sorts properties by their labels
1300 (case-insensitively).
1301
1302 @see GetSortFunction, wxPropertyGridInterface::Sort,
1303 wxPropertyGridInterface::SortChildren
1304 */
1305 void SetSortFunction( wxPGSortCallback sortFunction )
1306 {
1307 m_sortFunction = sortFunction;
1308 }
1309
1310 /**
1311 Returns the property sort function (default is @NULL).
1312
1313 @see SetSortFunction
1314 */
1315 wxPGSortCallback GetSortFunction() const
1316 {
1317 return m_sortFunction;
1318 }
1319
1320 /**
1321 Sets appearance of value cells representing an unspecified property
1322 value. Default appearance is blank.
1323
1324 @remarks If you set the unspecified value to have any
1325 textual representation, then that will override
1326 "InlineHelp" attribute.
1327
1328 @see wxPGProperty::SetValueToUnspecified(),
1329 wxPGProperty::IsValueUnspecified()
1330 */
1331 void SetUnspecifiedValueAppearance( const wxPGCell& cell )
1332 {
1333 m_unspecifiedAppearance = m_propertyDefaultCell;
1334 m_unspecifiedAppearance.MergeFrom(cell);
1335 }
1336
1337 /**
1338 Returns current appearance of unspecified value cells.
1339
1340 @see SetUnspecifiedValueAppearance()
1341 */
1342 const wxPGCell& GetUnspecifiedValueAppearance() const
1343 {
1344 return m_unspecifiedAppearance;
1345 }
1346
1347 /**
1348 Returns (visual) text representation of the unspecified
1349 property value.
1350
1351 @param argFlags For internal use only.
1352 */
1353 wxString GetUnspecifiedValueText( int argFlags = 0 ) const;
1354
1355 /** Set virtual width for this particular page. Width -1 indicates that the
1356 virtual width should be disabled. */
1357 void SetVirtualWidth( int width );
1358
1359 /**
1360 Moves splitter as left as possible, while still allowing all
1361 labels to be shown in full.
1362
1363 @param privateChildrenToo
1364 If @false, will still allow private children to be cropped.
1365 */
1366 void SetSplitterLeft( bool privateChildrenToo = false )
1367 {
1368 m_pState->SetSplitterLeft(privateChildrenToo);
1369 }
1370
1371 /** Sets vertical spacing. Can be 1, 2, or 3 - a value relative to font
1372 height. Value of 2 should be default on most platforms.
1373 */
1374 void SetVerticalSpacing( int vspacing )
1375 {
1376 m_vspacing = (unsigned char)vspacing;
1377 CalculateFontAndBitmapStuff( vspacing );
1378 if ( !m_pState->m_itemsAdded ) Refresh();
1379 }
1380
1381 /** Shows an brief error message that is related to a property. */
1382 void ShowPropertyError( wxPGPropArg id, const wxString& msg )
1383 {
1384 wxPG_PROP_ARG_CALL_PROLOG()
1385 DoShowPropertyError(p, msg);
1386 }
1387
1388 /////////////////////////////////////////////////////////////////
1389 //
1390 // Following methods do not need to be (currently) documented
1391 //
1392 /////////////////////////////////////////////////////////////////
1393
1394 bool HasVirtualWidth() const
1395 { return (m_iFlags & wxPG_FL_HAS_VIRTUAL_WIDTH) ? true : false; }
1396
1397 const wxPGCommonValue* GetCommonValue( unsigned int i ) const
1398 {
1399 return (wxPGCommonValue*) m_commonValues[i];
1400 }
1401
1402 /** Returns number of common values.
1403 */
1404 unsigned int GetCommonValueCount() const
1405 {
1406 return (unsigned int) m_commonValues.size();
1407 }
1408
1409 /** Returns label of given common value.
1410 */
1411 wxString GetCommonValueLabel( unsigned int i ) const
1412 {
1413 wxASSERT( GetCommonValue(i) );
1414 return GetCommonValue(i)->GetLabel();
1415 }
1416
1417 /**
1418 Returns index of common value that will truly change value to
1419 unspecified.
1420 */
1421 int GetUnspecifiedCommonValue() const { return m_cvUnspecified; }
1422
1423 /** Set index of common value that will truly change value to unspecified.
1424 Using -1 will set none to have such effect.
1425 Default is 0.
1426 */
1427 void SetUnspecifiedCommonValue( int index ) { m_cvUnspecified = index; }
1428
1429 /**
1430 Shortcut for creating dialog-caller button. Used, for example, by
1431 wxFontProperty.
1432 @remarks
1433 This should only be called by properties.
1434 */
1435 wxWindow* GenerateEditorButton( const wxPoint& pos, const wxSize& sz );
1436
1437 /** Fixes position of wxTextCtrl-like control (wxSpinCtrl usually
1438 fits as one). Call after control has been created (but before
1439 shown).
1440 */
1441 void FixPosForTextCtrl( wxWindow* ctrl,
1442 unsigned int forColumn = 1,
1443 const wxPoint& offset = wxPoint(0, 0) );
1444
1445 /** Shortcut for creating text editor widget.
1446 @param pos
1447 Same as pos given for CreateEditor.
1448 @param sz
1449 Same as sz given for CreateEditor.
1450 @param value
1451 Initial text for wxTextCtrl.
1452 @param secondary
1453 If right-side control, such as button, also created, then create it
1454 first and pass it as this parameter.
1455 @param extraStyle
1456 Extra style flags to pass for wxTextCtrl.
1457 @remarks
1458 Note that this should generally be called only by new classes derived
1459 from wxPGProperty.
1460 */
1461 wxWindow* GenerateEditorTextCtrl( const wxPoint& pos,
1462 const wxSize& sz,
1463 const wxString& value,
1464 wxWindow* secondary,
1465 int extraStyle = 0,
1466 int maxLen = 0,
1467 unsigned int forColumn = 1 );
1468
1469 /* Generates both textctrl and button.
1470 */
1471 wxWindow* GenerateEditorTextCtrlAndButton( const wxPoint& pos,
1472 const wxSize& sz, wxWindow** psecondary, int limited_editing,
1473 wxPGProperty* property );
1474
1475 /** Generates position for a widget editor dialog box.
1476 @param p
1477 Property for which dialog is positioned.
1478 @param sz
1479 Known or over-approximated size of the dialog.
1480 @return
1481 Position for dialog.
1482 */
1483 wxPoint GetGoodEditorDialogPosition( wxPGProperty* p,
1484 const wxSize& sz );
1485
1486 // Converts escape sequences in src_str to newlines,
1487 // tabs, etc. and copies result to dst_str.
1488 static wxString& ExpandEscapeSequences( wxString& dst_str,
1489 wxString& src_str );
1490
1491 // Converts newlines, tabs, etc. in src_str to escape
1492 // sequences, and copies result to dst_str.
1493 static wxString& CreateEscapeSequences( wxString& dst_str,
1494 wxString& src_str );
1495
1496 /**
1497 Returns rectangle that fully contains properties between and including
1498 p1 and p2. Rectangle is in virtual scrolled window coordinates.
1499 */
1500 wxRect GetPropertyRect( const wxPGProperty* p1,
1501 const wxPGProperty* p2 ) const;
1502
1503 /** Returns pointer to current active primary editor control (NULL if none).
1504 */
1505 wxWindow* GetEditorControl() const;
1506
1507 wxWindow* GetPrimaryEditor() const
1508 {
1509 return GetEditorControl();
1510 }
1511
1512 /**
1513 Returns pointer to current active secondary editor control (NULL if
1514 none).
1515 */
1516 wxWindow* GetEditorControlSecondary() const
1517 {
1518 return m_wndEditor2;
1519 }
1520
1521 /**
1522 Refreshes any active editor control.
1523 */
1524 void RefreshEditor();
1525
1526 // Events from editor controls are forward to this function
1527 void HandleCustomEditorEvent( wxEvent &event );
1528
1529 // Mostly useful for page switching.
1530 void SwitchState( wxPropertyGridPageState* pNewState );
1531
1532 long GetInternalFlags() const { return m_iFlags; }
1533 bool HasInternalFlag( long flag ) const
1534 { return (m_iFlags & flag) ? true : false; }
1535 void SetInternalFlag( long flag ) { m_iFlags |= flag; }
1536 void ClearInternalFlag( long flag ) { m_iFlags &= ~(flag); }
1537 void IncFrozen() { m_frozen++; }
1538 void DecFrozen() { m_frozen--; }
1539
1540 void OnComboItemPaint( const wxPGComboBox* pCb,
1541 int item,
1542 wxDC* pDc,
1543 wxRect& rect,
1544 int flags );
1545
1546 /** Standardized double-to-string conversion.
1547 */
1548 static void DoubleToString( wxString& target,
1549 double value,
1550 int precision,
1551 bool removeZeroes,
1552 wxString* precTemplate );
1553
1554 /**
1555 Call this from wxPGProperty::OnEvent() to cause property value to be
1556 changed after the function returns (with true as return value).
1557 ValueChangeInEvent() must be used if you wish the application to be
1558 able to use wxEVT_PG_CHANGING to potentially veto the given value.
1559 */
1560 void ValueChangeInEvent( wxVariant variant )
1561 {
1562 m_changeInEventValue = variant;
1563 m_iFlags |= wxPG_FL_VALUE_CHANGE_IN_EVENT;
1564 }
1565
1566 /**
1567 You can use this member function, for instance, to detect in
1568 wxPGProperty::OnEvent() if wxPGProperty::SetValueInEvent() was
1569 already called in wxPGEditor::OnEvent(). It really only detects
1570 if was value was changed using wxPGProperty::SetValueInEvent(), which
1571 is usually used when a 'picker' dialog is displayed. If value was
1572 written by "normal means" in wxPGProperty::StringToValue() or
1573 IntToValue(), then this function will return false (on the other hand,
1574 wxPGProperty::OnEvent() is not even called in those cases).
1575 */
1576 bool WasValueChangedInEvent() const
1577 {
1578 return (m_iFlags & wxPG_FL_VALUE_CHANGE_IN_EVENT) ? true : false;
1579 }
1580
1581 /** Returns true if given event is from first of an array of buttons
1582 (as can be in case when wxPGMultiButton is used).
1583 */
1584 bool IsMainButtonEvent( const wxEvent& event )
1585 {
1586 return (event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
1587 && (m_wndSecId == event.GetId());
1588 }
1589
1590 /** Pending value is expected to be passed in PerformValidation().
1591 */
1592 virtual bool DoPropertyChanged( wxPGProperty* p,
1593 unsigned int selFlags = 0 );
1594
1595 /** Called when validation for given property fails.
1596 @param invalidValue
1597 Value which failed in validation.
1598 @return
1599 Return true if user is allowed to change to another property even
1600 if current has invalid value.
1601 @remarks
1602 To add your own validation failure behavior, override
1603 wxPropertyGrid::DoOnValidationFailure().
1604 */
1605 bool OnValidationFailure( wxPGProperty* property,
1606 wxVariant& invalidValue );
1607
1608 /** Called to indicate property and editor has valid value now.
1609 */
1610 void OnValidationFailureReset( wxPGProperty* property )
1611 {
1612 if ( property && property->HasFlag(wxPG_PROP_INVALID_VALUE) )
1613 {
1614 DoOnValidationFailureReset(property);
1615 property->ClearFlag(wxPG_PROP_INVALID_VALUE);
1616 }
1617 m_validationInfo.m_failureMessage.clear();
1618 }
1619
1620 /**
1621 Override in derived class to display error messages in custom manner
1622 (these message usually only result from validation failure).
1623
1624 @remarks If you implement this, then you also need to implement
1625 DoHidePropertyError() - possibly to do nothing, if error
1626 does not need hiding (e.g. it was logged or shown in a
1627 message box).
1628
1629 @see DoHidePropertyError()
1630 */
1631 virtual void DoShowPropertyError( wxPGProperty* property,
1632 const wxString& msg );
1633
1634 /**
1635 Override in derived class to hide an error displayed by
1636 DoShowPropertyError().
1637
1638 @see DoShowPropertyError()
1639 */
1640 virtual void DoHidePropertyError( wxPGProperty* property );
1641
1642 #if wxUSE_STATUSBAR
1643 /**
1644 Return wxStatusBar that is used by this wxPropertyGrid. You can
1645 reimplement this member function in derived class to override
1646 the default behavior of using the top-level wxFrame's status
1647 bar, if any.
1648 */
1649 virtual wxStatusBar* GetStatusBar();
1650 #endif
1651
1652 /** Override to customize property validation failure behavior.
1653 @param invalidValue
1654 Value which failed in validation.
1655 @return
1656 Return true if user is allowed to change to another property even
1657 if current has invalid value.
1658 */
1659 virtual bool DoOnValidationFailure( wxPGProperty* property,
1660 wxVariant& invalidValue );
1661
1662 /** Override to customize resetting of property validation failure status.
1663 @remarks
1664 Property is guaranteed to have flag wxPG_PROP_INVALID_VALUE set.
1665 */
1666 virtual void DoOnValidationFailureReset( wxPGProperty* property );
1667
1668 int GetSpacingY() const { return m_spacingy; }
1669
1670 /**
1671 Must be called in wxPGEditor::CreateControls() if primary editor window
1672 is wxTextCtrl, just before textctrl is created.
1673 @param text
1674 Initial text value of created wxTextCtrl.
1675 */
1676 void SetupTextCtrlValue( const wxString text ) { m_prevTcValue = text; }
1677
1678 /**
1679 Unfocuses or closes editor if one was open, but does not deselect
1680 property.
1681 */
1682 bool UnfocusEditor();
1683
1684 virtual void SetWindowStyleFlag( long style );
1685
1686 void DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 );
1687
1688 void DrawItem( wxPGProperty* p )
1689 {
1690 DrawItems(p,p);
1691 }
1692
1693 virtual void DrawItemAndChildren( wxPGProperty* p );
1694
1695 /**
1696 Draws item, children, and consequtive parents as long as category is
1697 not met.
1698 */
1699 void DrawItemAndValueRelated( wxPGProperty* p );
1700
1701 protected:
1702
1703 /**
1704 wxPropertyGridPageState used by the grid is created here.
1705
1706 If grid is used in wxPropertyGridManager, there is no point overriding
1707 this - instead, set custom wxPropertyGridPage classes.
1708 */
1709 virtual wxPropertyGridPageState* CreateState() const;
1710
1711 enum PerformValidationFlags
1712 {
1713 SendEvtChanging = 0x0001,
1714 IsStandaloneValidation = 0x0002 // Not called in response to event
1715 };
1716
1717 /**
1718 Runs all validation functionality (includes sending wxEVT_PG_CHANGING).
1719 Returns true if all tests passed. Implement in derived class to
1720 add additional validation behavior.
1721 */
1722 virtual bool PerformValidation( wxPGProperty* p,
1723 wxVariant& pendingValue,
1724 int flags = SendEvtChanging );
1725
1726 public:
1727
1728 // Control font changer helper.
1729 void SetCurControlBoldFont();
1730
1731 wxPGCell& GetPropertyDefaultCell()
1732 {
1733 return m_propertyDefaultCell;
1734 }
1735
1736 wxPGCell& GetCategoryDefaultCell()
1737 {
1738 return m_categoryDefaultCell;
1739 }
1740
1741 //
1742 // Public methods for semi-public use
1743 //
1744 bool DoSelectProperty( wxPGProperty* p, unsigned int flags = 0 );
1745
1746 // Overridden functions.
1747 virtual bool Destroy();
1748 // Returns property at given y coordinate (relative to grid's top left).
1749 wxPGProperty* GetItemAtY( int y ) const { return DoGetItemAtY(y); }
1750
1751 virtual void Refresh( bool eraseBackground = true,
1752 const wxRect *rect = (const wxRect *) NULL );
1753 virtual bool SetFont( const wxFont& font );
1754 virtual void Freeze();
1755 virtual void SetExtraStyle( long exStyle );
1756 virtual void Thaw();
1757 virtual bool Reparent( wxWindowBase *newParent );
1758
1759 protected:
1760 virtual wxSize DoGetBestSize() const;
1761
1762 #ifndef wxPG_ICON_WIDTH
1763 wxBitmap *m_expandbmp, *m_collbmp;
1764 #endif
1765
1766 wxCursor *m_cursorSizeWE;
1767
1768 /** wxWindow pointers to editor control(s). */
1769 wxWindow *m_wndEditor;
1770 wxWindow *m_wndEditor2;
1771
1772 #if wxPG_DOUBLE_BUFFER
1773 wxBitmap *m_doubleBuffer;
1774 #endif
1775
1776 /** Local time ms when control was created. */
1777 wxLongLong m_timeCreated;
1778
1779 /** wxPGProperty::OnEvent can change value by setting this. */
1780 wxVariant m_changeInEventValue;
1781
1782 /** Id of m_wndEditor2, or its first child, if any. */
1783 int m_wndSecId;
1784
1785 /** Extra Y spacing between the items. */
1786 int m_spacingy;
1787
1788 /** Control client area width; updated on resize. */
1789 int m_width;
1790
1791 /** Control client area height; updated on resize. */
1792 int m_height;
1793
1794 /** Current non-client width (needed when auto-centering). */
1795 int m_ncWidth;
1796
1797 /** Non-client width (auto-centering helper). */
1798 //int m_fWidth;
1799
1800 /** Previously recorded scroll start position. */
1801 int m_prevVY;
1802
1803 /**
1804 The gutter spacing in front and back of the image.
1805 This determines the amount of spacing in front of each item
1806 */
1807 int m_gutterWidth;
1808
1809 /** Includes separator line. */
1810 int m_lineHeight;
1811
1812 /** Gutter*2 + image width. */
1813 int m_marginWidth;
1814
1815 // y spacing for expand/collapse button.
1816 int m_buttonSpacingY;
1817
1818 /** Extra margin for expanded sub-group items. */
1819 int m_subgroup_extramargin;
1820
1821 /**
1822 The image width of the [+] icon.
1823
1824 This is also calculated in the gutter
1825 */
1826 int m_iconWidth;
1827
1828 #ifndef wxPG_ICON_WIDTH
1829
1830 /**
1831 The image height of the [+] icon.
1832
1833 This is calculated as minimal size and to align
1834 */
1835 int m_iconHeight;
1836 #endif
1837
1838 /** Current cursor id. */
1839 int m_curcursor;
1840
1841 /**
1842 This captionFont is made equal to the font of the wxScrolledWindow.
1843
1844 As extra the bold face is set on it when this is wanted by the user
1845 (see flags)
1846 */
1847 wxFont m_captionFont;
1848
1849 int m_fontHeight; // Height of the font.
1850
1851 /** m_splitterx when drag began. */
1852 int m_startingSplitterX;
1853
1854 /**
1855 Index to splitter currently being dragged (0=one after the first
1856 column).
1857 */
1858 int m_draggedSplitter;
1859
1860 /** Changed property, calculated in PerformValidation(). */
1861 wxPGProperty* m_chgInfo_changedProperty;
1862
1863 /**
1864 Lowest property for which editing happened, but which does not have
1865 aggregate parent
1866 */
1867 wxPGProperty* m_chgInfo_baseChangedProperty;
1868
1869 /** Changed property value, calculated in PerformValidation(). */
1870 wxVariant m_chgInfo_pendingValue;
1871
1872 /** Passed to SetValue. */
1873 wxVariant m_chgInfo_valueList;
1874
1875 /** Validation information. */
1876 wxPGValidationInfo m_validationInfo;
1877
1878 /** Actions and keys that trigger them. */
1879 wxPGHashMapI2I m_actionTriggers;
1880
1881 /** Appearance of currently active editor. */
1882 wxPGCell m_editorAppearance;
1883
1884 /** Appearance of a unspecified value cell. */
1885 wxPGCell m_unspecifiedAppearance;
1886
1887 /** List of properties to be deleted/removed in idle event handler. */
1888 wxArrayPGProperty m_deletedProperties;
1889 wxArrayPGProperty m_removedProperties;
1890
1891 /** List of key codes that will not be handed over to editor controls. */
1892 // FIXME: Make this a hash set once there is template-based wxHashSet.
1893 wxVector<int> m_dedicatedKeys;
1894
1895 //
1896 // Temporary values
1897 //
1898
1899 /** Bits are used to indicate which colours are customized. */
1900 unsigned short m_coloursCustomized;
1901
1902 /** x - m_splitterx. */
1903 signed char m_dragOffset;
1904
1905 /** 0 = not dragging, 1 = drag just started, 2 = drag in progress */
1906 unsigned char m_dragStatus;
1907
1908 /** 0 = margin, 1 = label, 2 = value. */
1909 unsigned char m_mouseSide;
1910
1911 /** True when editor control is focused. */
1912 unsigned char m_editorFocused;
1913
1914 /** 1 if m_latsCaption is also the bottommost caption. */
1915 //unsigned char m_lastCaptionBottomnest;
1916
1917 /** Set to 1 when graphics frozen. */
1918 unsigned char m_frozen;
1919
1920 unsigned char m_vspacing;
1921
1922 // Used to track when Alt/Ctrl+Key was consumed.
1923 unsigned char m_keyComboConsumed;
1924
1925 /** 1 if in DoPropertyChanged() */
1926 bool m_inDoPropertyChanged;
1927
1928 /** 1 if in CommitChangesFromEditor() */
1929 bool m_inCommitChangesFromEditor;
1930
1931 /** 1 if in DoSelectProperty() */
1932 bool m_inDoSelectProperty;
1933
1934 bool m_inOnValidationFailure;
1935
1936 wxPGVFBFlags m_permanentValidationFailureBehavior; // Set by app
1937
1938 // DoEditorValidate() recursion guard
1939 wxRecursionGuardFlag m_validatingEditor;
1940
1941 /** Internal flags - see wxPG_FL_XXX constants. */
1942 wxUint32 m_iFlags;
1943
1944 /** When drawing next time, clear this many item slots at the end. */
1945 int m_clearThisMany;
1946
1947 // Mouse is hovering over this column (index)
1948 unsigned int m_colHover;
1949
1950 // pointer to property that has mouse hovering
1951 wxPGProperty* m_propHover;
1952
1953 // Active label editor
1954 wxTextCtrl* m_labelEditor;
1955
1956 // For which property the label editor is active
1957 wxPGProperty* m_labelEditorProperty;
1958
1959 // EventObject for wxPropertyGridEvents
1960 wxWindow* m_eventObject;
1961
1962 // What (global) window is currently focused (needed to resolve event
1963 // handling mess).
1964 wxWindow* m_curFocused;
1965
1966 // Event currently being sent - NULL if none at the moment
1967 wxPropertyGridEvent* m_processedEvent;
1968
1969 // Last known top-level parent
1970 wxWindow* m_tlp;
1971
1972 // Last closed top-level parent
1973 wxWindow* m_tlpClosed;
1974
1975 // Local time ms when tlp was closed.
1976 wxLongLong m_tlpClosedTime;
1977
1978 // Sort function
1979 wxPGSortCallback m_sortFunction;
1980
1981 // y coordinate of property that mouse hovering
1982 int m_propHoverY;
1983
1984 // Which column's editor is selected (usually 1)?
1985 unsigned int m_selColumn;
1986
1987 // x relative to splitter (needed for resize).
1988 int m_ctrlXAdjust;
1989
1990 // lines between cells
1991 wxColour m_colLine;
1992 // property labels and values are written in this colour
1993 wxColour m_colPropFore;
1994 // or with this colour when disabled
1995 wxColour m_colDisPropFore;
1996 // background for m_colPropFore
1997 wxColour m_colPropBack;
1998 // text color for captions
1999 wxColour m_colCapFore;
2000 // background color for captions
2001 wxColour m_colCapBack;
2002 // foreground for selected property
2003 wxColour m_colSelFore;
2004 // background for selected property (actually use background color when
2005 // control out-of-focus)
2006 wxColour m_colSelBack;
2007 // background colour for margin
2008 wxColour m_colMargin;
2009 // background colour for empty space below the grid
2010 wxColour m_colEmptySpace;
2011
2012 // Default property colours
2013 wxPGCell m_propertyDefaultCell;
2014
2015 // Default property category
2016 wxPGCell m_categoryDefaultCell;
2017
2018 // Backup of selected property's cells
2019 wxVector<wxPGCell> m_propCellsBackup;
2020
2021 // NB: These *cannot* be moved to globals.
2022
2023 // labels when properties use common values
2024 wxVector<wxPGCommonValue*> m_commonValues;
2025
2026 // array of live events
2027 wxVector<wxPropertyGridEvent*> m_liveEvents;
2028
2029 // Which cv selection really sets value to unspecified?
2030 int m_cvUnspecified;
2031
2032 // Used to skip excess text editor events
2033 wxString m_prevTcValue;
2034
2035 protected:
2036
2037 // Sets some members to defaults (called constructors).
2038 void Init1();
2039
2040 // Initializes some members (called by Create and complex constructor).
2041 void Init2();
2042
2043 void OnPaint(wxPaintEvent &event );
2044
2045 // main event receivers
2046 void OnMouseMove( wxMouseEvent &event );
2047 void OnMouseClick( wxMouseEvent &event );
2048 void OnMouseRightClick( wxMouseEvent &event );
2049 void OnMouseDoubleClick( wxMouseEvent &event );
2050 void OnMouseUp( wxMouseEvent &event );
2051 void OnKey( wxKeyEvent &event );
2052 void OnResize( wxSizeEvent &event );
2053
2054 // event handlers
2055 bool HandleMouseMove( int x, unsigned int y, wxMouseEvent &event );
2056 bool HandleMouseClick( int x, unsigned int y, wxMouseEvent &event );
2057 bool HandleMouseRightClick( int x, unsigned int y, wxMouseEvent &event );
2058 bool HandleMouseDoubleClick( int x, unsigned int y, wxMouseEvent &event );
2059 bool HandleMouseUp( int x, unsigned int y, wxMouseEvent &event );
2060 void HandleKeyEvent( wxKeyEvent &event, bool fromChild );
2061
2062 void OnMouseEntry( wxMouseEvent &event );
2063
2064 void OnIdle( wxIdleEvent &event );
2065 void OnFocusEvent( wxFocusEvent &event );
2066 void OnChildFocusEvent( wxChildFocusEvent& event );
2067
2068 bool OnMouseCommon( wxMouseEvent &event, int* px, int *py );
2069 bool OnMouseChildCommon( wxMouseEvent &event, int* px, int *py );
2070
2071 // sub-control event handlers
2072 void OnMouseClickChild( wxMouseEvent &event );
2073 void OnMouseRightClickChild( wxMouseEvent &event );
2074 void OnMouseMoveChild( wxMouseEvent &event );
2075 void OnMouseUpChild( wxMouseEvent &event );
2076 void OnChildKeyDown( wxKeyEvent &event );
2077
2078 void OnCaptureChange( wxMouseCaptureChangedEvent &event );
2079
2080 void OnScrollEvent( wxScrollWinEvent &event );
2081
2082 void OnSysColourChanged( wxSysColourChangedEvent &event );
2083
2084 void OnTLPClose( wxCloseEvent& event );
2085
2086 protected:
2087
2088 bool AddToSelectionFromInputEvent( wxPGProperty* prop,
2089 unsigned int colIndex,
2090 wxMouseEvent* event = NULL,
2091 int selFlags = 0 );
2092
2093 /**
2094 Adjust the centering of the bitmap icons (collapse / expand) when the
2095 caption font changes.
2096
2097 They need to be centered in the middle of the font, so a bit of deltaY
2098 adjustment is needed. On entry, m_captionFont must be set to window
2099 font. It will be modified properly.
2100 */
2101 void CalculateFontAndBitmapStuff( int vspacing );
2102
2103 wxRect GetEditorWidgetRect( wxPGProperty* p, int column ) const;
2104
2105 void CorrectEditorWidgetSizeX();
2106
2107 /** Called in RecalculateVirtualSize() to reposition control
2108 on virtual height changes.
2109 */
2110 void CorrectEditorWidgetPosY();
2111
2112 int DoDrawItems( wxDC& dc,
2113 const wxRect* drawRect,
2114 bool isBuffered ) const;
2115
2116 /** Draws an expand/collapse (ie. +/-) button.
2117 */
2118 virtual void DrawExpanderButton( wxDC& dc, const wxRect& rect,
2119 wxPGProperty* property ) const;
2120
2121 /** Draws items from topitemy to bottomitemy */
2122 void DrawItems( wxDC& dc,
2123 unsigned int topItemY,
2124 unsigned int bottomItemY,
2125 const wxRect* drawRect = NULL );
2126
2127 // Translate wxKeyEvent to wxPG_ACTION_XXX
2128 int KeyEventToActions(wxKeyEvent &event, int* pSecond) const;
2129
2130 int KeyEventToAction(wxKeyEvent &event) const
2131 {
2132 return KeyEventToActions(event, NULL);
2133 }
2134
2135 void ImprovedClientToScreen( int* px, int* py );
2136
2137 // Called by focus event handlers. newFocused is the window that becomes
2138 // focused.
2139 void HandleFocusChange( wxWindow* newFocused );
2140
2141 /** Reloads all non-customized colours from system settings. */
2142 void RegainColours();
2143
2144 virtual bool DoEditorValidate();
2145
2146 // Similar to DoSelectProperty() but also works on columns
2147 // other than 1. Does not active editor if column is not
2148 // editable.
2149 bool DoSelectAndEdit( wxPGProperty* prop,
2150 unsigned int colIndex,
2151 unsigned int selFlags );
2152
2153 void DoSetSelection( const wxArrayPGProperty& newSelection,
2154 int selFlags = 0 );
2155
2156 void DoSetSplitterPosition( int newxpos,
2157 int splitterIndex = 0,
2158 int flags = wxPG_SPLITTER_REFRESH );
2159
2160 bool DoAddToSelection( wxPGProperty* prop,
2161 int selFlags = 0 );
2162
2163 bool DoRemoveFromSelection( wxPGProperty* prop,
2164 int selFlags = 0 );
2165
2166 void DoBeginLabelEdit( unsigned int colIndex, int selFlags = 0 );
2167 void DoEndLabelEdit( bool commit, int selFlags = 0 );
2168 void OnLabelEditorEnterPress( wxCommandEvent& event );
2169 void OnLabelEditorKeyPress( wxKeyEvent& event );
2170
2171 wxPGProperty* DoGetItemAtY( int y ) const;
2172
2173 void DestroyEditorWnd( wxWindow* wnd );
2174 void FreeEditors();
2175
2176 virtual bool DoExpand( wxPGProperty* p, bool sendEvent = false );
2177
2178 virtual bool DoCollapse( wxPGProperty* p, bool sendEvent = false );
2179
2180 // Returns nearest paint visible property (such that will be painted unless
2181 // window is scrolled or resized). If given property is paint visible, then
2182 // it itself will be returned.
2183 wxPGProperty* GetNearestPaintVisible( wxPGProperty* p ) const;
2184
2185 static void RegisterDefaultEditors();
2186
2187 // Sets up basic event handling for child control
2188 void SetupChildEventHandling( wxWindow* wnd );
2189
2190 void CustomSetCursor( int type, bool override = false );
2191
2192 /**
2193 Repositions scrollbar and underlying panel according to changed virtual
2194 size.
2195 */
2196 void RecalculateVirtualSize( int forceXPos = -1 );
2197
2198 void SetEditorAppearance( const wxPGCell& cell,
2199 bool unspecified = false );
2200
2201 void ResetEditorAppearance()
2202 {
2203 wxPGCell cell;
2204 cell.SetEmptyData();
2205 SetEditorAppearance(cell, false);
2206 }
2207
2208 void PrepareAfterItemsAdded();
2209
2210 /**
2211 Send event from the property grid.
2212
2213 Omit the wxPG_SEL_NOVALIDATE flag to allow vetoing the event
2214 */
2215 bool SendEvent( int eventType, wxPGProperty* p,
2216 wxVariant* pValue = NULL,
2217 unsigned int selFlags = wxPG_SEL_NOVALIDATE,
2218 unsigned int column = 1 );
2219
2220 void SetFocusOnCanvas();
2221
2222 bool DoHideProperty( wxPGProperty* p, bool hide, int flags );
2223
2224 private:
2225
2226 bool ButtonTriggerKeyTest( int action, wxKeyEvent& event );
2227
2228 DECLARE_EVENT_TABLE()
2229 };
2230
2231 // -----------------------------------------------------------------------
2232 //
2233 // Bunch of inlines that need to resolved after all classes have been defined.
2234 //
2235
2236 inline bool wxPropertyGridPageState::IsDisplayed() const
2237 {
2238 return ( this == m_pPropGrid->GetState() );
2239 }
2240
2241 inline unsigned int wxPropertyGridPageState::GetActualVirtualHeight() const
2242 {
2243 return DoGetRoot()->GetChildrenHeight(GetGrid()->GetRowHeight());
2244 }
2245
2246 inline wxString wxPGProperty::GetHintText() const
2247 {
2248 wxVariant vHintText = GetAttribute(wxPGGlobalVars->m_strHint);
2249
2250 #if wxPG_COMPATIBILITY_1_4
2251 // Try the old, deprecated "InlineHelp"
2252 if ( vHintText.IsNull() )
2253 vHintText = GetAttribute(wxPGGlobalVars->m_strInlineHelp);
2254 #endif
2255
2256 if ( !vHintText.IsNull() )
2257 return vHintText.GetString();
2258
2259 return wxEmptyString;
2260 }
2261
2262 inline int wxPGProperty::GetDisplayedCommonValueCount() const
2263 {
2264 if ( HasFlag(wxPG_PROP_USES_COMMON_VALUE) )
2265 {
2266 wxPropertyGrid* pg = GetGrid();
2267 if ( pg )
2268 return (int) pg->GetCommonValueCount();
2269 }
2270 return 0;
2271 }
2272
2273 inline void wxPGProperty::SetDefaultValue( wxVariant& value )
2274 {
2275 SetAttribute(wxPG_ATTR_DEFAULT_VALUE, value);
2276 }
2277
2278 inline void wxPGProperty::SetEditor( const wxString& editorName )
2279 {
2280 m_customEditor = wxPropertyGridInterface::GetEditorByName(editorName);
2281 }
2282
2283 inline bool wxPGProperty::SetMaxLength( int maxLen )
2284 {
2285 return GetGrid()->SetPropertyMaxLength(this,maxLen);
2286 }
2287
2288 // -----------------------------------------------------------------------
2289
2290 #define wxPG_BASE_EVT_PRE_ID 1775
2291
2292 #ifndef SWIG
2293
2294 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_SELECTED, wxPropertyGridEvent );
2295 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_CHANGING, wxPropertyGridEvent );
2296 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_CHANGED, wxPropertyGridEvent );
2297 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_HIGHLIGHTED, wxPropertyGridEvent );
2298 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_RIGHT_CLICK, wxPropertyGridEvent );
2299 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_PAGE_CHANGED, wxPropertyGridEvent );
2300 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_ITEM_COLLAPSED, wxPropertyGridEvent );
2301 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_ITEM_EXPANDED, wxPropertyGridEvent );
2302 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_DOUBLE_CLICK, wxPropertyGridEvent );
2303 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID,
2304 wxEVT_PG_LABEL_EDIT_BEGIN, wxPropertyGridEvent );
2305 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID,
2306 wxEVT_PG_LABEL_EDIT_ENDING, wxPropertyGridEvent );
2307 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID,
2308 wxEVT_PG_COL_BEGIN_DRAG, wxPropertyGridEvent );
2309 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID,
2310 wxEVT_PG_COL_DRAGGING, wxPropertyGridEvent );
2311 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID,
2312 wxEVT_PG_COL_END_DRAG, wxPropertyGridEvent );
2313
2314 #else
2315 enum {
2316 wxEVT_PG_SELECTED = wxPG_BASE_EVT_PRE_ID,
2317 wxEVT_PG_CHANGING,
2318 wxEVT_PG_CHANGED,
2319 wxEVT_PG_HIGHLIGHTED,
2320 wxEVT_PG_RIGHT_CLICK,
2321 wxEVT_PG_PAGE_CHANGED,
2322 wxEVT_PG_ITEM_COLLAPSED,
2323 wxEVT_PG_ITEM_EXPANDED,
2324 wxEVT_PG_DOUBLE_CLICK,
2325 wxEVT_PG_LABEL_EDIT_BEGIN,
2326 wxEVT_PG_LABEL_EDIT_ENDING,
2327 wxEVT_PG_COL_BEGIN_DRAG,
2328 wxEVT_PG_COL_DRAGGING,
2329 wxEVT_PG_COL_END_DRAG
2330 };
2331 #endif
2332
2333
2334 #define wxPG_BASE_EVT_TYPE wxEVT_PG_SELECTED
2335 #define wxPG_MAX_EVT_TYPE (wxPG_BASE_EVT_TYPE+30)
2336
2337
2338 #ifndef SWIG
2339 typedef void (wxEvtHandler::*wxPropertyGridEventFunction)(wxPropertyGridEvent&);
2340
2341 #define EVT_PG_SELECTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_SELECTED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2342 #define EVT_PG_CHANGING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2343 #define EVT_PG_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2344 #define EVT_PG_HIGHLIGHTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_HIGHLIGHTED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2345 #define EVT_PG_RIGHT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_RIGHT_CLICK, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2346 #define EVT_PG_DOUBLE_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_DOUBLE_CLICK, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2347 #define EVT_PG_PAGE_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_PAGE_CHANGED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2348 #define EVT_PG_ITEM_COLLAPSED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_COLLAPSED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2349 #define EVT_PG_ITEM_EXPANDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_EXPANDED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2350 #define EVT_PG_LABEL_EDIT_BEGIN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_LABEL_EDIT_BEGIN, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2351 #define EVT_PG_LABEL_EDIT_ENDING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_LABEL_EDIT_ENDING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2352 #define EVT_PG_COL_BEGIN_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_COL_BEGIN_DRAG, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2353 #define EVT_PG_COL_DRAGGING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_COL_DRAGGING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2354 #define EVT_PG_COL_END_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_COL_END_DRAG, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ),
2355
2356 #define wxPropertyGridEventHandler(fn) \
2357 wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn )
2358
2359 #endif
2360
2361
2362 /** @class wxPropertyGridEvent
2363
2364 A propertygrid event holds information about events associated with
2365 wxPropertyGrid objects.
2366
2367 @library{wxpropgrid}
2368 @category{propgrid}
2369 */
2370 class WXDLLIMPEXP_PROPGRID wxPropertyGridEvent : public wxCommandEvent
2371 {
2372 public:
2373
2374 /** Constructor. */
2375 wxPropertyGridEvent(wxEventType commandType=0, int id=0);
2376
2377 /** Copy constructor. */
2378 wxPropertyGridEvent(const wxPropertyGridEvent& event);
2379
2380 /** Destructor. */
2381 ~wxPropertyGridEvent();
2382
2383 /** Copyer. */
2384 virtual wxEvent* Clone() const;
2385
2386 /**
2387 Returns the column index associated with this event.
2388 For the column dragging events, it is the column to the left
2389 of the splitter being dragged
2390 */
2391 unsigned int GetColumn() const
2392 {
2393 return m_column;
2394 }
2395
2396 wxPGProperty* GetMainParent() const
2397 {
2398 wxASSERT(m_property);
2399 return m_property->GetMainParent();
2400 }
2401
2402 /** Returns id of associated property. */
2403 wxPGProperty* GetProperty() const
2404 {
2405 return m_property;
2406 }
2407
2408 wxPGValidationInfo& GetValidationInfo()
2409 {
2410 wxASSERT(m_validationInfo);
2411 return *m_validationInfo;
2412 }
2413
2414 /** Returns true if you can veto the action that the event is signaling.
2415 */
2416 bool CanVeto() const { return m_canVeto; }
2417
2418 /**
2419 Call this from your event handler to veto action that the event is
2420 signaling.
2421
2422 You can only veto a shutdown if wxPropertyGridEvent::CanVeto returns
2423 true.
2424 @remarks
2425 Currently only wxEVT_PG_CHANGING supports vetoing.
2426 */
2427 void Veto( bool veto = true ) { m_wasVetoed = veto; }
2428
2429 /**
2430 Returns name of the associated property.
2431
2432 @remarks Property name is stored in event, so it remains
2433 accessible even after the associated property or
2434 the property grid has been deleted.
2435 */
2436 wxString GetPropertyName() const
2437 {
2438 return m_propertyName;
2439 }
2440
2441 /**
2442 Returns value of the associated property. Works for all event
2443 types, but for wxEVT_PG_CHANGING this member function returns
2444 the value that is pending, so you can call Veto() if the
2445 value is not satisfactory.
2446
2447 @remarks Property value is stored in event, so it remains
2448 accessible even after the associated property or
2449 the property grid has been deleted.
2450 */
2451 wxVariant GetPropertyValue() const
2452 {
2453 if ( m_validationInfo )
2454 return m_validationInfo->GetValue();
2455 return m_value;
2456 }
2457
2458 /**
2459 Returns value of the associated property.
2460
2461 @see GetPropertyValue
2462 */
2463 wxVariant GetValue() const
2464 {
2465 return GetPropertyValue();
2466 }
2467
2468 /**
2469 Set override validation failure behavior.
2470
2471 Only effective if Veto was also called, and only allowed if event type
2472 is wxEVT_PG_CHANGING.
2473 */
2474 void SetValidationFailureBehavior( wxPGVFBFlags flags )
2475 {
2476 wxASSERT( GetEventType() == wxEVT_PG_CHANGING );
2477 m_validationInfo->SetFailureBehavior( flags );
2478 }
2479
2480 /** Sets custom failure message for this time only. Only applies if
2481 wxPG_VFB_SHOW_MESSAGE is set in validation failure flags.
2482 */
2483 void SetValidationFailureMessage( const wxString& message )
2484 {
2485 wxASSERT( GetEventType() == wxEVT_PG_CHANGING );
2486 m_validationInfo->SetFailureMessage( message );
2487 }
2488
2489 wxPGVFBFlags GetValidationFailureBehavior() const
2490 {
2491 wxASSERT( GetEventType() == wxEVT_PG_CHANGING );
2492 return m_validationInfo->GetFailureBehavior();
2493 }
2494
2495 void SetColumn( unsigned int column )
2496 {
2497 m_column = column;
2498 }
2499
2500 void SetCanVeto( bool canVeto ) { m_canVeto = canVeto; }
2501 bool WasVetoed() const { return m_wasVetoed; }
2502
2503 /** Changes the associated property. */
2504 void SetProperty( wxPGProperty* p )
2505 {
2506 m_property = p;
2507 if ( p )
2508 m_propertyName = p->GetName();
2509 }
2510
2511 void SetPropertyValue( wxVariant value )
2512 {
2513 m_value = value;
2514 }
2515
2516 void SetPropertyGrid( wxPropertyGrid* pg )
2517 {
2518 m_pg = pg;
2519 OnPropertyGridSet();
2520 }
2521
2522 void SetupValidationInfo()
2523 {
2524 wxASSERT(m_pg);
2525 wxASSERT( GetEventType() == wxEVT_PG_CHANGING );
2526 m_validationInfo = &m_pg->GetValidationInfo();
2527 m_value = m_validationInfo->GetValue();
2528 }
2529
2530 private:
2531 void Init();
2532 void OnPropertyGridSet();
2533 DECLARE_DYNAMIC_CLASS(wxPropertyGridEvent)
2534
2535 wxPGProperty* m_property;
2536 wxPropertyGrid* m_pg;
2537 wxPGValidationInfo* m_validationInfo;
2538
2539 wxString m_propertyName;
2540 wxVariant m_value;
2541
2542 unsigned int m_column;
2543
2544 bool m_canVeto;
2545 bool m_wasVetoed;
2546 };
2547
2548
2549 // -----------------------------------------------------------------------
2550
2551 /** @class wxPropertyGridPopulator
2552 @ingroup classes
2553 Allows populating wxPropertyGrid from arbitrary text source.
2554 */
2555 class WXDLLIMPEXP_PROPGRID wxPropertyGridPopulator
2556 {
2557 public:
2558 /** Default constructor.
2559 */
2560 wxPropertyGridPopulator();
2561
2562 /** Destructor. */
2563 virtual ~wxPropertyGridPopulator();
2564
2565 void SetState( wxPropertyGridPageState* state );
2566
2567 void SetGrid( wxPropertyGrid* pg );
2568
2569 /** Appends a new property under bottommost parent.
2570 @param propClass
2571 Property class as string.
2572 */
2573 wxPGProperty* Add( const wxString& propClass,
2574 const wxString& propLabel,
2575 const wxString& propName,
2576 const wxString* propValue,
2577 wxPGChoices* pChoices = NULL );
2578
2579 /**
2580 Pushes property to the back of parent array (ie it becomes bottommost
2581 parent), and starts scanning/adding children for it.
2582
2583 When finished, parent array is returned to the original state.
2584 */
2585 void AddChildren( wxPGProperty* property );
2586
2587 /** Adds attribute to the bottommost property.
2588 @param type
2589 Allowed values: "string", (same as string), "int", "bool". Empty string
2590 mean autodetect.
2591 */
2592 bool AddAttribute( const wxString& name,
2593 const wxString& type,
2594 const wxString& value );
2595
2596 /** Called once in AddChildren.
2597 */
2598 virtual void DoScanForChildren() = 0;
2599
2600 /**
2601 Returns id of parent property for which children can currently be
2602 added.
2603 */
2604 wxPGProperty* GetCurParent() const
2605 {
2606 return (wxPGProperty*) m_propHierarchy[m_propHierarchy.size()-1];
2607 }
2608
2609 wxPropertyGridPageState* GetState() { return m_state; }
2610 const wxPropertyGridPageState* GetState() const { return m_state; }
2611
2612 /** Like wxString::ToLong, except allows N% in addition of N.
2613 */
2614 static bool ToLongPCT( const wxString& s, long* pval, long max );
2615
2616 /** Parses strings of format "choice1"[=value1] ... "choiceN"[=valueN] into
2617 wxPGChoices. Registers parsed result using idString (if not empty).
2618 Also, if choices with given id already registered, then don't parse but
2619 return those choices instead.
2620 */
2621 wxPGChoices ParseChoices( const wxString& choicesString,
2622 const wxString& idString );
2623
2624 /** Implement in derived class to do custom process when an error occurs.
2625 Default implementation uses wxLogError.
2626 */
2627 virtual void ProcessError( const wxString& msg );
2628
2629 protected:
2630
2631 /** Used property grid. */
2632 wxPropertyGrid* m_pg;
2633
2634 /** Used property grid state. */
2635 wxPropertyGridPageState* m_state;
2636
2637 /** Tree-hierarchy of added properties (that can have children). */
2638 wxArrayPGProperty m_propHierarchy;
2639
2640 /** Hashmap for string-id to wxPGChoicesData mapping. */
2641 wxPGHashMapS2P m_dictIdChoices;
2642 };
2643
2644 // -----------------------------------------------------------------------
2645
2646 //
2647 // Undefine macros that are not needed outside propertygrid sources
2648 //
2649 #ifndef __wxPG_SOURCE_FILE__
2650 #undef wxPG_FL_DESC_REFRESH_REQUIRED
2651 #undef wxPG_FL_SCROLLBAR_DETECTED
2652 #undef wxPG_FL_CREATEDSTATE
2653 #undef wxPG_FL_NOSTATUSBARHELP
2654 #undef wxPG_FL_SCROLLED
2655 #undef wxPG_FL_FOCUS_INSIDE_CHILD
2656 #undef wxPG_FL_FOCUS_INSIDE
2657 #undef wxPG_FL_MOUSE_INSIDE_CHILD
2658 #undef wxPG_FL_CUR_USES_CUSTOM_IMAGE
2659 #undef wxPG_FL_PRIMARY_FILLS_ENTIRE
2660 #undef wxPG_FL_VALUE_MODIFIED
2661 #undef wxPG_FL_MOUSE_INSIDE
2662 #undef wxPG_FL_FOCUSED
2663 #undef wxPG_FL_MOUSE_CAPTURED
2664 #undef wxPG_FL_INITIALIZED
2665 #undef wxPG_FL_ACTIVATION_BY_CLICK
2666 #undef wxPG_SUPPORT_TOOLTIPS
2667 #undef wxPG_DOUBLE_BUFFER
2668 #undef wxPG_ICON_WIDTH
2669 #undef wxPG_USE_RENDERER_NATIVE
2670 // Following are needed by the manager headers
2671 // #undef const wxString&
2672 #endif
2673
2674 // -----------------------------------------------------------------------
2675
2676 #endif
2677
2678 #endif // _WX_PROPGRID_PROPGRID_H_
2679