/** Base class to derive new viterators.
*/
-class WXDLLIMPEXP_PROPGRID wxPGVIteratorBase
+class WXDLLIMPEXP_PROPGRID wxPGVIteratorBase : public wxObjectRefData
{
friend class wxPGVIterator;
public:
- wxPGVIteratorBase() { m_refCount = 1; }
+ wxPGVIteratorBase() { }
virtual void Next() = 0;
- void IncRef()
- {
- m_refCount++;
- }
- void DecRef()
- {
- m_refCount--;
- if ( m_refCount <= 0 )
- delete this;
- }
protected:
virtual ~wxPGVIteratorBase() { }
wxPropertyGridIterator m_it;
-private:
- int m_refCount;
};
/** @class wxPGVIterator
return (unsigned int) m_colWidths.size();
}
- wxPGProperty* GetSelection() const
- {
- return m_selected;
- }
-
int GetColumnMinWidth( int column ) const;
int GetColumnWidth( unsigned int column ) const
return ((wxPropertyGridPageState*)this)->GetLastItem(flags);
}
+ /**
+ Returns currently selected property.
+ */
+ wxPGProperty* GetSelection() const
+ {
+ if ( m_selection.size() == 0 )
+ return NULL;
+ return m_selection[0];
+ }
+
+ void DoSetSelection( wxPGProperty* prop )
+ {
+ m_selection.clear();
+ if ( prop )
+ m_selection.push_back(prop);
+ }
+
+ bool DoClearSelection()
+ {
+ return DoSelectProperty(NULL);
+ }
+
wxPropertyCategory* GetPropertyCategory( const wxPGProperty* p ) const;
wxPGProperty* GetPropertyByLabel( const wxString& name,
bool PrepareAfterItemsAdded();
- void SetSelection( wxPGProperty* p ) { m_selected = p; }
-
/** Called after virtual height needs to be recalculated.
*/
void VirtualHeightChanged()
/** Returns property by its name. */
wxPGProperty* BaseGetPropertyByName( const wxString& name ) const;
- void DoClearSelection()
- {
- m_selected = NULL;
- }
-
/** Called in, for example, wxPropertyGrid::Clear. */
void DoClear();
+ bool DoIsPropertySelected( wxPGProperty* prop ) const;
+
bool DoCollapse( wxPGProperty* p );
bool DoExpand( wxPGProperty* p );
/** Most recently added category. */
wxPropertyCategory* m_currentCategory;
- /** Pointer to selected property. */
- wxPGProperty* m_selected;
+ /** Array of selected property. */
+ wxArrayPGProperty m_selection;
/** Virtual width. */
int m_width;