You've already forked lazarus-ccr
Adds very initial conversions of various classes for NSStatusItem and NSButton support.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@360 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -10,16 +10,16 @@
|
|||||||
{#import <AppKit/AppKitDefines.h>
|
{#import <AppKit/AppKitDefines.h>
|
||||||
#import <AppKit/AppKitErrors.h>
|
#import <AppKit/AppKitErrors.h>
|
||||||
#import <AppKit/NSGraphicsContext.h>
|
#import <AppKit/NSGraphicsContext.h>
|
||||||
#import <AppKit/NSAccessibility.h>
|
#import <AppKit/NSAccessibility.h>}
|
||||||
#import <AppKit/NSActionCell.h> }
|
{$include NSActionCell.inc}
|
||||||
{.$include NSAlert.inc}
|
{$include NSAlert.inc}
|
||||||
//#import <AppKit/NSAppleScriptExtensions.h>
|
//#import <AppKit/NSAppleScriptExtensions.h>
|
||||||
{$include NSApplication.inc}
|
{$include NSApplication.inc}
|
||||||
{#import <AppKit/NSBox.h>
|
//#import <AppKit/NSBox.h>
|
||||||
#import <AppKit/NSButton.h>
|
{$include NSButton.inc}
|
||||||
#import <AppKit/NSButtonCell.h>
|
{$include NSButtonCell.inc}
|
||||||
#import <AppKit/NSCell.h>
|
{$include NSCell.inc}
|
||||||
#import <AppKit/NSClipView.h>
|
{#import <AppKit/NSClipView.h>
|
||||||
#import <AppKit/NSControl.h>
|
#import <AppKit/NSControl.h>
|
||||||
#import <AppKit/NSFont.h>
|
#import <AppKit/NSFont.h>
|
||||||
#import <AppKit/NSFontDescriptor.h>
|
#import <AppKit/NSFontDescriptor.h>
|
||||||
@ -123,10 +123,10 @@
|
|||||||
#import <AppKit/NSGraphicsContext.h>
|
#import <AppKit/NSGraphicsContext.h>
|
||||||
#import <AppKit/NSAffineTransform.h>
|
#import <AppKit/NSAffineTransform.h>
|
||||||
#import <AppKit/NSBezierPath.h>
|
#import <AppKit/NSBezierPath.h>
|
||||||
#import <AppKit/NSPICTImageRep.h>
|
#import <AppKit/NSPICTImageRep.h>}
|
||||||
#import <AppKit/NSStatusBar.h>
|
{$include NSStatusBar.inc}
|
||||||
#import <AppKit/NSStatusItem.h>
|
{$include NSStatusItem.inc}
|
||||||
#import <AppKit/NSSound.h>
|
{#import <AppKit/NSSound.h>
|
||||||
#import <AppKit/NSMovie.h>
|
#import <AppKit/NSMovie.h>
|
||||||
#import <AppKit/NSMovieView.h>
|
#import <AppKit/NSMovieView.h>
|
||||||
#import <AppKit/NSPDFImageRep.h>
|
#import <AppKit/NSPDFImageRep.h>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{%mainunit appkit.pas}
|
||||||
{
|
{
|
||||||
NSAlert.h
|
NSAlert.h
|
||||||
Application Kit
|
Application Kit
|
||||||
@ -5,6 +6,10 @@
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$ifdef HEADER}
|
||||||
|
{$ifndef NSALERT_PAS_H}
|
||||||
|
{$define NSALERT_PAS_H}
|
||||||
|
|
||||||
//#import <Foundation/NSObject.h>
|
//#import <Foundation/NSObject.h>
|
||||||
//#import <AppKit/NSGraphics.h>
|
//#import <AppKit/NSGraphics.h>
|
||||||
//@class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
|
//@class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
|
||||||
@ -18,6 +23,23 @@
|
|||||||
// NSCriticalAlertStyle = 2
|
// NSCriticalAlertStyle = 2
|
||||||
//} NSAlertStyle;
|
//} NSAlertStyle;
|
||||||
|
|
||||||
|
// by default, NSAlert return values are position dependent, with this mapping:
|
||||||
|
// first (rightmost) button = NSAlertFirstButtonReturn
|
||||||
|
// second button = NSAlertSecondButtonReturn
|
||||||
|
// third button = NSAlertThirdButtonReturn
|
||||||
|
// buttonPosition 3+x = NSAlertThirdButtonReturn + x
|
||||||
|
|
||||||
|
const
|
||||||
|
NSAlertFirstButtonReturn = 1000;
|
||||||
|
NSAlertSecondButtonReturn = 1001;
|
||||||
|
NSAlertThirdButtonReturn = 1002;
|
||||||
|
|
||||||
|
{$endif}
|
||||||
|
{$endif}
|
||||||
|
{$ifdef CLASSES}
|
||||||
|
{$ifndef NSALERT_PAS_C}
|
||||||
|
{$define NSALERT_PAS_C}
|
||||||
|
|
||||||
//@interface NSAlert : NSObject
|
//@interface NSAlert : NSObject
|
||||||
{
|
{
|
||||||
@private
|
@private
|
||||||
@ -53,7 +75,7 @@
|
|||||||
id reserved2;
|
id reserved2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
{#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||||
|
|
||||||
/* Given an NSError, create an NSAlert that can be used to present the error to the user. The error's localized description, recovery suggestion, and recovery options will be used to set the alert's message text, informative text, and button titles, respectively.
|
/* Given an NSError, create an NSAlert that can be used to present the error to the user. The error's localized description, recovery suggestion, and recovery options will be used to set the alert's message text, informative text, and button titles, respectively.
|
||||||
*/
|
*/
|
||||||
@ -80,18 +102,6 @@
|
|||||||
// get the buttons, where the rightmost button is at index 0
|
// get the buttons, where the rightmost button is at index 0
|
||||||
- (NSArray *)buttons;
|
- (NSArray *)buttons;
|
||||||
|
|
||||||
// by default, NSAlert return values are position dependent, with this mapping:
|
|
||||||
// first (rightmost) button = NSAlertFirstButtonReturn
|
|
||||||
// second button = NSAlertSecondButtonReturn
|
|
||||||
// third button = NSAlertThirdButtonReturn
|
|
||||||
// buttonPosition 3+x = NSAlertThirdButtonReturn + x
|
|
||||||
|
|
||||||
enum {
|
|
||||||
NSAlertFirstButtonReturn = 1000,
|
|
||||||
NSAlertSecondButtonReturn = 1001,
|
|
||||||
NSAlertThirdButtonReturn = 1002
|
|
||||||
};
|
|
||||||
|
|
||||||
// The following method can be used to customize return values for buttons
|
// The following method can be used to customize return values for buttons
|
||||||
// setTag:(int)tag; setting a tag on a button will cause that tag to be the button's return value
|
// setTag:(int)tag; setting a tag on a button will cause that tag to be the button's return value
|
||||||
// Note that we reserve the use of the tag for this purpose. We also reserve the use of the target and the action
|
// Note that we reserve the use of the tag for this purpose. We also reserve the use of the target and the action
|
||||||
@ -131,4 +141,8 @@ enum {
|
|||||||
- (BOOL)alertShowHelp:(NSAlert *)alert;
|
- (BOOL)alertShowHelp:(NSAlert *)alert;
|
||||||
@end }
|
@end }
|
||||||
|
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
|
{$endif}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{%mainunit appkit.pas}
|
||||||
{
|
{
|
||||||
NSApplication.h
|
NSApplication.h
|
||||||
Application Kit
|
Application Kit
|
||||||
@ -106,7 +107,7 @@ APPKIT_EXTERN NSString *NSApplicationDidChangeScreenParametersNotification; }
|
|||||||
{ The version of the AppKit framework }
|
{ The version of the AppKit framework }
|
||||||
//APPKIT_EXTERN const double NSAppKitVersionNumber;
|
//APPKIT_EXTERN const double NSAppKitVersionNumber;
|
||||||
|
|
||||||
NSApplication = class(NSObject) //: NSResponder }
|
NSApplication = class(NSResponder)
|
||||||
public
|
public
|
||||||
constructor sharedApplication;
|
constructor sharedApplication;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ APPKIT_EXTERN NSString *NSWindowDidChangeScreenProfileNotification AVAILABLE_MA
|
|||||||
@class NSEvent;
|
@class NSEvent;
|
||||||
@class NSWindowController; }
|
@class NSWindowController; }
|
||||||
|
|
||||||
NSWindow = class(NSObject) //: NSResponder
|
NSWindow = class(NSResponder)
|
||||||
public
|
public
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<IconPath Value="./"/>
|
<IconPath Value="./"/>
|
||||||
<TargetFileExt Value=""/>
|
<TargetFileExt Value=""/>
|
||||||
<Title Value="simplewindow"/>
|
<Title Value="simplewindow"/>
|
||||||
<ActiveEditorIndexAtStart Value="2"/>
|
<ActiveEditorIndexAtStart Value="0"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<ProjectVersion Value=""/>
|
||||||
@ -28,22 +28,22 @@
|
|||||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<Units Count="37">
|
<Units Count="41">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="simplewindow.pas"/>
|
<Filename Value="simplewindow.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="simplewindow"/>
|
<UnitName Value="simplewindow"/>
|
||||||
<CursorPos X="45" Y="21"/>
|
<CursorPos X="48" Y="21"/>
|
||||||
<TopLine Value="43"/>
|
<TopLine Value="12"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<UsageCount Value="48"/>
|
<UsageCount Value="50"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="../../appkit/appkit.pas"/>
|
<Filename Value="../../appkit/appkit.pas"/>
|
||||||
<UnitName Value="appkit"/>
|
<UnitName Value="appkit"/>
|
||||||
<CursorPos X="15" Y="21"/>
|
<CursorPos X="1" Y="29"/>
|
||||||
<TopLine Value="12"/>
|
<TopLine Value="20"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="13"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
@ -62,8 +62,8 @@
|
|||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="../../appkit/AppKit.inc"/>
|
<Filename Value="../../appkit/AppKit.inc"/>
|
||||||
<CursorPos X="15" Y="92"/>
|
<CursorPos X="16" Y="17"/>
|
||||||
<TopLine Value="148"/>
|
<TopLine Value="8"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="2"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
@ -115,8 +115,8 @@
|
|||||||
</Unit11>
|
</Unit11>
|
||||||
<Unit12>
|
<Unit12>
|
||||||
<Filename Value="../../foundation/NSAutoreleasePool.inc"/>
|
<Filename Value="../../foundation/NSAutoreleasePool.inc"/>
|
||||||
<CursorPos X="26" Y="15"/>
|
<CursorPos X="43" Y="8"/>
|
||||||
<TopLine Value="13"/>
|
<TopLine Value="2"/>
|
||||||
<UsageCount Value="26"/>
|
<UsageCount Value="26"/>
|
||||||
</Unit12>
|
</Unit12>
|
||||||
<Unit13>
|
<Unit13>
|
||||||
@ -141,8 +141,8 @@
|
|||||||
</Unit15>
|
</Unit15>
|
||||||
<Unit16>
|
<Unit16>
|
||||||
<Filename Value="../../foundation/NSObject.inc"/>
|
<Filename Value="../../foundation/NSObject.inc"/>
|
||||||
<CursorPos X="24" Y="89"/>
|
<CursorPos X="44" Y="152"/>
|
||||||
<TopLine Value="87"/>
|
<TopLine Value="149"/>
|
||||||
<UsageCount Value="21"/>
|
<UsageCount Value="21"/>
|
||||||
</Unit16>
|
</Unit16>
|
||||||
<Unit17>
|
<Unit17>
|
||||||
@ -153,9 +153,11 @@
|
|||||||
</Unit17>
|
</Unit17>
|
||||||
<Unit18>
|
<Unit18>
|
||||||
<Filename Value="../../appkit/NSApplication.inc"/>
|
<Filename Value="../../appkit/NSApplication.inc"/>
|
||||||
<CursorPos X="44" Y="355"/>
|
<CursorPos X="47" Y="370"/>
|
||||||
<TopLine Value="352"/>
|
<TopLine Value="362"/>
|
||||||
|
<EditorIndex Value="3"/>
|
||||||
<UsageCount Value="18"/>
|
<UsageCount Value="18"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit18>
|
</Unit18>
|
||||||
<Unit19>
|
<Unit19>
|
||||||
<Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h"/>
|
<Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h"/>
|
||||||
@ -166,11 +168,9 @@
|
|||||||
</Unit19>
|
</Unit19>
|
||||||
<Unit20>
|
<Unit20>
|
||||||
<Filename Value="../../appkit/NSWindow.inc"/>
|
<Filename Value="../../appkit/NSWindow.inc"/>
|
||||||
<CursorPos X="1" Y="474"/>
|
<CursorPos X="25" Y="464"/>
|
||||||
<TopLine Value="463"/>
|
<TopLine Value="460"/>
|
||||||
<EditorIndex Value="3"/>
|
|
||||||
<UsageCount Value="27"/>
|
<UsageCount Value="27"/>
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit20>
|
</Unit20>
|
||||||
<Unit21>
|
<Unit21>
|
||||||
<Filename Value="../../appkit/NSWindow_impl.inc"/>
|
<Filename Value="../../appkit/NSWindow_impl.inc"/>
|
||||||
@ -272,40 +272,54 @@
|
|||||||
<TopLine Value="261"/>
|
<TopLine Value="261"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit36>
|
</Unit36>
|
||||||
|
<Unit37>
|
||||||
|
<Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSStatusBar.h"/>
|
||||||
|
<CursorPos X="58" Y="18"/>
|
||||||
|
<TopLine Value="17"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<SyntaxHighlighter Value="C++"/>
|
||||||
|
</Unit37>
|
||||||
|
<Unit38>
|
||||||
|
<Filename Value="../../appkit/NSStatusBar.inc"/>
|
||||||
|
<CursorPos X="1" Y="59"/>
|
||||||
|
<TopLine Value="47"/>
|
||||||
|
<EditorIndex Value="4"/>
|
||||||
|
<UsageCount Value="21"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit38>
|
||||||
|
<Unit39>
|
||||||
|
<Filename Value="../../appkit/NSStatusItem.inc"/>
|
||||||
|
<CursorPos X="27" Y="50"/>
|
||||||
|
<TopLine Value="88"/>
|
||||||
|
<EditorIndex Value="5"/>
|
||||||
|
<UsageCount Value="21"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit39>
|
||||||
|
<Unit40>
|
||||||
|
<Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSStatusItem.h"/>
|
||||||
|
<CursorPos X="38" Y="100"/>
|
||||||
|
<TopLine Value="85"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<SyntaxHighlighter Value="C++"/>
|
||||||
|
</Unit40>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="8" HistoryIndex="7">
|
<JumpHistory Count="4" HistoryIndex="3">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="simplewindow.pas"/>
|
<Filename Value="../../appkit/AppKit.inc"/>
|
||||||
<Caret Line="21" Column="45" TopLine="8"/>
|
<Caret Line="17" Column="16" TopLine="8"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="../../appkit/appkit.pas"/>
|
<Filename Value="../../appkit/NSApplication.inc"/>
|
||||||
<Caret Line="21" Column="14" TopLine="12"/>
|
<Caret Line="360" Column="25" TopLine="356"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="../../appkit/NSWindow.inc"/>
|
<Filename Value="../../appkit/NSStatusBar.inc"/>
|
||||||
<Caret Line="4" Column="24" TopLine="1"/>
|
<Caret Line="46" Column="1" TopLine="30"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="../../appkit/appkit.pas"/>
|
<Filename Value="../../appkit/NSStatusBar.inc"/>
|
||||||
<Caret Line="21" Column="15" TopLine="12"/>
|
<Caret Line="32" Column="20" TopLine="23"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
|
||||||
<Filename Value="../../appkit/AppKit.inc"/>
|
|
||||||
<Caret Line="17" Column="14" TopLine="3"/>
|
|
||||||
</Position5>
|
|
||||||
<Position6>
|
|
||||||
<Filename Value="../../appkit/AppKit.inc"/>
|
|
||||||
<Caret Line="55" Column="19" TopLine="47"/>
|
|
||||||
</Position6>
|
|
||||||
<Position7>
|
|
||||||
<Filename Value="../../appkit/AppKit.inc"/>
|
|
||||||
<Caret Line="69" Column="16" TopLine="60"/>
|
|
||||||
</Position7>
|
|
||||||
<Position8>
|
|
||||||
<Filename Value="../../appkit/AppKit.inc"/>
|
|
||||||
<Caret Line="92" Column="15" TopLine="83"/>
|
|
||||||
</Position8>
|
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
simpleform.pas
|
simpleform.pas
|
||||||
|
|
||||||
This example shows how to use the objective-c runtime headers to call
|
This example shows how to use the PasCocoa bindings to create a
|
||||||
initialization and finalization code for an objective-c class (in this case
|
NSAutoreleasePool, initialize the application global variable, create
|
||||||
NSAutoreleasePool), and also shows a message box using minimal AppKit
|
a simple window without contents and attach a close handler to it that
|
||||||
bindings to demonstrate that this can be used to build Cocoa applications.
|
exits the application.
|
||||||
|
|
||||||
Compilation of this example requires the following options:
|
Compilation of this example requires the following options:
|
||||||
-k-framework -kcocoa -k-lobjc
|
-k-framework -kcocoa -k-lobjc
|
||||||
@ -50,8 +50,6 @@ begin
|
|||||||
|
|
||||||
MainWindow.orderFrontRegardless;
|
MainWindow.orderFrontRegardless;
|
||||||
|
|
||||||
// CreateMenu();
|
|
||||||
|
|
||||||
{ Enters main message loop }
|
{ Enters main message loop }
|
||||||
|
|
||||||
NSApp.run;
|
NSApp.run;
|
||||||
|
Reference in New Issue
Block a user