mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 07:32:24 +00:00
added oocRandomNumbers, updated newt wrapper with GetKey function. -- noch
Former-commit-id: ab5d3f734e
This commit is contained in:
parent
7de984b46a
commit
6886a243a6
14 changed files with 109 additions and 7 deletions
|
|
@ -7,6 +7,8 @@ all:
|
|||
$(VOC) -s newt.Mod newttest.Mod -m
|
||||
$(VOC) -s newt.Mod newttest2.Mod -m
|
||||
|
||||
tetris:
|
||||
$(VOC) -s newt.Mod tetris.Mod -m
|
||||
clean:
|
||||
rm *.h
|
||||
rm *.c
|
||||
|
|
|
|||
|
|
@ -98,6 +98,16 @@ BEGIN
|
|||
newtWaitForKey
|
||||
END WaitForKey;
|
||||
|
||||
PROCEDURE -newtGetKey(): Int32
|
||||
"newtGetKey()";
|
||||
|
||||
PROCEDURE GetKey*(): CHAR;
|
||||
VAR i : Int32;
|
||||
BEGIN
|
||||
i:= newtGetKey();
|
||||
RETURN CHR(SHORT(i));
|
||||
END GetKey;
|
||||
|
||||
PROCEDURE -newtClearKeyBuffer()
|
||||
"newtClearKeyBuffer()";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ MODULE newttest;
|
|||
IMPORT newt, oocIntStr, Unix;
|
||||
VAR i, j, k : newt.Int32;
|
||||
str : ARRAY 32 OF CHAR;
|
||||
ch : CHAR;
|
||||
fo, co : newt.Component;
|
||||
BEGIN
|
||||
i := newt.Init();
|
||||
|
|
@ -29,10 +30,17 @@ newt.PopHelpLine();
|
|||
newt.Refresh();
|
||||
i := Unix.Sleep(1);
|
||||
|
||||
fo := newt.Form(NIL, "aaa", 0);
|
||||
co := newt.Button(15, 15, "OK");
|
||||
newt.FormAddComponent(fo, co);
|
||||
REPEAT
|
||||
ch := newt.GetKey();
|
||||
str[0] := ch;
|
||||
str[1] := 0X;
|
||||
newt.DrawRootText(5, 5, str);
|
||||
newt.PushHelpLine(str);
|
||||
newt.Refresh;
|
||||
UNTIL ch = ' ';
|
||||
|
||||
(*
|
||||
newt.WaitForKey();
|
||||
newt.Delay(30);
|
||||
newt.Delay(30);*)
|
||||
i := newt.Finished();
|
||||
END newttest.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue