LCL-Win32: Fix TWin32WSCustomTabControl.GetTabRect. Issue #36412, patch from BrunoK.

git-svn-id: trunk@62366 -
This commit is contained in:
juha 2019-12-09 19:38:52 +00:00
parent 6fe2341ba0
commit dfdf67a3f0

View File

@ -615,11 +615,8 @@ var
hittestInfo: TC_HITTESTINFO;
Orect: TRect;
begin
if ATabControl is TTabControl then begin
Result := 0;;
exit;
end;
if ATabControl is TTabControl then
exit(0);
GetLCLClientBoundsOffset(ATabControl, ORect);
hittestInfo.pt.x := AClientPos.x + ORect.Left;
hittestInfo.pt.y := AClientPos.y + ORect.Top;
@ -628,8 +625,6 @@ end;
class function TWin32WSCustomTabControl.GetTabRect(const ATabControl: TCustomTabControl;
const AIndex: Integer): TRect;
var
Orect: TRect;
begin
if ATabControl is TTabControl then begin
Result.Top := 0;;
@ -638,16 +633,8 @@ begin
Result.Right := 0;;
exit;
end;
GetLCLClientBoundsOffset(ATabControl, ORect);
if Windows.SendMessage(ATabControl.Handle, TCM_GETITEMRECT, WPARAM(AIndex), LPARAM(@Result)) <> 0
then begin
Result.Top := Result.Top - Orect.Top;
Result.Bottom := Result.Bottom - Orect.Top;
Result.Left := Result.Left - Orect.Left;
Result.Right := Result.Right - Orect.Left;
end
else
if Windows.SendMessage(ATabControl.Handle, TCM_GETITEMRECT, WPARAM(AIndex), LPARAM(@Result)) = 0
then
Result := inherited GetTabRect(ATabControl, AIndex);
end;