From 30e9e11e8c5c05467710ad8cefdb15be0c48a436 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Fri, 4 Jan 2019 11:20:10 +0000 Subject: [PATCH] LCL: TCustomTabControl: don't fire OnChanging when programatically changing TabIndex/PageIndex. Patch by Michl. Issue #0033720. git-svn-id: trunk@59985 - --- lcl/include/customnotebook.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index 0da7ac09c0..cf0aef9387 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -581,7 +581,7 @@ begin if (AValue < -1) or (AValue >= PageCount) then Exit; //debugln('TCustomTabControl.SetPageIndex A ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated),' ',dbgs(ComponentState)); if FPageIndex = AValue then exit; - if not CanChangePageIndex then exit; + if (nboDoChangeOnSetIndex in Options) and (not CanChangePageIndex) then exit; //Delphi does not call CanChange either //debugln('TCustomTabControl.SetPageIndex B ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated)); InternalSetPageIndex(AValue);