Clear grid selection more consistently prior clear operations; improved Clear() tests (fixes #10497)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1005,12 +1005,29 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
RT_START_TEST(ManagerClear)
|
RT_START_TEST(Clear)
|
||||||
|
|
||||||
|
// Manager clear
|
||||||
|
pgman->SelectProperty("Label");
|
||||||
pgman->Clear();
|
pgman->Clear();
|
||||||
|
|
||||||
if ( pgman->GetPageCount() )
|
if ( pgman->GetPageCount() )
|
||||||
RT_FAILURE();
|
RT_FAILURE();
|
||||||
|
|
||||||
|
if ( pgman->GetGrid()->GetRoot()->GetChildCount() )
|
||||||
|
RT_FAILURE();
|
||||||
|
|
||||||
|
// Recreate the original grid
|
||||||
|
CreateGrid( -1, -1 );
|
||||||
|
pgman = m_pPropGridManager;
|
||||||
|
|
||||||
|
// Grid clear
|
||||||
|
pgman->SelectProperty("Label");
|
||||||
|
pgman->GetGrid()->Clear();
|
||||||
|
|
||||||
|
if ( pgman->GetGrid()->GetRoot()->GetChildCount() )
|
||||||
|
RT_FAILURE();
|
||||||
|
|
||||||
// Recreate the original grid
|
// Recreate the original grid
|
||||||
CreateGrid( -1, -1 );
|
CreateGrid( -1, -1 );
|
||||||
pgman = m_pPropGridManager;
|
pgman = m_pPropGridManager;
|
||||||
|
@@ -657,6 +657,8 @@ wxPropertyGridPageState* wxPropertyGridManager::GetPageState( int page ) const
|
|||||||
|
|
||||||
void wxPropertyGridManager::Clear()
|
void wxPropertyGridManager::Clear()
|
||||||
{
|
{
|
||||||
|
m_pPropGrid->ClearSelection(false);
|
||||||
|
|
||||||
m_pPropGrid->Freeze();
|
m_pPropGrid->Freeze();
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@@ -2114,8 +2114,6 @@ void wxPropertyGrid::Refresh( bool WXUNUSED(eraseBackground),
|
|||||||
|
|
||||||
void wxPropertyGrid::Clear()
|
void wxPropertyGrid::Clear()
|
||||||
{
|
{
|
||||||
ClearSelection(false);
|
|
||||||
|
|
||||||
m_pState->DoClear();
|
m_pState->DoClear();
|
||||||
|
|
||||||
m_propHover = NULL;
|
m_propHover = NULL;
|
||||||
|
@@ -268,6 +268,15 @@ void wxPropertyGridPageState::InitNonCatMode()
|
|||||||
|
|
||||||
void wxPropertyGridPageState::DoClear()
|
void wxPropertyGridPageState::DoClear()
|
||||||
{
|
{
|
||||||
|
if ( m_pPropGrid->GetState() == this )
|
||||||
|
{
|
||||||
|
m_pPropGrid->ClearSelection(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_selected = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
m_regularArray.Empty();
|
m_regularArray.Empty();
|
||||||
if ( m_abcArray )
|
if ( m_abcArray )
|
||||||
m_abcArray->Empty();
|
m_abcArray->Empty();
|
||||||
@@ -280,8 +289,6 @@ void wxPropertyGridPageState::DoClear()
|
|||||||
|
|
||||||
m_virtualHeight = 0;
|
m_virtualHeight = 0;
|
||||||
m_vhCalcPending = 0;
|
m_vhCalcPending = 0;
|
||||||
|
|
||||||
m_selected = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user