1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPGProperty
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
10 @section propgrid_hittestresult wxPropertyGridHitTestResult
12 A return value from wxPropertyGrid::HitTest(),
13 contains all you need to know about an arbitrary location on the grid.
15 struct wxPropertyGridHitTestResult
19 wxPGProperty
* GetProperty() const { return property
; }
21 /** Column. -1 for margin. */
24 /** Index of splitter hit, -1 for none. */
27 /** If splitter hit, offset to that */
28 int splitterHitOffset
;
31 /** Property. NULL if empty space below properties was hit */
32 wxPGProperty
* property
;
35 // -----------------------------------------------------------------------
37 #define wxPG_IT_CHILDREN(A) (A<<16)
39 /** @section propgrid_iterator_flags wxPropertyGridIterator Flags
42 NOTES: At lower 16-bits, there are flags to check if item will be included. At higher
43 16-bits, there are same flags, but to instead check if children will be included.
46 enum wxPG_ITERATOR_FLAGS
49 /** Iterate through 'normal' property items (does not include children of aggregate or hidden items by default).
51 wxPG_ITERATE_PROPERTIES
= (wxPG_PROP_PROPERTY
|wxPG_PROP_MISC_PARENT
|wxPG_PROP_AGGREGATE
| \
52 wxPG_PROP_COLLAPSED
|((wxPG_PROP_MISC_PARENT
|wxPG_PROP_CATEGORY
)<<16)),
54 /** Iterate children of collapsed parents, and individual items that are hidden.
56 wxPG_ITERATE_HIDDEN
= (wxPG_PROP_HIDDEN
|wxPG_IT_CHILDREN(wxPG_PROP_COLLAPSED
)),
58 /** Iterate children of parent that is an aggregate property (ie. has fixed children).
60 wxPG_ITERATE_FIXED_CHILDREN
= (wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE
)|wxPG_ITERATE_PROPERTIES
),
62 /** Iterate categories. Note that even without this flag, children of categories
63 are still iterated through.
65 wxPG_ITERATE_CATEGORIES
= (wxPG_PROP_CATEGORY
|wxPG_IT_CHILDREN(wxPG_PROP_CATEGORY
)|wxPG_PROP_COLLAPSED
),
67 wxPG_ITERATE_ALL_PARENTS
= (wxPG_PROP_MISC_PARENT
|wxPG_PROP_AGGREGATE
|wxPG_PROP_CATEGORY
),
69 wxPG_ITERATE_ALL_PARENTS_RECURSIVELY
= (wxPG_ITERATE_ALL_PARENTS
|wxPG_IT_CHILDREN(wxPG_ITERATE_ALL_PARENTS
)),
71 wxPG_ITERATOR_FLAGS_ALL
= (wxPG_PROP_PROPERTY
|wxPG_PROP_MISC_PARENT
|wxPG_PROP_AGGREGATE
| \
72 wxPG_PROP_HIDDEN
|wxPG_PROP_CATEGORY
|wxPG_PROP_COLLAPSED
),
74 wxPG_ITERATOR_MASK_OP_ITEM
= wxPG_ITERATOR_FLAGS_ALL
,
76 wxPG_ITERATOR_MASK_OP_PARENT
= wxPG_ITERATOR_FLAGS_ALL
, // (wxPG_PROP_MISC_PARENT|wxPG_PROP_AGGREGATE|wxPG_PROP_CATEGORY)
78 /** Combines all flags needed to iterate through visible properties
79 (ie. hidden properties and children of collapsed parents are skipped).
81 wxPG_ITERATE_VISIBLE
= (wxPG_ITERATE_PROPERTIES
|wxPG_PROP_CATEGORY
|wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE
)),
83 /** Iterate all items.
85 wxPG_ITERATE_ALL
= (wxPG_ITERATE_VISIBLE
|wxPG_ITERATE_HIDDEN
),
87 /** Iterate through individual properties (ie. categories and children of
88 aggregate properties are skipped).
90 wxPG_ITERATE_NORMAL
= (wxPG_ITERATE_PROPERTIES
|wxPG_ITERATE_HIDDEN
),
92 /** Default iterator flags.
94 wxPG_ITERATE_DEFAULT
= wxPG_ITERATE_NORMAL
103 @section propgrid_iterator_class wxPropertyGridIterator
105 Preferable way to iterate through contents of wxPropertyGrid,
106 wxPropertyGridManager, and wxPropertyGridPage.
108 See wxPropertyGridInterface::GetIterator() for more information about usage.
113 class wxPropertyGridIterator
: public wxPropertyGridIteratorBase
117 void Assign( const wxPropertyGridIteratorBase
& it
);
119 bool AtEnd() const { return m_property
== NULL
; }
122 Get current property.
124 wxPGProperty
* GetProperty() const { return m_property
; }
127 Iterate to the next property.
129 void Next( bool iterateChildren
= true );
132 Iterate to the previous property.
139 // -----------------------------------------------------------------------
142 @section propgrid_viterator_class wxPGVIterator
144 Abstract implementation of a simple iterator. Can only be used
145 to iterate in forward order, and only through the entire container.
146 Used to have functions dealing with all properties work with both
147 wxPropertyGrid and wxPropertyGridManager.
152 wxPGVIterator() { m_pIt
= NULL
; }
153 wxPGVIterator( wxPGVIteratorBase
* obj
) { m_pIt
= obj
; }
154 ~wxPGVIterator() { UnRef(); }
155 void UnRef() { if (m_pIt
) m_pIt
->DecRef(); }
156 wxPGVIterator( const wxPGVIterator
& it
)
161 const wxPGVIterator
& operator=( const wxPGVIterator
& it
)
168 void Next() { m_pIt
->Next(); }
169 bool AtEnd() const { return m_pIt
->m_it
.AtEnd(); }
170 wxPGProperty
* GetProperty() const { return m_pIt
->m_it
.GetProperty(); }
172 wxPGVIteratorBase
* m_pIt
;