From 2dad53e522d6de691e78df47a456c62daf9c2cd4 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 7 Feb 2012 05:11:44 +0000 Subject: [PATCH] win32: apply patch of cobines to fix page size after a tab caption change (bug #0018955) git-svn-id: trunk@35199 - --- lcl/interfaces/win32/win32pagecontrol.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/win32/win32pagecontrol.inc b/lcl/interfaces/win32/win32pagecontrol.inc index 274e9cb237..add3fddc02 100644 --- a/lcl/interfaces/win32/win32pagecontrol.inc +++ b/lcl/interfaces/win32/win32pagecontrol.inc @@ -169,12 +169,14 @@ end; class procedure TWin32WSCustomPage.SetText(const AWinControl: TWinControl; const AText: string); var TCI: TC_ITEM; + TabControl: TCustomTabControl; PageIndex, RealIndex: integer; TabControlHandle: HWND; begin + TabControl := TCustomTabControl(AWinControl.Parent); PageIndex := TCustomPage(AWinControl).PageIndex; - RealIndex := TCustomTabControl(AWinControl.Parent).PageToTabIndex(PageIndex); - TabControlHandle := AWinControl.Parent.Handle; + RealIndex := TabControl.PageToTabIndex(PageIndex); + TabControlHandle := TabControl.Handle; // We can't set label of a page not yet added, // Check for valid page index if (RealIndex >= 0) and (RealIndex < Windows.SendMessage(TabControlHandle, TCM_GETITEMCOUNT, 0, 0)) then @@ -200,6 +202,7 @@ begin TCI.pszText := PChar(AText); Windows.SendMessage(TabControlHandle, TCM_SETITEM, RealIndex, LPARAM(@TCI)); {$endif} + LCLControlSizeNeedsUpdate(TabControl, True); end; end; end;