Răsfoiți Sursa

palmunits: added a simple 'Hello, World' for PalmOS

git-svn-id: trunk@37903 -
Károly Balogh 7 ani în urmă
părinte
comite
f609c55b59
3 a modificat fișierele cu 28 adăugiri și 0 ștergeri
  1. 1 0
      .gitattributes
  2. 24 0
      packages/palmunits/examples/hello.pas
  3. 3 0
      packages/palmunits/fpmake.pp

+ 1 - 0
.gitattributes

@@ -6668,6 +6668,7 @@ packages/os4units/src/workbench.pas svneol=native#text/pascal
 packages/palmunits/Makefile svneol=native#text/plain
 packages/palmunits/Makefile.fpc svneol=native#text/plain
 packages/palmunits/Makefile.fpc.fpcmake svneol=native#text/plain
+packages/palmunits/examples/hello.pas svneol=native#text/plain
 packages/palmunits/fpmake.pp svneol=native#text/plain
 packages/palmunits/src/aboutbox.pp svneol=native#text/plain
 packages/palmunits/src/alarmmgr.pp svneol=native#text/plain

+ 24 - 0
packages/palmunits/examples/hello.pas

@@ -0,0 +1,24 @@
+{$APPID FPHL}
+{$APPNAME Hello, FPC}
+program hello;
+
+uses
+  event_, sysevent, systemmgr, window;
+
+const
+  message = 'FPC says: Hello, Palm!';
+
+procedure EventLoop;
+var
+  event: EventType;
+begin
+  repeat
+    EvtGetEvent(event, evtWaitForever);
+    SysHandleEvent(event);
+  until (event.eType = appStopEvent);
+end;
+
+begin
+  WinDrawChars(message, length(message), 35, 74);
+  EventLoop;
+end.

+ 3 - 0
packages/palmunits/fpmake.pp

@@ -123,6 +123,9 @@ begin
     P.Targets.AddUnit('pdilib.pp',[PalmOS]);
     P.Targets.AddUnit('helperserviceclass.pp',[PalmOS]);
 
+    P.ExamplePath.Add('examples');
+    P.Targets.AddExampleProgram('hello.pas');
+
 {$ifndef ALLPACKAGES}
     Run;
     end;