Browse Source

amiga: examples fixed and updated

git-svn-id: trunk@48988 -
marcus 4 years ago
parent
commit
6a92798603

+ 5 - 5
packages/amunits/examples/asltest.pas

@@ -28,18 +28,18 @@ BEGIN
     fr := AllocAslRequestTags(ASL_FileRequest,[
     fr := AllocAslRequestTags(ASL_FileRequest,[
                           ASLFR_InitialPattern, AsTag('#?'),
                           ASLFR_InitialPattern, AsTag('#?'),
                           ASLFR_TitleText, AsTag('Test av ASL-Requester by NS'),
                           ASLFR_TitleText, AsTag('Test av ASL-Requester by NS'),
-                          ASLFR_DoPatterns, LTrue,
+                          ASLFR_DoPatterns, AsTag(True),
                           TAG_DONE]);
                           TAG_DONE]);
 
 
     IF fr <> nil THEN BEGIN
     IF fr <> nil THEN BEGIN
         dummy := AslRequest(fr,NIL);
         dummy := AslRequest(fr,NIL);
         if dummy then begin
         if dummy then begin
            MessageBox('Test of Asl',
            MessageBox('Test of Asl',
-                      ' The path is :' +
-                      strpas(fr^.rf_Dir) +
+                      ' The path is:" ' +
+                      string(fr^.rf_Dir) + '"' +
                       chr(10) +
                       chr(10) +
-                      'And the file is :' +
-                      strpas(fr^.rf_File),
+                      'And the file is: "' +
+                      string(fr^.rf_File) + '"', 
                       'OK');
                       'OK');
         end else MessageBox('Test of Asl','You canceled','OK');
         end else MessageBox('Test of Asl','You canceled','OK');
         FreeAslRequest(fr);
         FreeAslRequest(fr);

+ 20 - 22
packages/amunits/examples/bezier.pas

@@ -124,15 +124,13 @@ var
     begin
     begin
     SetDrMd(rp, JAM1);
     SetDrMd(rp, JAM1);
     SetAPen(rp, 0);
     SetAPen(rp, 0);
-    RectFill(rp, BorderLeft, BorderTop,
-             BorderRight, BorderBottom);
+    RectFill(rp, BorderLeft, BorderTop, BorderRight, BorderBottom);
     SetDrMd(rp, COMPLEMENT);
     SetDrMd(rp, COMPLEMENT);
     SetAPen(rp, 3);
     SetAPen(rp, 3);
     end;
     end;
 
 
 begin
 begin
-    dummy := ModifyIDCMP(w, IDCMP_CLOSEWINDOW or IDCMP_MOUSEBUTTONS or
-IDCMP_MOUSEMOVE);
+    dummy := ModifyIDCMP(w, IDCMP_CLOSEWINDOW or IDCMP_MOUSEBUTTONS or IDCMP_MOUSEMOVE);
     SetDrMd(rp, COMPLEMENT);
     SetDrMd(rp, COMPLEMENT);
     PointCount := 0;
     PointCount := 0;
     Leave := False;
     Leave := False;
@@ -149,25 +147,25 @@ IDCMP_MOUSEMOVE);
         case StoreMsg.IClass of
         case StoreMsg.IClass of
            IDCMP_MOUSEMOVE : if PointCount > 0 then begin
            IDCMP_MOUSEMOVE : if PointCount > 0 then begin
                  if not OutOfBounds then
                  if not OutOfBounds then
-                 DrawLine;
+                     DrawLine;
                      LastX := StoreMsg.MouseX;
                      LastX := StoreMsg.MouseX;
                      LastY := StoreMsg.MouseY;
                      LastY := StoreMsg.MouseY;
                  if (LastX > BorderLeft) and
                  if (LastX > BorderLeft) and
-                (LastX < BorderRight) and
-                (LastY > BorderTop) and
-                (LastY < BorderBottom) then begin
-                 DrawLine;
-                 OutOfBounds := False;
+                   (LastX < BorderRight) and
+                   (LastY > BorderTop) and
+                   (LastY < BorderBottom) then begin
+                     DrawLine;
+                     OutOfBounds := False;
                  end else
                  end else
-                 OutOfBounds := True;
+                     OutOfBounds := True;
                  end;
                  end;
            IDCMP_MOUSEBUTTONS : if StoreMsg.Code = SELECTUP then begin
            IDCMP_MOUSEBUTTONS : if StoreMsg.Code = SELECTUP then begin
                     if PointCount > 0 then
                     if PointCount > 0 then
-                    Leave := CheckForExit
+                        Leave := CheckForExit
                 else
                 else
                     ClearIt;
                     ClearIt;
                     if (not Leave) and (not OutOfBounds) then
                     if (not Leave) and (not OutOfBounds) then
-                    AddPoint;
+                        AddPoint;
                     end;
                     end;
            IDCMP_CLOSEWINDOW : CleanUpAndDie;
            IDCMP_CLOSEWINDOW : CleanUpAndDie;
         end;
         end;
