mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 20:39:14 +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 Close;
|
||||||
procedure Resize;
|
procedure Resize;
|
||||||
procedure Move;
|
procedure Move;
|
||||||
|
procedure WindowStateChanged;
|
||||||
|
|
||||||
function GetEnabled: Boolean;
|
function GetEnabled: Boolean;
|
||||||
procedure SetEnabled(AValue: Boolean);
|
procedure SetEnabled(AValue: Boolean);
|
||||||
@ -136,6 +137,8 @@ type
|
|||||||
procedure windowDidResignKey(notification: NSNotification); message 'windowDidResignKey:';
|
procedure windowDidResignKey(notification: NSNotification); message 'windowDidResignKey:';
|
||||||
procedure windowDidResize(notification: NSNotification); message 'windowDidResize:';
|
procedure windowDidResize(notification: NSNotification); message 'windowDidResize:';
|
||||||
procedure windowDidMove(notification: NSNotification); message 'windowDidMove:';
|
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
|
// fullscreen notifications are only reported for 10.7 fullscreen
|
||||||
procedure windowWillEnterFullScreen(notification: NSNotification); message 'windowWillEnterFullScreen:';
|
procedure windowWillEnterFullScreen(notification: NSNotification); message 'windowWillEnterFullScreen:';
|
||||||
procedure windowDidEnterFullScreen(notification: NSNotification); message 'windowDidEnterFullScreen:';
|
procedure windowDidEnterFullScreen(notification: NSNotification); message 'windowDidEnterFullScreen:';
|
||||||
@ -209,6 +212,7 @@ type
|
|||||||
function lclOwnWindow: NSWindow; message 'lclOwnWindow';
|
function lclOwnWindow: NSWindow; message 'lclOwnWindow';
|
||||||
procedure lclSetFrame(const r: TRect); override;
|
procedure lclSetFrame(const r: TRect); override;
|
||||||
function lclFrame: TRect; override;
|
function lclFrame: TRect; override;
|
||||||
|
function lclWindowState: Integer; override;
|
||||||
procedure viewDidMoveToSuperview; override;
|
procedure viewDidMoveToSuperview; override;
|
||||||
procedure viewDidMoveToWindow; override;
|
procedure viewDidMoveToWindow; override;
|
||||||
procedure viewWillMoveToWindow(newWindow: CocoaAll.NSWindow); override;
|
procedure viewWillMoveToWindow(newWindow: CocoaAll.NSWindow); override;
|
||||||
@ -444,6 +448,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCocoaWindowContent.lclWindowState: Integer;
|
||||||
|
begin
|
||||||
|
if isembedded then
|
||||||
|
Result := inherited lclWindowState
|
||||||
|
else
|
||||||
|
Result := window.lclWindowState;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCocoaWindowContent.viewDidMoveToSuperview;
|
procedure TCocoaWindowContent.viewDidMoveToSuperview;
|
||||||
begin
|
begin
|
||||||
inherited viewDidMoveToSuperview;
|
inherited viewDidMoveToSuperview;
|
||||||
@ -780,6 +792,18 @@ begin
|
|||||||
callback.Move;
|
callback.Move;
|
||||||
end;
|
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);
|
procedure TCocoaWindow.windowWillEnterFullScreen(notification: NSNotification);
|
||||||
begin
|
begin
|
||||||
if not isInFullScreen then isInFullScreen := true;
|
if not isInFullScreen then isInFullScreen := true;
|
||||||
|
@ -51,6 +51,7 @@ type
|
|||||||
procedure Close; virtual;
|
procedure Close; virtual;
|
||||||
procedure Resize; virtual;
|
procedure Resize; virtual;
|
||||||
procedure Move; virtual;
|
procedure Move; virtual;
|
||||||
|
procedure WindowStateChanged; virtual;
|
||||||
|
|
||||||
function GetEnabled: Boolean; virtual;
|
function GetEnabled: Boolean; virtual;
|
||||||
procedure SetEnabled(AValue: Boolean); virtual;
|
procedure SetEnabled(AValue: Boolean); virtual;
|
||||||
@ -428,6 +429,15 @@ begin
|
|||||||
boundsDidChange(Owner);
|
boundsDidChange(Owner);
|
||||||
end;
|
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;
|
function TLCLWindowCallback.GetEnabled: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := Owner.lclIsEnabled;
|
Result := Owner.lclIsEnabled;
|
||||||
|
Loading…
Reference in New Issue
Block a user