brought sources in sync with current library state.

This commit is contained in:
Norayr Chilingarian 2018-04-10 23:29:14 +04:00
parent c43644ffeb
commit 4bbacbaaa4
2 changed files with 43 additions and 39 deletions

View file

@ -1,46 +1,50 @@
MODULE newttest; MODULE newttest;
IMPORT newt, oocIntStr, Unix; IMPORT newt, oocIntStr, Platform;
VAR i, j, k : newt.Int32;
str : ARRAY 32 OF CHAR; CONST delayTime = 1000;
ch : CHAR;
fo, co : newt.Component; VAR
i, j, k : newt.Int32;
str : ARRAY 32 OF CHAR;
ch : CHAR;
fo, co : newt.Component;
BEGIN BEGIN
i := newt.Init(); i := newt.Init();
newt.Cls(); newt.Cls();
str := "hello world!"; str := "hello world!";
newt.DrawRootText(5, 7, str); newt.DrawRootText(5, 7, str);
newt.GetScreenSize(i, j); newt.GetScreenSize(i, j);
oocIntStr.IntToStr(i, str); oocIntStr.IntToStr(i, str);
newt.DrawRootText(5, 9, str); newt.DrawRootText(5, 9, str);
str := "x"; str := "x";
newt.DrawRootText(7, 9, "x"); newt.DrawRootText(7, 9, "x");
oocIntStr.IntToStr(j, str); oocIntStr.IntToStr(j, str);
newt.DrawRootText(9, 9, str); newt.DrawRootText(9, 9, str);
newt.PushHelpLine(""); newt.PushHelpLine("");
newt.Refresh(); newt.Refresh();
i := Unix.Sleep(1); Platform.Delay(delayTime);
newt.PushHelpLine("A help line"); newt.PushHelpLine("A help line");
newt.Refresh(); newt.Refresh();
i := Unix.Sleep(1); Platform.Delay(delayTime);
newt.PopHelpLine(); newt.PopHelpLine();
newt.Refresh(); newt.Refresh();
i := Unix.Sleep(1); Platform.Delay(delayTime);
REPEAT REPEAT
ch := newt.GetKey(); ch := newt.GetKey();
str[0] := ch; str[0] := ch;
str[1] := 0X; str[1] := 0X;
newt.DrawRootText(5, 5, str); newt.DrawRootText(5, 5, str);
newt.PushHelpLine(str); newt.PushHelpLine(str);
newt.Refresh; newt.Refresh;
UNTIL ch = ' '; UNTIL ch = ' ';
(* (*
newt.WaitForKey(); newt.WaitForKey();
newt.Delay(30);*) newt.Delay(30);*)
i := newt.Finished(); i := newt.Finished();
END newttest. END newttest.

View file

@ -1,6 +1,6 @@
MODULE newttest2; MODULE newttest2;
IMPORT newt, oocIntStr, Unix; IMPORT newt, oocIntStr;
VAR i, j, k : newt.Int32; VAR i, j, k : newt.Int32;
str : ARRAY 32 OF CHAR; str : ARRAY 32 OF CHAR;
form, b1, b2, comp: newt.Component; form, b1, b2, comp: newt.Component;
@ -20,7 +20,7 @@ newt.FormAddComponent(form, b1);
newt.FormAddComponent(form, b2); newt.FormAddComponent(form, b2);
comp := newt.RunForm(form); comp := newt.RunForm(form);
newt.WaitForKey(); newt.WaitForKey();
newt.Delay(30); newt.Delay(3000);
newt.FormDestroy(form); newt.FormDestroy(form);
i := newt.Finished(); i := newt.Finished();
END newttest2. END newttest2.