From c91681e15df0b9146e0c64aecd7f6b1ba5f410e4 Mon Sep 17 00:00:00 2001 From: Thorsten Bosbach Date: Wed, 9 Jun 2010 13:37:47 +0200 Subject: #i111784 CWS gridcontrol_03: Tablecontrol.select does not trigger selection event --- automation/source/server/statemnt.cxx | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 87f479d67512..bfe6c30364ad 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -5341,12 +5341,12 @@ BOOL StatementControl::Execute() ReportError( aUId, GEN_RES_STR1( S_HELPID_ON_TOOLBOX_NOT_FOUND, MethodString( nMethodId ) ) );\ else\ {\ - if ( !pTB->IsItemEnabled( pTB->GetItemId(nItemPos) ) && nMethodId != _M_IsEnabled )\ + if ( !pTB->IsItemEnabled( pTB->GetItemId(nItemPos) ) && nMethodId != _M_IsEnabled && nMethodId != M_GetState )\ {\ ReportError( aUId, GEN_RES_STR1( S_BUTTON_DISABLED_ON_TOOLBOX, MethodString( nMethodId ) ) );\ bItemFound = FALSE;\ }\ - else if ( !pTB->IsItemVisible( pTB->GetItemId(nItemPos) ) )\ + else if ( !pTB->IsItemVisible( pTB->GetItemId(nItemPos) ) && nMethodId != M_GetState )\ {\ ReportError( aUId, GEN_RES_STR1( S_BUTTON_HIDDEN_ON_TOOLBOX, MethodString( nMethodId ) ) );\ bItemFound = FALSE;\ @@ -5738,19 +5738,28 @@ BOOL StatementControl::Execute() pRet->GenReturn ( RET_Value, aUId, comm_ULONG( pItem->GetButtonFlags() & ~SV_STATE_MASK )); break; case M_Check : - pItem->SetStateChecked(); - pTree->CheckButtonHdl(); - pTree->InvalidateEntry( pThisEntry ); + if ( !pItem->IsStateChecked() ) + { + pItem->SetStateChecked(); + pTree->CheckButtonHdl(); + pTree->InvalidateEntry( pThisEntry ); + } break; case M_UnCheck : - pItem->SetStateUnchecked(); - pTree->CheckButtonHdl(); - pTree->InvalidateEntry( pThisEntry ); + if ( pItem->IsStateChecked() || pItem->IsStateTristate() ) + { + pItem->SetStateUnchecked(); + pTree->CheckButtonHdl(); + pTree->InvalidateEntry( pThisEntry ); + } break; case M_TriState : - pItem->SetStateTristate(); - pTree->CheckButtonHdl(); - pTree->InvalidateEntry( pThisEntry ); + if ( !pItem->IsStateTristate() ) + { + pItem->SetStateTristate(); + pTree->CheckButtonHdl(); + pTree->InvalidateEntry( pThisEntry ); + } break; default: ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) ); -- cgit