mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 00:19:15 +02:00
cocoa: updating windowState. Patch by Zoë Peterson. #35622
git-svn-id: trunk@61287 -
This commit is contained in:
parent
544969faaf
commit
d4240fda12
@ -67,6 +67,7 @@ type
|
||||
procedure Close;
|
||||
procedure Resize;
|
||||
procedure Move;
|
||||
procedure WindowStateChanged;
|
||||
|
||||
function GetEnabled: Boolean;
|
||||
procedure SetEnabled(AValue: Boolean);
|
||||
@ -136,6 +137,8 @@ type
|
||||
procedure windowDidResignKey(notification: NSNotification); message 'windowDidResignKey:';
|
||||
procedure windowDidResize(notification: NSNotification); message 'windowDidResize:';
|
||||
procedure windowDidMove(notification: NSNotification); message 'windowDidMove:';
|
||||
procedure windowDidMiniaturize(notification: NSNotification); message 'windowDidMiniaturize:';
|
||||
procedure windowDidDeminiaturize(notification: NSNotification); message 'windowDidDeminiaturize:';
|
||||
// fullscreen notifications are only reported for 10.7 fullscreen
|
||||
procedure windowWillEnterFullScreen(notification: NSNotification); message 'windowWillEnterFullScreen:';
|
||||
procedure windowDidEnterFullScreen(notification: NSNotification); message 'windowDidEnterFullScreen:';
|
||||
@ -209,6 +212,7 @@ type
|
||||
function lclOwnWindow: NSWindow; message 'lclOwnWindow';
|
||||
procedure lclSetFrame(const r: TRect); override;
|
||||
function lclFrame: TRect; override;
|
||||
function lclWindowState: Integer; override;
|
||||
procedure viewDidMoveToSuperview; override;
|
||||
procedure viewDidMoveToWindow; override;
|
||||
procedure viewWillMoveToWindow(newWindow: CocoaAll.NSWindow); override;
|
||||
@ -444,6 +448,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCocoaWindowContent.lclWindowState: Integer;
|
||||
begin
|
||||
if isembedded then
|
||||
Result := inherited lclWindowState
|
||||
else
|
||||
Result := window.lclWindowState;
|
||||
end;
|
||||
|
||||
procedure TCocoaWindowContent.viewDidMoveToSuperview;
|
||||
begin
|
||||
inherited viewDidMoveToSuperview;
|
||||
@ -780,6 +792,18 @@ begin
|
||||
callback.Move;
|
||||
end;
|
||||
|
||||
procedure TCocoaWindow.windowDidMiniaturize(notification: NSNotification);
|
||||
begin
|
||||
if Assigned(callback) then
|
||||
callback.WindowStateChanged;
|
||||
end;
|
||||
|
||||
procedure TCocoaWindow.windowDidDeminiaturize(notification: NSNotification);
|
||||
begin
|
||||
if Assigned(callback) then
|
||||
callback.WindowStateChanged;
|
||||
end;
|
||||
|
||||
procedure TCocoaWindow.windowWillEnterFullScreen(notification: NSNotification);
|
||||
begin
|
||||
if not isInFullScreen then isInFullScreen := true;
|
||||
|
@ -51,6 +51,7 @@ type
|
||||
procedure Close; virtual;
|
||||
procedure Resize; virtual;
|
||||
procedure Move; virtual;
|
||||
procedure WindowStateChanged; virtual;
|
||||
|
||||
function GetEnabled: Boolean; virtual;
|
||||
procedure SetEnabled(AValue: Boolean); virtual;
|
||||
@ -428,6 +429,15 @@ begin
|
||||
boundsDidChange(Owner);
|
||||
end;
|
||||
|
||||
procedure TLCLWindowCallback.WindowStateChanged;
|
||||
var
|
||||
Bounds: TRect;
|
||||
begin
|
||||
Bounds := HandleFrame.lclFrame;
|
||||
LCLSendSizeMsg(Target, Bounds.Right - Bounds.Left, Bounds.Bottom - Bounds.Top,
|
||||
Owner.lclWindowState, True);
|
||||
end;
|
||||
|
||||
function TLCLWindowCallback.GetEnabled: Boolean;
|
||||
begin
|
||||
Result := Owner.lclIsEnabled;
|
||||
|
Loading…
Reference in New Issue
Block a user