mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 04:18:48 +02:00
win32: apply patch of cobines to fix page size after a tab caption change (bug #0018955)
git-svn-id: trunk@35199 -
This commit is contained in:
parent
a8da22e5ec
commit
2dad53e522
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user