1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPGProperty
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
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
102 /** @section propgrid_iterator_class wxPropertyGridIterator
104 Preferable way to iterate through contents of wxPropertyGrid,
105 wxPropertyGridManager, and wxPropertyGridPage.
107 See wxPropertyGridInterface::GetIterator() for more information about usage.
112 class wxPropertyGridIterator
: public wxPropertyGridIteratorBase
116 void Assign( const wxPropertyGridIteratorBase
& it
);
118 bool AtEnd() const { return m_property
== NULL
; }
120 /** Get current property.
122 wxPGProperty
* GetProperty() const { return m_property
; }
124 /** Iterate to the next property.
126 void Next( bool iterateChildren
= true );
128 /** Iterate to the previous property.
135 // -----------------------------------------------------------------------
137 /** @section propgrid_viterator_class wxPGVIterator
139 Abstract implementation of a simple iterator. Can only be used
140 to iterate in forward order, and only through the entire container.
141 Used to have functions dealing with all properties work with both
142 wxPropertyGrid and wxPropertyGridManager.
147 wxPGVIterator() { m_pIt
= NULL
; }
148 wxPGVIterator( wxPGVIteratorBase
* obj
) { m_pIt
= obj
; }
149 ~wxPGVIterator() { UnRef(); }
150 void UnRef() { if (m_pIt
) m_pIt
->DecRef(); }
151 wxPGVIterator( const wxPGVIterator
& it
)
156 const wxPGVIterator
& operator=( const wxPGVIterator
& it
)
163 void Next() { m_pIt
->Next(); }
164 bool AtEnd() const { return m_pIt
->m_it
.AtEnd(); }
165 wxPGProperty
* GetProperty() const { return m_pIt
->m_it
.GetProperty(); }
167 wxPGVIteratorBase
* m_pIt
;