+bool wxPropertyGridPageState::DoIsPropertySelected( wxPGProperty* prop ) const
+{
+ const wxArrayPGProperty& selection = m_selection;
+
+ for ( unsigned int i=0; i<selection.size(); i++ )
+ {
+ if ( selection[i] == prop )
+ return true;
+ }
+
+ return false;
+}
+
+// -----------------------------------------------------------------------
+
+void wxPropertyGridPageState::DoRemoveFromSelection( wxPGProperty* prop )
+{
+ for ( unsigned int i=0; i<m_selection.size(); i++ )
+ {
+ if ( m_selection[i] == prop )
+ {
+ wxPropertyGrid* pg = m_pPropGrid;
+ if ( i == 0 && pg->GetState() == this )
+ {
+ // If first item (ie. one with the active editor) was
+ // deselected, then we need to take some extra measures.
+ wxArrayPGProperty sel = m_selection;
+ sel.erase( sel.begin() + i );
+
+ wxPGProperty* newFirst;
+ if ( sel.size() )
+ newFirst = sel[0];
+ else
+ newFirst = NULL;
+
+ pg->DoSelectProperty(newFirst,
+ wxPG_SEL_DONT_SEND_EVENT);
+
+ m_selection = sel;
+
+ pg->Refresh();
+ }
+ else
+ {
+ m_selection.erase( m_selection.begin() + i );
+ }
+ return;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+