@@ -222,7 +220,7 @@ end;
 begin
 begin
 
 
    s := OpenScreenTags(nil,[
    s := OpenScreenTags(nil,[
-      AsTag(SA_Pens), AsTag(@pens),
+      AsTag(SA_Pens),      AsTag(@pens),
       AsTag(SA_Depth),     2,
       AsTag(SA_Depth),     2,
       AsTag(SA_DisplayID), HIRES_KEY,
       AsTag(SA_DisplayID), HIRES_KEY,
       AsTag(SA_Title),     AsTag('Simple Bezier Curves'),
       AsTag(SA_Title),     AsTag('Simple Bezier Curves'),
@@ -230,23 +228,23 @@ begin
 
 
     if s = NIL then CleanUpAndDie;
     if s = NIL then CleanUpAndDie;
 
 
-      w := OpenWindowTags(nil,[
+    w := OpenWindowTags(nil,[
       WA_IDCMP,        IDCMP_CLOSEWINDOW,
       WA_IDCMP,        IDCMP_CLOSEWINDOW,
       WA_Left,         0,
       WA_Left,         0,
       WA_Top,          s^.BarHeight +1,
       WA_Top,          s^.BarHeight +1,
       WA_Width,        s^.Width,
       WA_Width,        s^.Width,
       WA_Height,       s^.Height - (s^.BarHeight + 1),
       WA_Height,       s^.Height - (s^.BarHeight + 1),
-      WA_DepthGadget,  ltrue,
-      WA_DragBar,      ltrue,
-      WA_CloseGadget,  ltrue,
-      WA_ReportMouse,  ltrue,
-      WA_SmartRefresh, ltrue,
-      WA_Activate,     ltrue,
+      WA_DepthGadget,  AsTag(True),
+      WA_DragBar,      AsTag(True),
+      WA_CloseGadget,  AsTag(True),
+      WA_ReportMouse,  AsTag(True),
+      WA_SmartRefresh, AsTag(True),
+      WA_Activate,     AsTag(True),
       WA_Title,        AsTag('Close the Window to Quit'),
       WA_Title,        AsTag('Close the Window to Quit'),
       WA_CustomScreen, AsTag(s),
       WA_CustomScreen, AsTag(s),
       TAG_END]);
       TAG_END]);
 
 
-    IF w=NIL THEN CleanUpAndDie;
+    IF w = NIL THEN CleanUpAndDie;
 
 
     rp := w^.RPort;
     rp := w^.RPort;
     GfxMove(rp, 252, 30);
     GfxMove(rp, 252, 30);

+ 3 - 3
packages/amunits/examples/deviceinfo.pas

@@ -21,7 +21,7 @@
 
 
 Program DeviceInfo;
 Program DeviceInfo;
 
 
-uses exec,amigados,strings;
+uses exec,amigados;
 
 
 Const
 Const
   MaxSize = 80;
   MaxSize = 80;
@@ -44,7 +44,7 @@ End;
 Procedure AsdaLaVista(warum : String ; code : longint);
 Procedure AsdaLaVista(warum : String ; code : longint);
 
 
 Begin
 Begin
-  If Inf   <> Nil Then ExecFreeMem(Inf,SizeOf(tInfoData));
+  If Inf   <> Nil Then FreeMem(Inf);
   If warum <> '' Then WriteLn('',warum,'');
   If warum <> '' Then WriteLn('',warum,'');
   halt(code);
   halt(code);
 End;
 End;
@@ -56,7 +56,7 @@ Begin
   If ParamCount = 0 Then AsdaLaVista(' DiskInfo V1.0, © 1992 T.Schmid - Usage : DiskInfo Dfx:',0);
   If ParamCount = 0 Then AsdaLaVista(' DiskInfo V1.0, © 1992 T.Schmid - Usage : DiskInfo Dfx:',0);
   MyFile := ParamStr(1) + #0;
   MyFile := ParamStr(1) + #0;
 
 
-  Inf:=pInfoData(ExecAllocMem( SizeOf(tInfoData), MEMF_PUBLIC ) );
+  Inf:=pInfoData(AllocMem( SizeOf(tInfoData) ) );
   If Inf=Nil Then AsdaLaVista('No memory',5);
   If Inf=Nil Then AsdaLaVista('No memory',5);
 
 
   s:= 'Writeenabled';
   s:= 'Writeenabled';

+ 2 - 2
packages/amunits/examples/easygadtools.pas

@@ -118,8 +118,8 @@ BEGIN
   gad := ButtonGadget(2,10,HG,200,HGadget,'Screen Requester');
   gad := ButtonGadget(2,10,HG,200,HGadget,'Screen Requester');
   HG := HG + DistGad + 3;
   HG := HG + DistGad + 3;
 
 
-  //gad := CycleGadget(3,100,HG,100,HGadget,'Cycle me',@strarray);
-  //HG := HG + DistGad+4;
+  gad := CycleGadget(3,100,HG,100,HGadget,'Cycle me',@strarray);
+  HG := HG + DistGad+4;
 
 
   gad := ButtonGadget(4,10,HG,96,HGadget,'OK');
   gad := ButtonGadget(4,10,HG,96,HGadget,'OK');
   gad := ButtonGadget(5,115,HG,96,HGadget,'Cancel');
   gad := ButtonGadget(5,115,HG,96,HGadget,'Cancel');

+ 3 - 3
packages/amunits/examples/otherlibs/requestmodeid.pas

@@ -45,9 +45,9 @@ Begin
 
 
     rda:=ReadArgs (template,@vecarray,Nil);
     rda:=ReadArgs (template,@vecarray,Nil);
     If rda<>Nil Then Begin
     If rda<>Nil Then Begin
-       If vecarray[0] <> 0 then width := long(@vecarray[0]);
-       If vecarray[1] <> 0 then height := long(@vecarray[1]);
-       If vecarray[2] <> 0 then depth := long(@vecarray[2]);
+       If vecarray[0] <> 0 then width := PlongInt(vecarray[0])^;
+       If vecarray[1] <> 0 then height := PLongInt(vecarray[1])^;
+       If vecarray[2] <> 0 then depth := PLongInt(vecarray[2])^;
        FreeArgs(rda);
        FreeArgs(rda);
     End;
     End;