lazarus-ccr/components/iosdesigner/Examples/HelloWorld/appdelegate_iphoneu.pas
loesje_ 3d7a8e071f * Added example application
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2650 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-02-03 16:42:43 +00:00

57 lines
1.1 KiB
ObjectPascal

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.