* Added example application

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2650 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
loesje_
2013-02-03 16:42:43 +00:00
parent df178ee0be
commit 3d7a8e071f
4 changed files with 388 additions and 0 deletions

View File

@ -0,0 +1,95 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="HelloWorld"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<CustomData Count="7">
<Item0 Name="iPhone/AppID" Value="org.lazarus.helloworld"/>
<Item1 Name="iPhone/ExcludeMask"/>
<Item2 Name="iPhone/MainNib" Value="appdelegate_iphoneu"/>
<Item3 Name="iPhone/ResourceDir" Value="Resources"/>
<Item4 Name="iPhone/SDK" Value="5.1"/>
<Item5 Name="iPhone/SimSpaceName" Value="47A400B6-1981-CE32-8E0A-F881730320A5"/>
<Item6 Name="iPhone/isiPhoneApp" Value="true"/>
</CustomData>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="iOSDesigner"/>
</Item1>
<Item2>
<PackageName Value="FCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="HelloWorld.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="HelloWorld"/>
</Unit0>
<Unit1>
<Filename Value="appdelegate_iphoneu.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="AppDelegate_iPhone"/>
<HasResources Value="True"/>
<UnitName Value="appdelegate_iphoneu"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
</SearchPaths>
<CodeGeneration>
<TargetOS Value="iphonesim"/>
</CodeGeneration>
<Other>
<CompilerMessages>
<MsgFileName Value=""/>
</CompilerMessages>
<CustomOptions Value="-XR/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk"/>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,15 @@
program HelloWorld;
{$modeswitch ObjectiveC1}
uses
iPhoneAll, appdelegate_iphoneu;
var
pool : NSAutoreleasePool;
begin
pool := NSAutoreleasePool.alloc.init;
UIApplicationMain(argc, argv, nil, nil);
pool.release;
end.

View File

@ -0,0 +1,56 @@
unit appdelegate_iphoneu;
{$modeswitch ObjectiveC1}
interface
uses
iPhoneAll;
type
{ TAppDelegate_iPhone }
TAppDelegate_iPhone = objcclass(NSObject, UIApplicationDelegateProtocol)
UIButton1: UIButton;
UIButton2: UIButton;
UIWindow1: UIWindow;
procedure UIButton1TouchDown(sender: id); message 'UIButton1TouchDown:';
procedure UIButton2TouchDown(sender: id); message 'UIButton2TouchDown:';
private
{ private declarations }
public
procedure dealloc; override;
end;
implementation
procedure TAppDelegate_iPhone.UIButton1TouchDown(sender: id);
begin
UIButton1.setTitle_forState(NSSTR('Thank you'),UIControlStateNormal);
end;
procedure TAppDelegate_iPhone.UIButton2TouchDown(sender: id);
var
AnAlertView: UIAlertView;
begin
AnAlertView := UIAlertView.alloc.initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles(nil,NSSTR('Hello World!'),nil,nsstr('Ok'),nil);
try
AnAlertView.show;
finally
AnAlertView.release;
end;
end;
procedure TAppDelegate_iPhone.dealloc;
begin
UIButton1.dealloc;
UIButton2.dealloc;
UIWindow1.dealloc;
inherited dealloc;
end;
{$FakeResource *.xib}
end.

View File

