Artifact 177b59797be4eef5fffef61e3f53709812e5a7176d1e46d7c74e16470c76685b:
- File
psl-1983/emode/menu.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1768) [annotate] [blame] [check-ins using] [more...]
% simple demo of tools for menus and break windows % MLG and WFG Symbolic Procedure MakeMenu(); % Setup the Menu Window begin scalar oldbuffer; % Create the MENU buffer MenuBuffer:=CreateBuffer('MENU, eval DefaultMode); % Create (but don't "select") the window to look into the buffer. MenuWindow := FramedWindowDescriptor('MENU, % Starts at column 50, Row 13 Coords(50,13), Coords(25,7)); % Set up the buffer text. oldbuffer := CurrentBufferName; SelectBuffer 'MENU; append_line("ERASE(); % the screen"); append_line("ExitMenu();"); append_line("KillMenu();"); !$CRLF(); % "Pop" back to original buffer. SelectBuffer oldbuffer; % Define a new key binding (for text mode) for popping up the menu. SetTextKey(Char Cntrl H, 'Menu); end; Procedure KillMenu(); % Exit and Wipe MENU <<!*KillMenu:=T; Throw('!$MENU!$,0)>>; Procedure ExitMenu(); % Exit and LEAVE Menu <<!*KillMenu:=NIL; Throw('!$MENU!$,0)>>; Fluid '(!*KillMenu); procedure MenuReader(); TopLoop('ReformXread,'NoPrint,'EVAL,"Menu",""); Procedure NoPrint x; X; procedure Menu; Begin Scalar W; % Need to select EMODE channels, since MENU is typically invoked while % "old" channels are selected. SelectEMODEChannels(); W:=CurrentWindowdescriptor; SelectWindow MenuWindow$ !$BeginningOfBuffer(); % Place point at start of buffer. % Transfer control to the menu reader. Catch('!$MENU!$, MenuReader() ); % When finished, "pop" our screen off of the physical screen. If !*KillMenu then DeselectScreen CurrentVirtualScreen; SelectWindow W; % Back to the window we originally had. end;