1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPGProperty
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @section propgrid_hittestresult wxPropertyGridHitTestResult
13 A return value from wxPropertyGrid::HitTest(),
14 contains all you need to know about an arbitrary location on the grid.
16 struct wxPropertyGridHitTestResult
20 wxPGProperty
* GetProperty() const { return property
; }
22 /** Column. -1 for margin. */
25 /** Index of splitter hit, -1 for none. */
28 /** If splitter hit, offset to that */
29 int splitterHitOffset
;
32 /** Property. NULL if empty space below properties was hit */
33 wxPGProperty
* property
;
36 // -----------------------------------------------------------------------
38 #define wxPG_IT_CHILDREN(A) (A<<16)
40 /** @section propgrid_iterator_flags wxPropertyGridIterator Flags
43 NOTES: At lower 16-bits, there are flags to check if item will be included. At higher
44 16-bits, there are same flags, but to instead check if children will be included.
47 enum wxPG_ITERATOR_FLAGS
50 /** Iterate through 'normal' property items (does not include children of aggregate or hidden items by default).
52 wxPG_ITERATE_PROPERTIES
= (wxPG_PROP_PROPERTY
|wxPG_PROP_MISC_PARENT
|wxPG_PROP_AGGREGATE
| \
53 wxPG_PROP_COLLAPSED
|((wxPG_PROP_MISC_PARENT
|wxPG_PROP_CATEGORY
)<<16)),
55 /** Iterate children of collapsed parents, and individual items that are hidden.
57 wxPG_ITERATE_HIDDEN
= (wxPG_PROP_HIDDEN
|wxPG_IT_CHILDREN(wxPG_PROP_COLLAPSED
)),
59 /** Iterate children of parent that is an aggregate property (ie. has fixed children).
61 wxPG_ITERATE_FIXED_CHILDREN
= (wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE
)|wxPG_ITERATE_PROPERTIES
),
63 /** Iterate categories. Note that even without this flag, children of categories
64 are still iterated through.
66 wxPG_ITERATE_CATEGORIES
= (wxPG_PROP_CATEGORY
|wxPG_IT_CHILDREN(wxPG_PROP_CATEGORY
)|wxPG_PROP_COLLAPSED
),
68 wxPG_ITERATE_ALL_PARENTS
= (wxPG_PROP_MISC_PARENT
|wxPG_PROP_AGGREGATE
|wxPG_PROP_CATEGORY
),
70 wxPG_ITERATE_ALL_PARENTS_RECURSIVELY
= (wxPG_ITERATE_ALL_PARENTS
|wxPG_IT_CHILDREN(wxPG_ITERATE_ALL_PARENTS
)),
72 wxPG_ITERATOR_FLAGS_ALL
= (wxPG_PROP_PROPERTY
|wxPG_PROP_MISC_PARENT
|wxPG_PROP_AGGREGATE
| \
73 wxPG_PROP_HIDDEN
|wxPG_PROP_CATEGORY
|wxPG_PROP_COLLAPSED
),
75 wxPG_ITERATOR_MASK_OP_ITEM
= wxPG_ITERATOR_FLAGS_ALL
,
77 wxPG_ITERATOR_MASK_OP_PARENT
= wxPG_ITERATOR_FLAGS_ALL
, // (wxPG_PROP_MISC_PARENT|wxPG_PROP_AGGREGATE|wxPG_PROP_CATEGORY)
79 /** Combines all flags needed to iterate through visible properties
80 (ie. hidden properties and children of collapsed parents are skipped).
82 wxPG_ITERATE_VISIBLE
= (wxPG_ITERATE_PROPERTIES
|wxPG_PROP_CATEGORY
|wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE
)),
84 /** Iterate all items.
86 wxPG_ITERATE_ALL
= (wxPG_ITERATE_VISIBLE
|wxPG_ITERATE_HIDDEN
),
88 /** Iterate through individual properties (ie. categories and children of
89 aggregate properties are skipped).
91 wxPG_ITERATE_NORMAL
= (wxPG_ITERATE_PROPERTIES
|wxPG_ITERATE_HIDDEN
),
93 /** Default iterator flags.
95 wxPG_ITERATE_DEFAULT
= wxPG_ITERATE_NORMAL
104 @section propgrid_iterator_class wxPropertyGridIterator
106 Preferable way to iterate through contents of wxPropertyGrid,
107 wxPropertyGridManager, and wxPropertyGridPage.
109 See wxPropertyGridInterface::GetIterator() for more information about usage.
114 class wxPropertyGridIterator
: public wxPropertyGridIteratorBase
118 void Assign( const wxPropertyGridIteratorBase
& it
);
120 bool AtEnd() const { return m_property
== NULL
; }
123 Get current property.
125 wxPGProperty
* GetProperty() const { return m_property
; }
128 Iterate to the next property.
130 void Next( bool iterateChildren
= true );
133 Iterate to the previous property.
140 // -----------------------------------------------------------------------
143 @section propgrid_viterator_class wxPGVIterator
145 Abstract implementation of a simple iterator. Can only be used
146 to iterate in forward order, and only through the entire container.
147 Used to have functions dealing with all properties work with both
148 wxPropertyGrid and wxPropertyGridManager.
153 wxPGVIterator() { m_pIt
= NULL
; }
154 wxPGVIterator( wxPGVIteratorBase
* obj
) { m_pIt
= obj
; }
155 ~wxPGVIterator() { UnRef(); }
156 void UnRef() { if (m_pIt
) m_pIt
->DecRef(); }
157 wxPGVIterator( const wxPGVIterator
& it
)
162 const wxPGVIterator
& operator=( const wxPGVIterator
& it
)
169 void Next() { m_pIt
->Next(); }
170 bool AtEnd() const { return m_pIt
->m_it
.AtEnd(); }
171 wxPGProperty
* GetProperty() const { return m_pIt
->m_it
.GetProperty(); }
173 wxPGVIteratorBase
* m_pIt
;