1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/propgrid/propgriddefs.h
3 // Purpose: wxPropertyGrid miscellaneous definitions
4 // Author: Jaakko Salli
8 // Copyright: (c) Jaakko Salli
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PROPGRID_PROPGRIDDEFS_H_
13 #define _WX_PROPGRID_PROPGRIDDEFS_H_
15 #include "wx/dynarray.h"
16 #include "wx/hashmap.h"
17 #include "wx/variant.h"
18 #include "wx/longlong.h"
19 #include "wx/clntdata.h"
21 // -----------------------------------------------------------------------
24 // Here are some platform dependent defines
25 // NOTE: More in propertygrid.cpp
30 #if defined(__WXMSW__)
32 // space between vertical line and value text
33 #define wxPG_XBEFORETEXT 4
34 // space between vertical line and value editor control
35 #define wxPG_XBEFOREWIDGET 1
37 // x position adjustment for wxTextCtrl (and like)
38 #define wxPG_TEXTCTRLXADJUST 3
40 // comment to use bitmap buttons
41 #define wxPG_ICON_WIDTH 9
42 // 1 if wxRendererNative should be employed
43 #define wxPG_USE_RENDERER_NATIVE 0
45 // 1 to use double-buffer that guarantees flicker-free painting
46 #define wxPG_DOUBLE_BUFFER 1
49 #define wxPG_SUPPORT_TOOLTIPS 1
51 // width of optional bitmap/image in front of property
52 #define wxPG_CUSTOM_IMAGE_WIDTH 20
54 // 1 to create controls out of sight, hide them, and then move them into
56 #define wxPG_CREATE_CONTROLS_HIDDEN 0
58 // 1 if splitter drag detect margin and control cannot overlap
59 #define wxPG_NO_CHILD_EVT_MOTION 0
61 // If 1, then setting empty tooltip actually hides it
62 #define wxPG_ALLOW_EMPTY_TOOLTIPS 1
64 #define wxPG_NAT_BUTTON_BORDER_ANY 1
65 #define wxPG_NAT_BUTTON_BORDER_X 1
66 #define wxPG_NAT_BUTTON_BORDER_Y 1
68 // If 1 then controls are refreshed after selected was drawn.
69 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 0
71 #elif defined(__WXGTK__)
73 // space between vertical line and value text
74 #define wxPG_XBEFORETEXT 5
75 // space between vertical line and value editor control
76 #define wxPG_XBEFOREWIDGET 1
78 // x position adjustment for wxTextCtrl (and like)
79 #define wxPG_TEXTCTRLXADJUST 3
81 // comment to use bitmap buttons
82 #define wxPG_ICON_WIDTH 9
83 // 1 if wxRendererNative should be employed
84 #define wxPG_USE_RENDERER_NATIVE 0
86 // 1 to use double-buffer that guarantees flicker-free painting
87 #define wxPG_DOUBLE_BUFFER 1
90 #define wxPG_SUPPORT_TOOLTIPS 1
92 // width of optional bitmap/image in front of property
93 #define wxPG_CUSTOM_IMAGE_WIDTH 20
95 // 1 to create controls out of sight, hide them, and then move them into
97 #define wxPG_CREATE_CONTROLS_HIDDEN 0
99 // 1 if splitter drag detect margin and control cannot overlap
100 #define wxPG_NO_CHILD_EVT_MOTION 1
102 // If 1, then setting empty tooltip actually hides it
103 #define wxPG_ALLOW_EMPTY_TOOLTIPS 0
105 #define wxPG_NAT_BUTTON_BORDER_ANY 1
106 #define wxPG_NAT_BUTTON_BORDER_X 1
107 #define wxPG_NAT_BUTTON_BORDER_Y 1
109 // If 1 then controls are refreshed after selected was drawn.
110 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 1
112 #elif defined(__WXMAC__)
114 // space between vertical line and value text
115 #define wxPG_XBEFORETEXT 4
116 // space between vertical line and value editor widget
117 #define wxPG_XBEFOREWIDGET 1
119 // x position adjustment for wxTextCtrl (and like)
120 #define wxPG_TEXTCTRLXADJUST 3
122 // comment to use bitmap buttons
123 #define wxPG_ICON_WIDTH 11
124 // 1 if wxRendererNative should be employed
125 #define wxPG_USE_RENDERER_NATIVE 1
127 // 1 to use double-buffer that guarantees flicker-free painting
128 #define wxPG_DOUBLE_BUFFER 0
131 #define wxPG_SUPPORT_TOOLTIPS 1
133 // width of optional bitmap/image in front of property
134 #define wxPG_CUSTOM_IMAGE_WIDTH 20
136 // 1 to create controls out of sight, hide them, and then move them into
138 #define wxPG_CREATE_CONTROLS_HIDDEN 0
140 // 1 if splitter drag detect margin and control cannot overlap
141 #define wxPG_NO_CHILD_EVT_MOTION 0
143 // If 1, then setting empty tooltip actually hides it
144 #define wxPG_ALLOW_EMPTY_TOOLTIPS 1
146 #define wxPG_NAT_BUTTON_BORDER_ANY 0
147 #define wxPG_NAT_BUTTON_BORDER_X 0
148 #define wxPG_NAT_BUTTON_BORDER_Y 0
150 // If 1 then controls are refreshed after selected was drawn.
151 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 0
155 // space between vertical line and value text
156 #define wxPG_XBEFORETEXT 5
157 // space between vertical line and value editor widget
158 #define wxPG_XBEFOREWIDGET 1
160 // x position adjustment for wxTextCtrl (and like)
161 #define wxPG_TEXTCTRLXADJUST 3
163 // comment to use bitmap buttons
164 #define wxPG_ICON_WIDTH 9
165 // 1 if wxRendererNative should be employed
166 #define wxPG_USE_RENDERER_NATIVE 0
168 // 1 to use double-buffer that guarantees flicker-free painting
169 #define wxPG_DOUBLE_BUFFER 0
172 #define wxPG_SUPPORT_TOOLTIPS 0
174 // width of optional bitmap/image in front of property
175 #define wxPG_CUSTOM_IMAGE_WIDTH 20
177 // 1 to create controls out of sight, hide them, and then move them into
179 #define wxPG_CREATE_CONTROLS_HIDDEN 0
181 // 1 if splitter drag detect margin and control cannot overlap
182 #define wxPG_NO_CHILD_EVT_MOTION 1
184 // If 1, then setting empty tooltip actually hides it
185 #define wxPG_ALLOW_EMPTY_TOOLTIPS 0
187 #define wxPG_NAT_BUTTON_BORDER_ANY 0
188 #define wxPG_NAT_BUTTON_BORDER_X 0
189 #define wxPG_NAT_BUTTON_BORDER_Y 0
191 // If 1 then controls are refreshed after selected was drawn.
192 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 1
196 #define wxPG_CONTROL_MARGIN 0 // space between splitter and control
198 #define wxCC_CUSTOM_IMAGE_MARGIN1 4 // before image
199 #define wxCC_CUSTOM_IMAGE_MARGIN2 5 // after image
201 #define wxPG_DRAG_MARGIN 30
203 #if wxPG_NO_CHILD_EVT_MOTION
204 #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left
205 #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right
207 #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left
208 #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right
211 // Use this macro to generate standard custom image height from
212 #define wxPG_STD_CUST_IMAGE_HEIGHT(LINEHEIGHT) (LINEHEIGHT-3)
215 #if defined(__WXWINCE__)
216 #define wxPG_SMALL_SCREEN 1
217 #undef wxPG_DOUBLE_BUFFER
218 #define wxPG_DOUBLE_BUFFER 0
220 #define wxPG_SMALL_SCREEN 0
223 #endif // #ifndef SWIG
225 // Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead
226 // (for tree buttons)
227 //#undef wxPG_ICON_WIDTH
229 // Need to force disable tooltips?
231 #undef wxPG_SUPPORT_TOOLTIPS
232 #define wxPG_SUPPORT_TOOLTIPS 0
235 // Set 1 to include advanced properties (wxFontProperty, wxColourProperty, etc.)
236 #ifndef wxPG_INCLUDE_ADVPROPS
237 #define wxPG_INCLUDE_ADVPROPS 1
240 // Set 1 to include checkbox editor class
241 #define wxPG_INCLUDE_CHECKBOX 1
243 // -----------------------------------------------------------------------
246 // wxPG_CHECK_FOO_DBG - debug check with message that does not
247 // interrupt program flow.
248 #define wxPG_CHECK_RET_DBG(A,B) \
249 if ( !(A) ) { wxLogWarning(B); return; }
250 #define wxPG_CHECK_MSG_DBG(A,B,C) \
251 if ( !(A) ) { wxLogWarning(C); return B; }
256 class wxPropertyCategory
;
258 class wxPropertyGridPageState
;
260 class wxPGCellRenderer
;
261 class wxPGChoiceEntry
;
262 class wxPGPropArgCls
;
263 class wxPropertyGridInterface
;
264 class wxPropertyGrid
;
265 class wxPropertyGridEvent
;
266 class wxPropertyGridManager
;
267 class wxPGOwnerDrawnComboBox
;
268 class wxPGCustomComboControl
;
269 class wxPGEditorDialogAdapter
;
270 struct wxPGValidationInfo
;
273 // -----------------------------------------------------------------------
275 /** @section propgrid_misc wxPropertyGrid Miscellanous
277 This section describes some miscellanous values, types and macros.
282 // Used to tell wxPGProperty to use label as name as well
283 #define wxPG_LABEL (*wxPGProperty::sm_wxPG_LABEL)
284 // This is the value placed in wxPGProperty::sm_wxPG_LABEL
285 #define wxPG_LABEL_STRING wxS("@!")
286 #define wxPG_NULL_BITMAP wxNullBitmap
287 #define wxPG_COLOUR_BLACK (*wxBLACK)
289 #define wxPG_NULL_BITMAP wxBitmap_NULL
290 #define wxPG_COLOUR_BLACK wxColour_BLACK
291 #endif // #ifndef SWIG
293 /** Convert Red, Green and Blue to a single 32-bit value.
295 #define wxPG_COLOUR(R,G,B) ((wxUint32)(R+(G<<8)+(B<<16)))
298 /** If property is supposed to have custom-painted image, then returning
299 this in OnMeasureImage() will usually be enough.
301 #define wxPG_DEFAULT_IMAGE_SIZE wxSize(-1, -1)
304 typedef wxString wxPGCachedString
;
309 // -----------------------------------------------------------------------
311 // Used to indicate wxPGChoices::Add etc that the value is actually not given
313 #define wxPG_INVALID_VALUE INT_MAX
315 // -----------------------------------------------------------------------
320 typedef std::vector
<wxPGProperty
*> wxArrayPGProperty
;
322 WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxPGProperty
*, wxArrayPGProperty
,
324 class WXDLLIMPEXP_PROPGRID
);
327 // Always use wxString based hashmap with unicode, stl, swig and GCC 4.0+
328 WX_DECLARE_STRING_HASH_MAP_WITH_DECL(void*,
330 class WXDLLIMPEXP_PROPGRID
);
333 WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(void*,
335 class WXDLLIMPEXP_PROPGRID
);
337 WX_DECLARE_HASH_MAP_WITH_DECL(wxInt32
,
342 class WXDLLIMPEXP_PROPGRID
);
344 #endif // #ifndef SWIG
346 // -----------------------------------------------------------------------
348 enum wxPG_GETPROPERTYVALUES_FLAGS
351 /** Flags for wxPropertyGridInterface::GetPropertyValues */
352 wxPG_KEEP_STRUCTURE
= 0x00000010,
354 /** Flags for wxPropertyGrid::SetPropertyAttribute() etc */
355 wxPG_RECURSE
= 0x00000020,
357 /** Include attributes for GetPropertyValues. */
358 wxPG_INC_ATTRIBUTES
= 0x00000040,
360 /** Used when first starting recursion. */
361 wxPG_RECURSE_STARTS
= 0x00000080,
363 /** Force value change. */
364 wxPG_FORCE
= 0x00000100
368 /** Flags for wxPropertyGrid::SetPropertyAttribute() etc */
369 #define wxPG_DONT_RECURSE 0x00000000
371 // -----------------------------------------------------------------------
373 // Misc argument flags.
374 enum wxPG_MISC_ARG_FLAGS
376 // Get/Store full value instead of displayed value.
377 wxPG_FULL_VALUE
= 0x00000001,
379 wxPG_REPORT_ERROR
= 0x00000002,
381 wxPG_PROPERTY_SPECIFIC
= 0x00000004,
383 // Get/Store editable value instead of displayed one (should only be
384 // different in the case of common values)
385 wxPG_EDITABLE_VALUE
= 0x00000008,
387 // Used when dealing with fragments of composite string value
388 wxPG_COMPOSITE_FRAGMENT
= 0x00000010,
390 // Means property for which final string value is for can not really be
392 wxPG_UNEDITABLE_COMPOSITE_FRAGMENT
= 0x00000020
395 // -----------------------------------------------------------------------
397 // wxPGProperty::SetValue() flags
398 enum wxPG_SETVALUE_FLAGS
400 wxPG_SETVAL_REFRESH_EDITOR
= 0x0001,
401 wxPG_SETVAL_AGGREGATED
= 0x0002,
402 wxPG_SETVAL_FROM_PARENT
= 0x0004,
403 wxPG_SETVAL_BY_USER
= 0x0008 // Set if value changed by user
406 // -----------------------------------------------------------------------
409 // Valid constants for wxPG_UINT_BASE attribute
410 // (long because of wxVariant constructor)
411 #define wxPG_BASE_OCT (long)8
412 #define wxPG_BASE_DEC (long)10
413 #define wxPG_BASE_HEX (long)16
414 #define wxPG_BASE_HEXL (long)32
417 // Valid constants for wxPG_UINT_PREFIX attribute
418 #define wxPG_PREFIX_NONE (long)0
419 #define wxPG_PREFIX_0x (long)1
420 #define wxPG_PREFIX_DOLLAR_SIGN (long)2
422 // -----------------------------------------------------------------------
428 #define wxPG_EDITOR(T) wxPGEditor_##T
430 // Declare editor class, with optional part.
431 #define WX_PG_DECLARE_EDITOR_WITH_DECL(EDITOR,DECL) \
432 extern DECL wxPGEditor* wxPGEditor_##EDITOR; \
433 extern DECL wxPGEditor* wxPGConstruct##EDITOR##EditorClass();
435 // Declare editor class.
436 #define WX_PG_DECLARE_EDITOR(EDITOR) \
437 extern wxPGEditor* wxPGEditor_##EDITOR; \
438 extern wxPGEditor* wxPGConstruct##EDITOR##EditorClass();
440 // Declare builtin editor classes.
441 WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrl
,WXDLLIMPEXP_PROPGRID
)
442 WX_PG_DECLARE_EDITOR_WITH_DECL(Choice
,WXDLLIMPEXP_PROPGRID
)
443 WX_PG_DECLARE_EDITOR_WITH_DECL(ComboBox
,WXDLLIMPEXP_PROPGRID
)
444 WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrlAndButton
,WXDLLIMPEXP_PROPGRID
)
445 #if wxPG_INCLUDE_CHECKBOX
446 WX_PG_DECLARE_EDITOR_WITH_DECL(CheckBox
,WXDLLIMPEXP_PROPGRID
)
448 WX_PG_DECLARE_EDITOR_WITH_DECL(ChoiceAndButton
,WXDLLIMPEXP_PROPGRID
)
452 // -----------------------------------------------------------------------
457 // Macro WXVARIANT allows creation of wxVariant from any type supported by
458 // wxWidgets internally, and of all types created using
459 // WX_PG_DECLARE_VARIANT_DATA.
461 wxVariant
WXVARIANT( const T
& WXUNUSED(value
) )
463 wxFAIL_MSG("Code should always call specializations of this template");
467 template<> inline wxVariant
WXVARIANT( const int& value
)
468 { return wxVariant((long)value
); }
469 template<> inline wxVariant
WXVARIANT( const long& value
)
470 { return wxVariant(value
); }
471 template<> inline wxVariant
WXVARIANT( const bool& value
)
472 { return wxVariant(value
); }
473 template<> inline wxVariant
WXVARIANT( const double& value
)
474 { return wxVariant(value
); }
475 template<> inline wxVariant
WXVARIANT( const wxArrayString
& value
)
476 { return wxVariant(value
); }
477 template<> inline wxVariant
WXVARIANT( const wxString
& value
)
478 { return wxVariant(value
); }
480 template<> inline wxVariant
WXVARIANT( const wxDateTime
& value
)
481 { return wxVariant(value
); }
486 // These are modified versions of DECLARE/WX_PG_IMPLEMENT_VARIANT_DATA
487 // macros found in variant.h. Difference are as follows:
488 // * These support non-wxObject data
489 // * These implement classname##RefFromVariant function which returns
490 // reference to data within.
491 // * const char* classname##_VariantType which equals classname.
494 #define WX_PG_DECLARE_VARIANT_DATA(classname) \
495 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
497 #define WX_PG_DECLARE_VARIANT_DATA_EXPORTED(classname,expdecl) \
498 expdecl classname& operator << ( classname &object, const wxVariant &variant ); \
499 expdecl wxVariant& operator << ( wxVariant &variant, const classname &object ); \
500 expdecl const classname& classname##RefFromVariant( const wxVariant& variant ); \
501 expdecl classname& classname##RefFromVariant( wxVariant& variant ); \
502 template<> inline wxVariant WXVARIANT( const classname& value ) \
508 extern expdecl const char* classname##_VariantType;
511 #define WX_PG_IMPLEMENT_VARIANT_DATA(classname) \
512 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
514 #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ(classname,expdecl) \
515 const char* classname##_VariantType = #classname; \
516 class classname##VariantData: public wxVariantData \
519 classname##VariantData() {} \
520 classname##VariantData( const classname &value ) { m_value = value; } \
522 classname &GetValue() { return m_value; } \
524 virtual bool Eq(wxVariantData& data) const; \
526 virtual wxString GetType() const; \
528 virtual wxVariantData* Clone() const { return new classname##VariantData(m_value); } \
530 classname& GetValueRef() { return m_value; } \
532 const classname& GetValueRef() const { return m_value; } \
538 wxString classname##VariantData::GetType() const\
540 return wxS(#classname);\
543 expdecl classname& operator << ( classname &value, const wxVariant &variant )\
545 wxASSERT( variant.GetType() == #classname );\
547 classname##VariantData *data = (classname##VariantData*) variant.GetData();\
548 value = data->GetValue();\
552 expdecl wxVariant& operator << ( wxVariant &variant, const classname &value )\
554 classname##VariantData *data = new classname##VariantData( value );\
555 variant.SetData( data );\
558 expdecl classname& classname##RefFromVariant( wxVariant& variant ) \
560 wxASSERT( variant.GetType() == #classname );\
561 classname##VariantData *data = (classname##VariantData*) variant.GetData();\
562 return data->GetValueRef();\
564 expdecl const classname& classname##RefFromVariant( const wxVariant& variant ) \
566 wxASSERT( variant.GetType() == #classname );\
567 classname##VariantData *data = (classname##VariantData*) variant.GetData();\
568 return data->GetValueRef();\
571 // implements a wxVariantData-derived class using for the Eq() method the
572 // operator== which must have been provided by "classname"
573 #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname,expdecl) \
574 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
576 bool classname##VariantData::Eq(wxVariantData& data) const \
578 wxASSERT( GetType() == data.GetType() );\
580 classname##VariantData & otherData = (classname##VariantData &) data;\
582 return otherData.m_value == m_value;\
585 #define WX_PG_IMPLEMENT_VARIANT_DATA(classname) \
586 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
588 // with Eq() implementation that always returns false
589 #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_DUMMY_EQ(classname,expdecl) \
590 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
592 bool classname##VariantData::Eq(wxVariantData& WXUNUSED(data)) const \
597 #define WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(classname) \
598 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_DUMMY_EQ(classname, wxEMPTY_PARAMETER_VALUE)
600 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxPoint
, WXDLLIMPEXP_PROPGRID
)
601 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxSize
, WXDLLIMPEXP_PROPGRID
)
602 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxArrayInt
, WXDLLIMPEXP_PROPGRID
)
603 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxLongLong
, WXDLLIMPEXP_PROPGRID
)
604 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxULongLong
, WXDLLIMPEXP_PROPGRID
)
605 DECLARE_VARIANT_OBJECT_EXPORTED(wxFont
, WXDLLIMPEXP_PROPGRID
)
606 template<> inline wxVariant
WXVARIANT( const wxFont
& value
)
613 template<> inline wxVariant
WXVARIANT( const wxColour
& value
)
620 // Define constants for common wxVariant type strings
622 #define wxPG_VARIANT_TYPE_STRING wxPGGlobalVars->m_strstring
623 #define wxPG_VARIANT_TYPE_LONG wxPGGlobalVars->m_strlong
624 #define wxPG_VARIANT_TYPE_BOOL wxPGGlobalVars->m_strbool
625 #define wxPG_VARIANT_TYPE_LIST wxPGGlobalVars->m_strlist
626 #define wxPG_VARIANT_TYPE_DOUBLE wxS("double")
627 #define wxPG_VARIANT_TYPE_ARRSTRING wxS("arrstring")
628 #define wxPG_VARIANT_TYPE_DATETIME wxS("datetime")
630 // Safely converts a wxVariant to (long) int. Supports converting from string
631 // and boolean as well.
633 long wxPGVariantToInt( const wxVariant
& variant
, long defVal
= 1 );
635 // Safely converts a wxVariant to wxLongLong_t. Returns true on success.
637 bool wxPGVariantToLongLong( const wxVariant
& variant
, wxLongLong_t
* pResult
);
639 // Safely converts a wxVariant to wxULongLong_t. Returns true on success.
641 bool wxPGVariantToULongLong( const wxVariant
& variant
, wxULongLong_t
* pResult
);
643 // Safely converts a wxVariant to double. Supports converting from string and
644 // wxLongLong as well.
646 bool wxPGVariantToDouble( const wxVariant
& variant
, double* pResult
);
650 // -----------------------------------------------------------------------
656 // NOTE: I have made two versions - worse ones (performance and consistency
657 // wise) use wxStringTokenizer and better ones (may have unfound bugs)
661 #include "wx/tokenzr.h"
663 // TOKENIZER1 can be done with wxStringTokenizer
664 #define WX_PG_TOKENIZER1_BEGIN(WXSTRING,DELIMITER) \
665 wxStringTokenizer tkz(WXSTRING,DELIMITER,wxTOKEN_RET_EMPTY); \
666 while ( tkz.HasMoreTokens() ) \
668 wxString token = tkz.GetNextToken(); \
672 #define WX_PG_TOKENIZER1_END() \
677 // 2nd version: tokens are surrounded by DELIMITERs (for example, C-style
678 // strings). TOKENIZER2 must use custom code (a class) for full compliance with
679 // " surrounded strings with \" inside.
681 // class implementation is in propgrid.cpp
684 class WXDLLIMPEXP_PROPGRID wxPGStringTokenizer
687 wxPGStringTokenizer( const wxString
& str
, wxChar delimeter
);
688 ~wxPGStringTokenizer();
690 bool HasMoreTokens(); // not const so we can do some stuff in it
691 wxString
GetNextToken();
694 const wxString
* m_str
;
695 wxString::const_iterator m_curPos
;
696 wxString m_readyToken
;
697 wxUniChar m_delimeter
;
700 #define WX_PG_TOKENIZER2_BEGIN(WXSTRING,DELIMITER) \
701 wxPGStringTokenizer tkz(WXSTRING,DELIMITER); \
702 while ( tkz.HasMoreTokens() ) \
704 wxString token = tkz.GetNextToken();
706 #define WX_PG_TOKENIZER2_END() \
711 // -----------------------------------------------------------------------
713 #endif // _WX_PROPGRID_PROPGRIDDEFS_H_