1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/propgrid/propgriddefs.h
3 // Purpose: wxPropertyGrid miscellaneous definitions
4 // Author: Jaakko Salli
7 // Copyright: (c) Jaakko Salli
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PROPGRID_PROPGRIDDEFS_H_
12 #define _WX_PROPGRID_PROPGRIDDEFS_H_
18 #include "wx/dynarray.h"
19 #include "wx/vector.h"
20 #include "wx/hashmap.h"
21 #include "wx/variant.h"
23 #include "wx/longlong.h"
24 #include "wx/clntdata.h"
26 // -----------------------------------------------------------------------
29 // Here are some platform dependent defines
30 // NOTE: More in propertygrid.cpp
33 #if defined(__WXMSW__)
35 // space between vertical line and value text
36 #define wxPG_XBEFORETEXT 4
37 // space between vertical line and value editor control
38 #define wxPG_XBEFOREWIDGET 1
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
46 #define wxPG_SUPPORT_TOOLTIPS 1
48 // width of optional bitmap/image in front of property
49 #define wxPG_CUSTOM_IMAGE_WIDTH 20
51 // 1 if splitter drag detect margin and control cannot overlap
52 #define wxPG_NO_CHILD_EVT_MOTION 0
54 #define wxPG_NAT_BUTTON_BORDER_ANY 1
55 #define wxPG_NAT_BUTTON_BORDER_X 1
56 #define wxPG_NAT_BUTTON_BORDER_Y 1
58 // If 1 then controls are refreshed explicitly in a few places
59 #define wxPG_REFRESH_CONTROLS 0
61 #elif defined(__WXGTK__)
63 // space between vertical line and value text
64 #define wxPG_XBEFORETEXT 5
65 // space between vertical line and value editor control
66 #define wxPG_XBEFOREWIDGET 1
68 // x position adjustment for wxTextCtrl (and like)
69 // NB: Only define wxPG_TEXTCTRLXADJUST for platforms that do not
70 // (yet) support wxTextEntry::SetMargins() for the left margin.
71 //#define wxPG_TEXTCTRLXADJUST 3
73 // comment to use bitmap buttons
74 #define wxPG_ICON_WIDTH 9
75 // 1 if wxRendererNative should be employed
76 #define wxPG_USE_RENDERER_NATIVE 1
79 #define wxPG_SUPPORT_TOOLTIPS 1
81 // width of optional bitmap/image in front of property
82 #define wxPG_CUSTOM_IMAGE_WIDTH 20
84 // 1 if splitter drag detect margin and control cannot overlap
85 #define wxPG_NO_CHILD_EVT_MOTION 1
87 #define wxPG_NAT_BUTTON_BORDER_ANY 1
88 #define wxPG_NAT_BUTTON_BORDER_X 1
89 #define wxPG_NAT_BUTTON_BORDER_Y 1
91 // If 1 then controls are refreshed after selected was drawn.
92 #define wxPG_REFRESH_CONTROLS 1
94 #elif defined(__WXMAC__)
96 // space between vertical line and value text
97 #define wxPG_XBEFORETEXT 4
98 // space between vertical line and value editor widget
99 #define wxPG_XBEFOREWIDGET 1
101 // x position adjustment for wxTextCtrl (and like)
102 #define wxPG_TEXTCTRLXADJUST 0
104 // comment to use bitmap buttons
105 #define wxPG_ICON_WIDTH 11
106 // 1 if wxRendererNative should be employed
107 #define wxPG_USE_RENDERER_NATIVE 1
110 #define wxPG_SUPPORT_TOOLTIPS 1
112 // width of optional bitmap/image in front of property
113 #define wxPG_CUSTOM_IMAGE_WIDTH 20
115 // 1 if splitter drag detect margin and control cannot overlap
116 #define wxPG_NO_CHILD_EVT_MOTION 0
118 #define wxPG_NAT_BUTTON_BORDER_ANY 0
119 #define wxPG_NAT_BUTTON_BORDER_X 0
120 #define wxPG_NAT_BUTTON_BORDER_Y 0
122 // If 1 then controls are refreshed after selected was drawn.
123 #define wxPG_REFRESH_CONTROLS 0
127 // space between vertical line and value text
128 #define wxPG_XBEFORETEXT 5
129 // space between vertical line and value editor widget
130 #define wxPG_XBEFOREWIDGET 1
132 // x position adjustment for wxTextCtrl (and like)
133 #define wxPG_TEXTCTRLXADJUST 3
135 // comment to use bitmap buttons
136 #define wxPG_ICON_WIDTH 9
137 // 1 if wxRendererNative should be employed
138 #define wxPG_USE_RENDERER_NATIVE 0
141 #define wxPG_SUPPORT_TOOLTIPS 0
143 // width of optional bitmap/image in front of property
144 #define wxPG_CUSTOM_IMAGE_WIDTH 20
146 // 1 if splitter drag detect margin and control cannot overlap
147 #define wxPG_NO_CHILD_EVT_MOTION 1
149 #define wxPG_NAT_BUTTON_BORDER_ANY 0
150 #define wxPG_NAT_BUTTON_BORDER_X 0
151 #define wxPG_NAT_BUTTON_BORDER_Y 0
153 // If 1 then controls are refreshed after selected was drawn.
154 #define wxPG_REFRESH_CONTROLS 0
158 #define wxPG_CONTROL_MARGIN 0 // space between splitter and control
160 #define wxCC_CUSTOM_IMAGE_MARGIN1 4 // before image
161 #define wxCC_CUSTOM_IMAGE_MARGIN2 5 // after image
163 #define DEFAULT_IMAGE_OFFSET_INCREMENT \
164 (wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2)
166 #define wxPG_DRAG_MARGIN 30
168 #if wxPG_NO_CHILD_EVT_MOTION
169 #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left
170 #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right
172 #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left
173 #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right
176 // Use this macro to generate standard custom image height from
177 #define wxPG_STD_CUST_IMAGE_HEIGHT(LINEHEIGHT) (LINEHEIGHT-3)
180 #if defined(__WXWINCE__)
181 #define wxPG_SMALL_SCREEN 1
183 #define wxPG_SMALL_SCREEN 0
187 // Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead
188 // (for tree buttons)
189 //#undef wxPG_ICON_WIDTH
191 #if WXWIN_COMPATIBILITY_2_6 || WXWIN_COMPATIBILITY_2_8
192 #define wxPG_COMPATIBILITY_1_4 1
194 #define wxPG_COMPATIBILITY_1_4 0
197 // Need to force disable tooltips?
199 #undef wxPG_SUPPORT_TOOLTIPS
200 #define wxPG_SUPPORT_TOOLTIPS 0
203 // Set 1 to include advanced properties (wxFontProperty, wxColourProperty, etc.)
204 #ifndef wxPG_INCLUDE_ADVPROPS
205 #define wxPG_INCLUDE_ADVPROPS 1
208 // Set 1 to include checkbox editor class
209 #define wxPG_INCLUDE_CHECKBOX 1
211 // -----------------------------------------------------------------------
216 class wxPropertyCategory
;
218 class wxPropertyGridPageState
;
220 class wxPGCellRenderer
;
221 class wxPGChoiceEntry
;
222 class wxPGPropArgCls
;
223 class wxPropertyGridInterface
;
224 class wxPropertyGrid
;
225 class wxPropertyGridEvent
;
226 class wxPropertyGridManager
;
227 class wxPGOwnerDrawnComboBox
;
228 class wxPGEditorDialogAdapter
;
229 class wxPGValidationInfo
;
232 // -----------------------------------------------------------------------
234 /** @section propgrid_misc wxPropertyGrid Miscellanous
236 This section describes some miscellanous values, types and macros.
240 // Used to tell wxPGProperty to use label as name as well
241 #define wxPG_LABEL (*wxPGProperty::sm_wxPG_LABEL)
243 // This is the value placed in wxPGProperty::sm_wxPG_LABEL
244 #define wxPG_LABEL_STRING wxS("@!")
245 #define wxPG_NULL_BITMAP wxNullBitmap
246 #define wxPG_COLOUR_BLACK (*wxBLACK)
248 /** Convert Red, Green and Blue to a single 32-bit value.
250 #define wxPG_COLOUR(R,G,B) ((wxUint32)(R+(G<<8)+(B<<16)))
253 /** If property is supposed to have custom-painted image, then returning
254 this in OnMeasureImage() will usually be enough.
256 #define wxPG_DEFAULT_IMAGE_SIZE wxSize(-1, -1)
259 /** This callback function is used for sorting properties.
261 Call wxPropertyGrid::SetSortFunction() to set it.
263 Sort function should return a value greater than 0 if position of p1 is
264 after p2. So, for instance, when comparing property names, you can use
265 following implementation:
268 int MyPropertySortFunction(wxPropertyGrid* propGrid,
272 return p1->GetBaseName().compare( p2->GetBaseName() );
276 typedef int (*wxPGSortCallback
)(wxPropertyGrid
* propGrid
,
282 typedef wxString wxPGCachedString
;
287 // -----------------------------------------------------------------------
289 // Used to indicate wxPGChoices::Add etc that the value is actually not given
291 #define wxPG_INVALID_VALUE INT_MAX
293 // -----------------------------------------------------------------------
295 WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxPGProperty
*, wxArrayPGProperty
,
297 class WXDLLIMPEXP_PROPGRID
);
299 WX_DECLARE_STRING_HASH_MAP_WITH_DECL(void*,
301 class WXDLLIMPEXP_PROPGRID
);
303 WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxString
,
305 class WXDLLIMPEXP_PROPGRID
);
307 WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(void*,
309 class WXDLLIMPEXP_PROPGRID
);
311 WX_DECLARE_HASH_MAP_WITH_DECL(wxInt32
,
316 class WXDLLIMPEXP_PROPGRID
);
318 // Utility to find if specific item is in a vector. Returns index to
319 // the item, or wxNOT_FOUND if not present.
320 template<typename CONTAINER
, typename T
>
321 int wxPGFindInVector( CONTAINER vector
, const T
& item
)
323 for ( unsigned int i
=0; i
<vector
.size(); i
++ )
325 if ( vector
[i
] == item
)
331 // -----------------------------------------------------------------------
333 enum wxPG_GETPROPERTYVALUES_FLAGS
336 /** Flags for wxPropertyGridInterface::GetPropertyValues */
337 wxPG_KEEP_STRUCTURE
= 0x00000010,
339 /** Flags for wxPropertyGrid::SetPropertyAttribute() etc */
340 wxPG_RECURSE
= 0x00000020,
342 /** Include attributes for GetPropertyValues. */
343 wxPG_INC_ATTRIBUTES
= 0x00000040,
345 /** Used when first starting recursion. */
346 wxPG_RECURSE_STARTS
= 0x00000080,
348 /** Force value change. */
349 wxPG_FORCE
= 0x00000100,
351 /** Only sort categories and their immediate children.
352 Sorting done by wxPG_AUTO_SORT option uses this.
354 wxPG_SORT_TOP_LEVEL_ONLY
= 0x00000200
358 /** Flags for wxPropertyGrid::SetPropertyAttribute() etc */
359 #define wxPG_DONT_RECURSE 0x00000000
361 // -----------------------------------------------------------------------
363 // Misc argument flags.
364 enum wxPG_MISC_ARG_FLAGS
366 // Get/Store full value instead of displayed value.
367 wxPG_FULL_VALUE
= 0x00000001,
369 wxPG_REPORT_ERROR
= 0x00000002,
371 wxPG_PROPERTY_SPECIFIC
= 0x00000004,
373 // Get/Store editable value instead of displayed one (should only be
374 // different in the case of common values)
375 wxPG_EDITABLE_VALUE
= 0x00000008,
377 // Used when dealing with fragments of composite string value
378 wxPG_COMPOSITE_FRAGMENT
= 0x00000010,
380 // Means property for which final string value is for cannot really be
382 wxPG_UNEDITABLE_COMPOSITE_FRAGMENT
= 0x00000020,
384 // ValueToString() called from GetValueAsString()
385 // (guarantees that input wxVariant value is current own value)
386 wxPG_VALUE_IS_CURRENT
= 0x00000040,
388 // Value is being set programmatically (ie. not by user)
389 wxPG_PROGRAMMATIC_VALUE
= 0x00000080
392 // -----------------------------------------------------------------------
394 // wxPGProperty::SetValue() flags
395 enum wxPG_SETVALUE_FLAGS
397 wxPG_SETVAL_REFRESH_EDITOR
= 0x0001,
398 wxPG_SETVAL_AGGREGATED
= 0x0002,
399 wxPG_SETVAL_FROM_PARENT
= 0x0004,
400 wxPG_SETVAL_BY_USER
= 0x0008 // Set if value changed by user
403 // -----------------------------------------------------------------------
406 // Valid constants for wxPG_UINT_BASE attribute
407 // (long because of wxVariant constructor)
408 #define wxPG_BASE_OCT (long)8
409 #define wxPG_BASE_DEC (long)10
410 #define wxPG_BASE_HEX (long)16
411 #define wxPG_BASE_HEXL (long)32
414 // Valid constants for wxPG_UINT_PREFIX attribute
415 #define wxPG_PREFIX_NONE (long)0
416 #define wxPG_PREFIX_0x (long)1
417 #define wxPG_PREFIX_DOLLAR_SIGN (long)2
419 // -----------------------------------------------------------------------
422 // Editor accessor (for backwards compatiblity use only).
423 #define wxPG_EDITOR(T) wxPGEditor_##T
425 // Macro for declaring editor class, with optional impexpdecl part.
426 #ifndef WX_PG_DECLARE_EDITOR_WITH_DECL
428 #define WX_PG_DECLARE_EDITOR_WITH_DECL(EDITOR,DECL) \
429 extern DECL wxPGEditor* wxPGEditor_##EDITOR; \
430 extern DECL wxPGEditor* wxPGConstruct##EDITOR##EditorClass();
434 // Declare editor class.
435 #define WX_PG_DECLARE_EDITOR(EDITOR) \
436 extern wxPGEditor* wxPGEditor_##EDITOR; \
437 extern wxPGEditor* wxPGConstruct##EDITOR##EditorClass();
439 // Declare builtin editor classes.
440 WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrl
,WXDLLIMPEXP_PROPGRID
)
441 WX_PG_DECLARE_EDITOR_WITH_DECL(Choice
,WXDLLIMPEXP_PROPGRID
)
442 WX_PG_DECLARE_EDITOR_WITH_DECL(ComboBox
,WXDLLIMPEXP_PROPGRID
)
443 WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrlAndButton
,WXDLLIMPEXP_PROPGRID
)
444 #if wxPG_INCLUDE_CHECKBOX
445 WX_PG_DECLARE_EDITOR_WITH_DECL(CheckBox
,WXDLLIMPEXP_PROPGRID
)
447 WX_PG_DECLARE_EDITOR_WITH_DECL(ChoiceAndButton
,WXDLLIMPEXP_PROPGRID
)
449 // -----------------------------------------------------------------------
454 // Macro WXVARIANT allows creation of wxVariant from any type supported by
455 // wxWidgets internally, and of all types created using
456 // WX_PG_DECLARE_VARIANT_DATA.
458 wxVariant
WXVARIANT( const T
& WXUNUSED(value
) )
460 wxFAIL_MSG("Code should always call specializations of this template");
464 template<> inline wxVariant
WXVARIANT( const int& value
)
465 { return wxVariant((long)value
); }
466 template<> inline wxVariant
WXVARIANT( const long& value
)
467 { return wxVariant(value
); }
468 template<> inline wxVariant
WXVARIANT( const bool& value
)
469 { return wxVariant(value
); }
470 template<> inline wxVariant
WXVARIANT( const double& value
)
471 { return wxVariant(value
); }
472 template<> inline wxVariant
WXVARIANT( const wxArrayString
& value
)
473 { return wxVariant(value
); }
474 template<> inline wxVariant
WXVARIANT( const wxString
& value
)
475 { return wxVariant(value
); }
477 template<> inline wxVariant
WXVARIANT( const wxLongLong
& value
)
478 { return wxVariant(value
); }
479 template<> inline wxVariant
WXVARIANT( const wxULongLong
& value
)
480 { return wxVariant(value
); }
483 template<> inline wxVariant
WXVARIANT( const wxDateTime
& value
)
484 { return wxVariant(value
); }
489 // These are modified versions of DECLARE/WX_PG_IMPLEMENT_VARIANT_DATA
490 // macros found in variant.h. Difference are as follows:
491 // * These support non-wxObject data
492 // * These implement classname##RefFromVariant function which returns
493 // reference to data within.
494 // * const char* classname##_VariantType which equals classname.
497 #define WX_PG_DECLARE_VARIANT_DATA(classname) \
498 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
500 #define WX_PG_DECLARE_VARIANT_DATA_EXPORTED(classname,expdecl) \
501 expdecl classname& operator << ( classname &object, const wxVariant &variant ); \
502 expdecl wxVariant& operator << ( wxVariant &variant, const classname &object ); \
503 expdecl const classname& classname##RefFromVariant( const wxVariant& variant ); \
504 expdecl classname& classname##RefFromVariant( wxVariant& variant ); \
505 template<> inline wxVariant WXVARIANT( const classname& value ) \
511 extern expdecl const char* classname##_VariantType;
514 #define WX_PG_IMPLEMENT_VARIANT_DATA(classname) \
515 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
517 // Add getter (ie. classname << variant) separately to allow
518 // custom implementations.
519 #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ_NO_GETTER(classname,expdecl) \
520 const char* classname##_VariantType = #classname; \
521 class classname##VariantData: public wxVariantData \
524 classname##VariantData() {} \
525 classname##VariantData( const classname &value ) { m_value = value; } \
527 classname &GetValue() { return m_value; } \
529 const classname &GetValue() const { return m_value; } \
531 virtual bool Eq(wxVariantData& data) const; \
533 virtual wxString GetType() const; \
535 virtual wxVariantData* Clone() const { return new classname##VariantData(m_value); } \
537 DECLARE_WXANY_CONVERSION() \
542 IMPLEMENT_TRIVIAL_WXANY_CONVERSION(classname, classname##VariantData) \
544 wxString classname##VariantData::GetType() const\
546 return wxS(#classname);\
549 expdecl wxVariant& operator << ( wxVariant &variant, const classname &value )\
551 classname##VariantData *data = new classname##VariantData( value );\
552 variant.SetData( data );\
555 expdecl classname& classname##RefFromVariant( wxVariant& variant ) \
557 wxASSERT_MSG( variant.GetType() == wxS(#classname), \
558 wxString::Format("Variant type should have been '%s'" \
561 variant.GetType().c_str())); \
562 classname##VariantData *data = \
563 (classname##VariantData*) variant.GetData(); \
564 return data->GetValue();\
566 expdecl const classname& classname##RefFromVariant( const wxVariant& variant ) \
568 wxASSERT_MSG( variant.GetType() == wxS(#classname), \
569 wxString::Format("Variant type should have been '%s'" \
572 variant.GetType().c_str())); \
573 classname##VariantData *data = \
574 (classname##VariantData*) variant.GetData(); \
575 return data->GetValue();\
578 #define WX_PG_IMPLEMENT_VARIANT_DATA_GETTER(classname, expdecl) \
579 expdecl classname& operator << ( classname &value, const wxVariant &variant )\
581 wxASSERT( variant.GetType() == #classname );\
583 classname##VariantData *data = (classname##VariantData*) variant.GetData();\
584 value = data->GetValue();\
588 #define WX_PG_IMPLEMENT_VARIANT_DATA_EQ(classname, expdecl) \
589 bool classname##VariantData::Eq(wxVariantData& data) const \
591 wxASSERT( GetType() == data.GetType() );\
593 classname##VariantData & otherData = (classname##VariantData &) data;\
595 return otherData.m_value == m_value;\
598 // implements a wxVariantData-derived class using for the Eq() method the
599 // operator== which must have been provided by "classname"
600 #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname,expdecl) \
601 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ_NO_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
602 WX_PG_IMPLEMENT_VARIANT_DATA_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
603 WX_PG_IMPLEMENT_VARIANT_DATA_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl)
605 #define WX_PG_IMPLEMENT_VARIANT_DATA(classname) \
606 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
608 // with Eq() implementation that always returns false
609 #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_DUMMY_EQ(classname,expdecl) \
610 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ_NO_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
611 WX_PG_IMPLEMENT_VARIANT_DATA_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
613 bool classname##VariantData::Eq(wxVariantData& WXUNUSED(data)) const \
618 #define WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(classname) \
619 WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_DUMMY_EQ(classname, wxEMPTY_PARAMETER_VALUE)
621 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxPoint
, WXDLLIMPEXP_PROPGRID
)
622 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxSize
, WXDLLIMPEXP_PROPGRID
)
623 WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxArrayInt
, WXDLLIMPEXP_PROPGRID
)
624 DECLARE_VARIANT_OBJECT_EXPORTED(wxFont
, WXDLLIMPEXP_PROPGRID
)
625 template<> inline wxVariant
WXVARIANT( const wxFont
& value
)
632 template<> inline wxVariant
WXVARIANT( const wxColour
& value
)
639 // Define constants for common wxVariant type strings
641 #define wxPG_VARIANT_TYPE_STRING wxPGGlobalVars->m_strstring
642 #define wxPG_VARIANT_TYPE_LONG wxPGGlobalVars->m_strlong
643 #define wxPG_VARIANT_TYPE_BOOL wxPGGlobalVars->m_strbool
644 #define wxPG_VARIANT_TYPE_LIST wxPGGlobalVars->m_strlist
645 #define wxPG_VARIANT_TYPE_DOUBLE wxS("double")
646 #define wxPG_VARIANT_TYPE_ARRSTRING wxS("arrstring")
647 #define wxPG_VARIANT_TYPE_DATETIME wxS("datetime")
648 #define wxPG_VARIANT_TYPE_LONGLONG wxS("longlong")
649 #define wxPG_VARIANT_TYPE_ULONGLONG wxS("ulonglong")
653 // -----------------------------------------------------------------------
657 // NOTE: I have made two versions - worse ones (performance and consistency
658 // wise) use wxStringTokenizer and better ones (may have unfound bugs)
662 #include "wx/tokenzr.h"
664 // TOKENIZER1 can be done with wxStringTokenizer
665 #define WX_PG_TOKENIZER1_BEGIN(WXSTRING,DELIMITER) \
666 wxStringTokenizer tkz(WXSTRING,DELIMITER,wxTOKEN_RET_EMPTY); \
667 while ( tkz.HasMoreTokens() ) \
669 wxString token = tkz.GetNextToken(); \
673 #define WX_PG_TOKENIZER1_END() \
678 // 2nd version: tokens are surrounded by DELIMITERs (for example, C-style
679 // strings). TOKENIZER2 must use custom code (a class) for full compliance with
680 // " surrounded strings with \" inside.
682 // class implementation is in propgrid.cpp
685 class WXDLLIMPEXP_PROPGRID wxPGStringTokenizer
688 wxPGStringTokenizer( const wxString
& str
, wxChar delimeter
);
689 ~wxPGStringTokenizer();
691 bool HasMoreTokens(); // not const so we can do some stuff in it
692 wxString
GetNextToken();
695 const wxString
* m_str
;
696 wxString::const_iterator m_curPos
;
697 wxString m_readyToken
;
698 wxUniChar m_delimeter
;
701 #define WX_PG_TOKENIZER2_BEGIN(WXSTRING,DELIMITER) \
702 wxPGStringTokenizer tkz(WXSTRING,DELIMITER); \
703 while ( tkz.HasMoreTokens() ) \
705 wxString token = tkz.GetNextToken();
707 #define WX_PG_TOKENIZER2_END() \
710 // -----------------------------------------------------------------------
712 #endif // wxUSE_PROPGRID
714 #endif // _WX_PROPGRID_PROPGRIDDEFS_H_