Starts Carbon-Cocoa TTrayIcon implementation

git-svn-id: trunk@15084 -
This commit is contained in:
sekelsenmat 2008-05-10 03:08:42 +00:00
parent d1b5d08ccf
commit e7ae4a80a4
3 changed files with 63 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View 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}

View File

@ -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.