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