]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgridiface.cpp
Added wxPropertyGrid::DedicateKey(), which prevents specific key presses from being...
[wxWidgets.git] / src / propgrid / propgridiface.cpp
index ecc6c0ef3004f1fe36384505af2aefc2c02e81b0..9acbb60a0ff9369ab1040f4922947f1a72819dd2 100644 (file)
@@ -73,10 +73,8 @@ wxPGProperty* wxPGPropArgCls::GetPtr( wxPropertyGridInterface* iface ) const
         return iface->GetPropertyByNameA(*m_ptr.stringName);
     else if ( m_flags & IsCharPtr )
         return iface->GetPropertyByNameA(m_ptr.charName);
-#if wxUSE_WCHAR_T
     else if ( m_flags & IsWCharPtr )
         return iface->GetPropertyByNameA(m_ptr.wcharName);
-#endif
 
     return NULL;
 }
@@ -166,10 +164,6 @@ wxPGProperty* wxPropertyGridInterface::RemoveProperty( wxPGPropArg id )
 
     state->DoDelete( p, false );
 
-    // Mark the property as 'unattached'
-    p->m_parentState = NULL;
-    p->m_parent = NULL;
-
     RefreshGrid(state);
 
     return p;
@@ -270,7 +264,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable )
             return false;
 
         // If active, Set active Editor.
-        if ( grid->GetState() == state && p == grid->GetSelection() )
+        if ( grid && grid->GetState() == state && p == grid->GetSelection() )
             grid->DoSelectProperty( p, wxPG_SEL_FORCE );
     }
     else
@@ -279,7 +273,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable )
             return false;
 
         // If active, Disable as active Editor.
-        if ( grid->GetState() == state && p == grid->GetSelection() )
+        if ( grid && grid->GetState() == state && p == grid->GetSelection() )
             grid->DoSelectProperty( p, wxPG_SEL_FORCE );
     }
 
@@ -350,6 +344,7 @@ void wxPropertyGridInterface::ClearModifiedStatus()
         if ( !page ) break;
 
         page->DoGetRoot()->SetFlagRecursively(wxPG_PROP_MODIFIED, false);
+        page->m_anyModified = false;
 
         pageIndex++;
     }
@@ -358,6 +353,17 @@ void wxPropertyGridInterface::ClearModifiedStatus()
     GetPropertyGrid()->RefreshEditor();
 }
 
+bool wxPropertyGridInterface::SetColumnProportion( unsigned int column,
+                                                   int proportion )
+{
+    wxCHECK(m_pState, false);
+    wxPropertyGrid* pg = m_pState->GetGrid();
+    wxCHECK(pg, false);
+    wxCHECK(pg->HasFlag(wxPG_SPLITTER_AUTO_CENTER), false);
+    m_pState->DoSetColumnProportion(column, proportion);
+    return true;
+}
+
 // -----------------------------------------------------------------------
 // wxPropertyGridInterface property value setting and getting
 // -----------------------------------------------------------------------
@@ -586,8 +592,6 @@ void wxPropertyGridInterface::Sort( int flags )
 {
     wxPropertyGrid* pg = GetPropertyGrid();
 
-    pg->DoClearSelection();
-
     unsigned int pageIndex = 0;
 
     for (;;)
@@ -597,6 +601,10 @@ void wxPropertyGridInterface::Sort( int flags )
         page->DoSort(flags);
         pageIndex++;
     }
+
+    // Fix positions of any open editor controls
+    if ( pg )
+        pg->CorrectEditorWidgetPosY();
 }
 
 // -----------------------------------------------------------------------