@ -0,0 +1,222 @@
<?xml version="1.0" encoding="utf-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11D50</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<object key="IBDocument.PluginVersions" class="NSMutableDictionary">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIWindow</string>
<string>IBUICustomObject</string>
<string>IBUIButton</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object key="IBDocument.Metadata" class="NSMutableDictionary">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer key="NS.object.0" value="1"/>
</object>
<array id="1000" key="IBDocument.RootObjects" class="NSMutableArray">
<object id="841351856" class="IBProxyObject">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object id="371349661" class="IBProxyObject">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object id="312562742" class="IBUICustomObject"/>
<object id="955357891" class="IBUIWindow">
<object key="IBUIBackgroundColor" class="NSColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDE</bytes>
</object>
<string key="NSFrameSize">{320, 480}</string>
<array key="NSSubviews" class="NSMutableArray">
<object id="208414017" class="IBUIButton">
<reference key="NSSuperview" ref="955357891"/>
<string key="NSFrame">{{86, 46}, {128, 37}}</string>
<object key="IBUIBackgroundColor" class="NSColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDE</bytes>
</object>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Click me!</string>
<object key="IBUINormalTitleColor" class="NSColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
</object>
<object id="970107872" class="IBUIButton">
<reference key="NSSuperview" ref="955357891"/>
<string key="NSFrame">{{110, 190}, {72, 37}}</string>
<object key="IBUIBackgroundColor" class="NSColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDE</bytes>
</object>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Hello</string>
<object key="IBUINormalTitleColor" class="NSColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDE</bytes>
</object>
</object>
</array>
</object>
</array>
<object key="IBDocument.Objects" class="IBObjectContainer">
<array key="connectionRecords" class="NSMutableArray">
<object class="IBConnectionRecord">
<object key="connection" class="IBCocoaTouchOutletConnection">
<reference key="source" ref="841351856"/>
<reference key="destination" ref="312562742"/>
<string key="label">delegate</string>
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object key="connection" class="IBCocoaTouchOutletConnection">
<reference key="source" ref="312562742"/>
<reference key="destination" ref="955357891"/>
<string key="label">UIWindow1</string>
</object>
<int key="connectionID">5</int>
</object>
<object class="IBConnectionRecord">
<object key="connection" class="IBCocoaTouchOutletConnection">
<reference key="source" ref="312562742"/>
<reference key="destination" ref="208414017"/>
<string key="label">UIButton1</string>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object key="connection" class="IBCocoaTouchEventConnection">
<reference key="source" ref="208414017"/>
<reference key="destination" ref="312562742"/>
<int key="IBEventType">1</int>
<string key="label">UIButton1TouchDown:</string>
</object>
<int key="connectionID">8</int>
</object>
<object class="IBConnectionRecord">
<object key="connection" class="IBCocoaTouchOutletConnection">
<reference key="source" ref="312562742"/>
<reference key="destination" ref="970107872"/>
<string key="label">UIButton2</string>
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object key="connection" class="IBCocoaTouchEventConnection">
<reference key="source" ref="970107872"/>
<reference key="destination" ref="312562742"/>
<int key="IBEventType">1</int>
<string key="label">UIButton2TouchDown:</string>
</object>
<int key="connectionID">11</int>
</object>
</array>
<object key="objectRecords" class="IBMutableOrderedSet">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array id="0" key="object"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="371349661"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="312562742"/>
<reference key="parent" ref="0"/>
<string key="objectName">AppDelegate_iPhone</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<string key="objectName">UIWindow1</string>
<reference key="object" ref="955357891"/>
<reference key="parent" ref="0"/>
<array key="children" class="NSMutableArray">
<reference ref="208414017"/>
<reference ref="970107872"/>
</array>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<string key="objectName">UIButton1</string>
<reference key="object" ref="208414017"/>
<reference key="parent" ref="955357891"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<string key="objectName">UIButton2</string>
<reference key="object" ref="970107872"/>
<reference key="parent" ref="955357891"/>
</object>
</array>
</object>
<dictionary key="flattenedProperties" class="NSMutableDictionary">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="2.CustomClassName">TAppDelegate_iPhone</string>
</dictionary>
<dictionary key="unlocalizedProperties" class="NSMutableDictionary"/>
<nil key="activeLocalization"/>
<dictionary key="localizations" class="NSMutableDictionary"/>
<nil key="sourceID"/>
<int key="maxID">11</int>
</object>
<object key="IBDocument.Classes" class="IBClassDescriber">
<object key="referencedPartialClassDescriptions" class="NSMutableArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppDelegate</string>
<string key="superclassName">NSObject</string>
<object key="outlets" class="NSMutableDictionary">
<string key="NS.key.0">window</string>
<string key="NS.object.0">UIWindow</string>
</object>
<object key="toOneOutletInfosByName" class="NSMutableDictionary">
<string key="NS.key.0">window</string>
<object key="NS.object.0" class="IBToOneOutletInfo">
<string key="name">window</string>
<string key="candidateClassName">UIWindow</string>
</object>
</object>
<object key="sourceIdentifier" class="IBClassDescriptionSource">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppDelegate.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object key="IBDocument.PluginDeclaredDevelopmentDependencies" class="NSMutableDictionary">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<real key="NS.object.0" value="4300"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>