mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 23:00:27 +02:00
carbon: some fixes for TWinControl.ParentWindow
git-svn-id: trunk@23990 -
This commit is contained in:
parent
75c0134975
commit
62f6cb12cf
@ -997,9 +997,13 @@ var
|
||||
begin
|
||||
Window := LCLObject.GetTopParent;
|
||||
|
||||
if (Window is TWinControl) and (Window.Parent = nil) and (TWinControl(Window).ParentWindow <> 0) then
|
||||
Result := TCarbonControl(TWinControl(Window).ParentWindow).GetTopParentWindow
|
||||
else
|
||||
if Window is TCustomForm then
|
||||
Result := TCarbonWindow((Window as TWinControl).Handle).GetTopParentWindow
|
||||
else Result := nil;
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -1281,19 +1281,19 @@ procedure TCarbonWindow.AddToWidget(AParent: TCarbonWidget);
|
||||
begin
|
||||
if Assigned(AParent) then
|
||||
begin
|
||||
fWindowRef := nil;
|
||||
fHiddenWin := fWindowRef;
|
||||
fWindowRef := nil;
|
||||
if IsWindowVisible(fHiddenWin) then HideWindow(fHiddenWin);
|
||||
OSError(HIViewAddSubview(AParent.Content, FScrollView), Self, 'AddToWidget', SViewAddView);
|
||||
AParent.ControlAdded;
|
||||
SetClientAlign(fScrollView, fWinContent, false);
|
||||
SetClientAlign(FScrollView, fWinContent, false);
|
||||
end else begin
|
||||
if IsVisible then
|
||||
begin
|
||||
ShowWindow(fHiddenWin);
|
||||
OSError(HIViewAddSubview(fWinContent, FScrollView), Self, 'AddToWidget', SViewAddView);
|
||||
end;
|
||||
SetClientAlign(fScrollView, fWinContent, true);
|
||||
SetClientAlign(FScrollView, fWinContent, true);
|
||||
fWindowRef := fHiddenWin;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user