Commit dfa3fe0e authored by Martin's avatar Martin
Browse files

TTabControl: reverted/replaced r64424 #ed6e0875: "fix ClientOrigin, Issue...

TTabControl: reverted/replaced r64424 #ed6e0875: "fix ClientOrigin, Issue #38403 - Need the origin of the child TabControl".
Modifying the ClientOrigin affects child-controls of the TTabControl.
Also fixes issue #38422, endless recursion if no handle was allocated.

git-svn-id: trunk@64436 -
parent 6fc365af
......@@ -839,7 +839,6 @@ type
procedure AdjustDisplayRectWithBorder(var ARect: TRect); virtual;
procedure AdjustClientRect(var ARect: TRect); override;
function CreateTabNoteBookStrings: TTabControlNoteBookStrings; virtual;
function GetClientOrigin: TPoint; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
......
......@@ -758,11 +758,6 @@ begin
Result := TTabControlNoteBookStrings.Create(Self);
end;
function TTabControl.GetClientOrigin: TPoint;
begin
Result := TTabControlNoteBookStrings(FTabs).FNoteBook.ClientOrigin;
end;
constructor TTabControl.Create(TheOwner: TComponent);
begin
FTabControlCreating:=true;
......@@ -794,13 +789,17 @@ begin
end;
function TTabControl.IndexOfTabAt(X, Y: Integer): Integer;
var
Offs: TPoint;
begin
Result:=TTabControlStrings(FTabs).IndexOfTabAt(X,Y);
Offs := TTabControlNoteBookStrings(FTabs).FNoteBook.ClientOrigin;
Offs := Offs.Subtract(ClientOrigin);
Result:=TTabControlStrings(FTabs).IndexOfTabAt(X-Offs.X, Y-Offs.Y);
end;
function TTabControl.IndexOfTabAt(P: TPoint): Integer;
begin
Result:=TTabControlStrings(FTabs).IndexOfTabAt(P.x, P.y);
Result:=IndexOfTabAt(P.x, P.y);
end;
function TTabControl.GetHitTestInfoAt(X, Y: Integer): THitTests;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment