mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 04:58:11 +02:00
cocoa: implement ShowModal and CloseModal for TCustomForm
git-svn-id: trunk@34624 -
This commit is contained in:
parent
c4f0d1a633
commit
69347e3724
@ -97,8 +97,8 @@ type
|
||||
class function GetTextLen(const AWinControl: TWinControl; var ALength: Integer): Boolean; override;
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
|
||||
|
||||
// class procedure CloseModal(const ACustomForm: TCustomForm); override;
|
||||
// class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
||||
class procedure CloseModal(const ACustomForm: TCustomForm); override;
|
||||
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
||||
|
||||
class procedure SetAlphaBlend(const ACustomForm: TCustomForm; const AlphaBlend: Boolean; const Alpha: Byte); override;
|
||||
class procedure SetBorderIcons(const AForm: TCustomForm; const ABorderIcons: TBorderIcons); override;
|
||||
@ -146,6 +146,9 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
CocoaInt;
|
||||
|
||||
{ TLCLWindowCallback }
|
||||
|
||||
procedure TLCLWindowCallback.Activate;
|
||||
@ -182,15 +185,6 @@ end;
|
||||
|
||||
{ TCocoaWSCustomForm }
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCocoaWSCustomForm.CreateHandle
|
||||
Params: AWinControl - LCL control
|
||||
AParams - Creation parameters
|
||||
Returns: Handle to the window in Cocoa interface
|
||||
|
||||
Creates new window in Cocoa interface with the specified parameters
|
||||
------------------------------------------------------------------------------}
|
||||
|
||||
class procedure TCocoaWSCustomForm.SetStyleMaskFor(AWindow: NSWindow;
|
||||
ABorderStyle: TFormBorderStyle; ABorderIcons: TBorderIcons;
|
||||
ADesigning: Boolean);
|
||||
@ -291,6 +285,19 @@ begin
|
||||
ns.release;
|
||||
end;
|
||||
|
||||
class procedure TCocoaWSCustomForm.CloseModal(const ACustomForm: TCustomForm);
|
||||
begin
|
||||
if ACustomForm.HandleAllocated then
|
||||
if CocoaWidgetSet.NSApp.modalWindow = NSWindow(ACustomForm.Handle) then
|
||||
CocoaWidgetSet.NSApp.stopModal;
|
||||
end;
|
||||
|
||||
class procedure TCocoaWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||
begin
|
||||
if ACustomForm.HandleAllocated then
|
||||
CocoaWidgetSet.NSApp.runModalForWindow(NSWindow(ACustomForm.Handle));
|
||||
end;
|
||||
|
||||
class procedure TCocoaWSCustomForm.SetAlphaBlend(const ACustomForm: TCustomForm; const AlphaBlend: Boolean; const Alpha: Byte);
|
||||
begin
|
||||
if ACustomForm.HandleAllocated then
|
||||
|
Loading…
Reference in New Issue
Block a user