cocoa: replacing use of GetNSObjectView with lclContentView

git-svn-id: trunk@61763 -
This commit is contained in:
dmitry 2019-08-27 19:11:22 +00:00
parent c369647805
commit 5e4157f40b
2 changed files with 3 additions and 6 deletions

View File

@ -910,7 +910,7 @@ var
begin
p := nil;
if (AParams.WndParent <> 0) then
p := CocoaUtils.GetNSObjectView(NSObject(AParams.WndParent));
p := NSView(AParams.WndParent).lclContentView;
if Assigned(p) then
LCLToNSRect(Types.Bounds(AParams.X, AParams.Y, AParams.Width, AParams.Height),

View File

@ -1411,7 +1411,7 @@ var
cr:TCocoaCursor;
begin
Result := False;
View := CocoaUtils.GetNSObjectView(Owner);
View := HandleFrame.lclContentView;
if View = nil then Exit;
if not Assigned(Target) then Exit;
if not (csDesigning in Target.ComponentState) then
@ -1607,10 +1607,7 @@ var
begin
if not AWinControl.HandleAllocated then Exit;
//todo: GetNSObjectView must be replaced with oop approach
// note that client rect might be smaller than the bounds of TWinControl itself
// thus extra size should be adapted
lView := CocoaUtils.GetNSObjectView(NSObject(AWinControl.Handle));
lView := NSObject(AWinControl.Handle).lclContentView;
if lView = nil then Exit;
//todo: using fittingSize is wrong - it's based on constraints of the control solely.