From 7261371b17e5927b451c62c8683f40b4df338895 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Tue, 2 Feb 2010 15:19:41 +0000 Subject: [PATCH] Do not clear property selection when adding new properties, but instead correct positions of any open editor controls. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 3 +++ src/propgrid/propgridiface.cpp | 6 ++++-- src/propgrid/propgridpagestate.cpp | 4 ---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index d74291cfd3..296559d4ee 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1564,6 +1564,9 @@ void wxPropertyGrid::PrepareAfterItemsAdded() Sort(wxPG_SORT_TOP_LEVEL_ONLY); RecalculateVirtualSize(); + + // Fix editor position + CorrectEditorWidgetPosY(); } // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index cbef5d654e..9ea84d5b42 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -587,8 +587,6 @@ void wxPropertyGridInterface::Sort( int flags ) { wxPropertyGrid* pg = GetPropertyGrid(); - pg->DoClearSelection(); - unsigned int pageIndex = 0; for (;;) @@ -598,6 +596,10 @@ void wxPropertyGridInterface::Sort( int flags ) page->DoSort(flags); pageIndex++; } + + // Fix positions of any open editor controls + if ( pg ) + pg->CorrectEditorWidgetPosY(); } // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 8c8d00667e..80da0f9388 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1671,10 +1671,6 @@ bool wxPropertyGridPageState::PrepareToAddItem( wxPGProperty* property, } #endif // wxDEBUG_LEVEL - // Make sure nothing is selected. - if ( propGrid ) - propGrid->ClearSelection(false); - // NULL parent == root parent if ( !scheduledParent ) scheduledParent = DoGetRoot(); -- 2.45.2