2008-03-02 02:17:37 +00:00
|
|
|
{%mainunit appkit.pas}
|
2008-06-06 01:32:06 +00:00
|
|
|
(*
|
2008-03-02 02:17:37 +00:00
|
|
|
NSStatusBar.h
|
|
|
|
Application Kit
|
|
|
|
Copyright (c) 1997-2005, Apple Computer, Inc.
|
|
|
|
All rights reserved.
|
2008-06-06 01:32:06 +00:00
|
|
|
*)
|
2008-03-02 02:17:37 +00:00
|
|
|
|
|
|
|
{$ifdef HEADER}
|
|
|
|
{$ifndef NSSTATUSBAR_PAS_H}
|
|
|
|
{$define NSSTATUSBAR_PAS_H}
|
|
|
|
|
|
|
|
const
|
|
|
|
NSVariableStatusItemLength = (-1);
|
2008-06-06 01:32:06 +00:00
|
|
|
NSSquareStatusItemLength = (-2);
|
2008-06-21 16:35:57 +00:00
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
{$endif}
|
|
|
|
{$endif}
|
2008-03-02 02:17:37 +00:00
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
{$ifdef FORWARD}
|
|
|
|
NSStatusBar = class;
|
2008-06-21 16:35:57 +00:00
|
|
|
|
2008-03-02 02:17:37 +00:00
|
|
|
{$endif}
|
2008-06-06 01:32:06 +00:00
|
|
|
|
2008-03-02 02:17:37 +00:00
|
|
|
{$ifdef CLASSES}
|
|
|
|
{$ifndef NSSTATUSBAR_PAS_C}
|
|
|
|
{$define NSSTATUSBAR_PAS_C}
|
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
|
|
|
|
{ NSStatusBar }
|
2008-03-02 02:17:37 +00:00
|
|
|
|
|
|
|
NSStatusBar = class(NSObject)
|
2008-03-04 09:16:58 +00:00
|
|
|
public
|
2008-05-09 19:51:36 +00:00
|
|
|
class function getClass: objc.id; override;
|
2008-06-06 01:32:06 +00:00
|
|
|
constructor systemStatusBar;
|
|
|
|
function statusItemWithLength(_length: Single): objc.id;{NSStatusItem}
|
|
|
|
procedure removeStatusItem(_item: objc.id {NSStatusItem});
|
|
|
|
function isVertical: LongBool;
|
|
|
|
function thickness: Single;
|
2008-03-02 02:17:37 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
{$endif}
|
|
|
|
{$endif}
|
2008-06-06 01:32:06 +00:00
|
|
|
|
2008-03-02 02:17:37 +00:00
|
|
|
{$ifdef IMPLEMENTATION}
|
2008-06-06 01:32:06 +00:00
|
|
|
const
|
|
|
|
StrNSStatusBar_NSStatusBar = 'NSStatusBar';
|
|
|
|
StrNSStatusBar_systemStatusBar = 'systemStatusBar';
|
|
|
|
StrNSStatusBar_statusItemWithLength = 'statusItemWithLength:';
|
|
|
|
StrNSStatusBar_removeStatusItem = 'removeStatusItem:';
|
|
|
|
StrNSStatusBar_isVertical = 'isVertical';
|
|
|
|
StrNSStatusBar_thickness = 'thickness';
|
|
|
|
|
|
|
|
{ NSStatusBar }
|
2008-03-02 02:17:37 +00:00
|
|
|
|
2008-05-09 19:51:36 +00:00
|
|
|
class function NSStatusBar.getClass: objc.id;
|
2008-03-04 09:16:58 +00:00
|
|
|
begin
|
2008-06-06 01:32:06 +00:00
|
|
|
Result := objc_getClass(StrNSStatusBar_NSStatusBar);
|
2008-03-04 09:16:58 +00:00
|
|
|
end;
|
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
constructor NSStatusBar.systemStatusBar;
|
|
|
|
type
|
|
|
|
TmsgSendWrapper = function (param1: objc.id; param2: SEL): objc.id; cdecl;
|
|
|
|
var
|
|
|
|
vmethod: TmsgSendWrapper;
|
2008-03-02 02:17:37 +00:00
|
|
|
begin
|
2008-06-06 01:32:06 +00:00
|
|
|
ClassID := getClass();
|
|
|
|
vmethod := TmsgSendWrapper(@objc_msgSend);
|
|
|
|
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSStatusBar_systemStatusBar)));
|
2008-03-02 02:17:37 +00:00
|
|
|
end;
|
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
function NSStatusBar.statusItemWithLength(_length: Single): objc.id;
|
2008-03-04 09:16:58 +00:00
|
|
|
type
|
2008-06-06 01:32:06 +00:00
|
|
|
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_length: Single): objc.id; cdecl;
|
2008-03-04 09:16:58 +00:00
|
|
|
var
|
2008-06-06 01:32:06 +00:00
|
|
|
vmethod: TmsgSendWrapper;
|
2008-03-02 02:17:37 +00:00
|
|
|
begin
|
2008-06-06 01:32:06 +00:00
|
|
|
vmethod := TmsgSendWrapper(@objc_msgSend);
|
|
|
|
Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSStatusBar_statusItemWithLength)), _length));
|
2008-03-02 02:17:37 +00:00
|
|
|
end;
|
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
procedure NSStatusBar.removeStatusItem(_item: objc.id {NSStatusItem});
|
|
|
|
type
|
|
|
|
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_item: objc.id {NSStatusItem}); cdecl;
|
|
|
|
var
|
|
|
|
vmethod: TmsgSendWrapper;
|
2008-03-02 02:17:37 +00:00
|
|
|
begin
|
2008-06-06 01:32:06 +00:00
|
|
|
vmethod := TmsgSendWrapper(@objc_msgSend);
|
|
|
|
vmethod(Handle, sel_registerName(PChar(StrNSStatusBar_removeStatusItem)), _item);
|
|
|
|
end;
|
2008-03-02 02:17:37 +00:00
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
function NSStatusBar.isVertical: LongBool;
|
|
|
|
begin
|
|
|
|
Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSStatusBar_isVertical)), []));
|
2008-03-02 02:17:37 +00:00
|
|
|
end;
|
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
function NSStatusBar.thickness: Single;
|
|
|
|
begin
|
|
|
|
Result := Single(objc_msgSend(Handle, sel_registerName(PChar(StrNSStatusBar_thickness)), []));
|
|
|
|
end;
|
2008-03-02 02:17:37 +00:00
|
|
|
|
2008-06-06 01:32:06 +00:00
|
|
|
{$endif}
|