mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:19:27 +02:00
Starts Carbon-Cocoa TTrayIcon implementation
git-svn-id: trunk@15084 -
This commit is contained in:
parent
d1b5d08ccf
commit
e7ae4a80a4
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3039,6 +3039,7 @@ lcl/interfaces/carbon/carbonproc.pp svneol=native#text/pascal
|
||||
lcl/interfaces/carbon/carbonstrings.pp svneol=native#text/pascal
|
||||
lcl/interfaces/carbon/carbontabs.pp svneol=native#text/pascal
|
||||
lcl/interfaces/carbon/carbonthemes.pas svneol=native#text/pascal
|
||||
lcl/interfaces/carbon/carbontrayicon.inc svneol=native#text/plain
|
||||
lcl/interfaces/carbon/carbonutils.pas svneol=native#text/pascal
|
||||
lcl/interfaces/carbon/carbonwinapi.inc svneol=native#text/plain
|
||||
lcl/interfaces/carbon/carbonwinapih.inc svneol=native#text/plain
|
||||
|
42
lcl/interfaces/carbon/carbontrayicon.inc
Normal file
42
lcl/interfaces/carbon/carbontrayicon.inc
Normal file
@ -0,0 +1,42 @@
|
||||
{%mainunit carbonwsextctrls.pp}
|
||||
|
||||
{$ifdef CarbonUseCocoa}
|
||||
|
||||
{ TCarbonWSCustomTrayIcon }
|
||||
|
||||
type
|
||||
TPrivateTrayIcon = class(NSObject)
|
||||
public
|
||||
{ Fields }
|
||||
bar: NSStatusBar;
|
||||
item: NSStatusItem;
|
||||
image: NSImage;
|
||||
end;
|
||||
|
||||
class function TCarbonWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
class function TCarbonWSCustomTrayIcon.Show(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
class procedure TCarbonWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
class function TCarbonWSCustomTrayIcon.ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
class function TCarbonWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
||||
begin
|
||||
Result := Point(0, 0);
|
||||
end;
|
||||
|
||||
{$endif CarbonUseCocoa}
|
||||
|
@ -32,6 +32,10 @@ interface
|
||||
uses
|
||||
// libs
|
||||
FPCMacOSAll,
|
||||
// Cocoa
|
||||
{$ifdef CarbonUseCocoa}
|
||||
appkit, foundation,
|
||||
{$endif CarbonUseCocoa}
|
||||
// LCL
|
||||
Classes, Controls, ExtCtrls, LCLType, LCLProc, Graphics, Math,
|
||||
// widgetset
|
||||
@ -208,6 +212,18 @@ type
|
||||
public
|
||||
end;
|
||||
|
||||
{ TCarbonWSCustomTrayIcon }
|
||||
|
||||
TCarbonWSCustomTrayIcon = class(TWSCustomTrayIcon)
|
||||
public
|
||||
{$ifdef CarbonUseCocoa}
|
||||
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override;
|
||||
class function ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||
{$endif CarbonUseCocoa}
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
@ -354,6 +370,8 @@ begin
|
||||
TCarbonTabsControl(ANotebook.Handle).ShowTabs(AShowTabs);
|
||||
end;
|
||||
|
||||
{$include carbontrayicon.inc}
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -382,5 +400,7 @@ initialization
|
||||
// RegisterWSComponent(TLabeledEdit, TCarbonWSLabeledEdit);
|
||||
// RegisterWSComponent(TCustomPanel, TCarbonWSCustomPanel);
|
||||
// RegisterWSComponent(TPanel, TCarbonWSPanel);
|
||||
RegisterWSComponent(TCustomTrayIcon, TCarbonWSCustomTrayIcon);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user