1
0
mirror of synced 2026-01-12 00:42:56 +00:00
Interlisp.medley/library/READNUMBER.TEDIT
Larry Masinter 08852f7b55
Add TEDIT files for many Library packages (#1181)
* WHERE-IS library doc

* Gather keyboard files, add VIRTUAL.TEDIT

* add UNIXCOMM.TEDIT

* rest of TEdit library files

* save table of contents index for reworking

* Don't move around VIRTUALKEYBOARDS files; will move in separate commit

* Add MATMULT from Envos/Medley
2023-07-07 11:25:17 -07:00

31 lines
14 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1
Lisp Library Modules, Medley Release 1.15, READNUMBER
1
Lisp Library Modules, Medley Release 1.15, READNUMBER
READNUMBER
1
READNUMBER
1
READNUMBER
6
ReadNumber(READNUMBER NIL ReadNumber NIL NIL 215) contains functions for implementing a calculator-type menu for entering numbers with the mouse.
Installation
1
Load READNUMBER.LCOM from the library.
Functions
1
ReadNumber functions are called either from the Executive window or programmatically from another process.
The numbers captured by ReadNumber are passed to whatever process currently has the TTY.
Create a Key Pad(REATE% A% KEY% PAD NIL reate% a% Key% Pad NIL NIL 215)
(RNUMBER(RNUMBER (function) NIL NIL NIL 215) MSG POSITION MSGFONT DIGITFONT INCLUDEABORTFLG FLOATINGPTFLG POSITIVEONLYFLG ACCEPTTYPEINFLG ) [Function]
Brings up a menu that looks like a ten-key calculator pad(TEN-KEY% CALCULATOR% PAD NIL ten-key% calculator% pad NIL NIL 215). Your selections, made by pressing the left mouse button when the cursor is on a digit, are accumulated in a displayed total. The key pad includes a backspace key (BS), a clear key (CLR), and a +/- key (-). When OK is selected, the total is returned.
If MSG is given, it is displayed at the top of the menu.
If POSITION is given, the menu is put there; otherwise it is put at the cursor.
If MSGFONT is given, MSG is printed in it. If MSGFONT is NIL, DEFAULTFONT is used.
If DIGITFONT is given, the labels on the keys is printed in that font. If DIGITFONT is NIL, BOLDFONT is used.
If INCLUDEABORTFLG is non-NIL, the menu also includes an abort key (abt). If the abort key is pressed, RNUMBER returns NIL.
Note: If this option is set, you will not be able to use the backspace to correct mistakes. You will have to use CLEAR and begin the number again.
If FLOATINGPTFLG is non-NIL, the menu includes a decimal point, and the value returned may be a floating point number.
If POSITIVEONLYFLG is non-NIL, the menu does not include a +/- key (-) and you can only input positive numbers (but see ACCEPTTYPEINFLG ).
If ACCEPTTYPEINFLG is non-NIL, the menu also responds to user-typed input (i.e., numbers typed in on the keyboard, rather than selected with the mouse). In this mode, carriage return corresponds to OK.
Note: The decimal point (.) and the minus sign (-) are also accepted, even though they are not options in the key pad menu.
If you close the key pad window, the action taken by RNUMBER depends upon the value of INCLUDEABORTFLG. If INCLUDEABORTFLG is NIL, RNUMBER generates an error (i.e., calls (ERROR!)). If INCLUDEABORTFLG is non-NIL, RNUMBER returns NIL (the same thing it does if the abort key is pressed).
Create a Key Pad for Repeated Use(CREATE% A% KEY% PAD% FOR% REPEATED% USE NIL Create% a% Key% Pad% for% Repeated% Use NIL NIL 216)
For some applications, it may be beneficial to avoid the creation of the key pad menu window each time a number is asked for. The following functions allow you to create a key pad menu window and use it repeatedly to get values from you.
Note: When used in this manner, a key pad menu window can only be used by one process at a time.
(CREATE.NUMBERPAD.READER(CREATE.NUMBERPAD.READER (function) NIL NIL NIL 216) MSG WPOSITION MSGFONT DIGITFONT INCLUDEABORTFLG FLOATINGPTFLG POSITIVEONLYFLG) [Function]
Creates a window suitable for use by NUMBERPAD.READ (see below). Its arguments are the same as for the function RNUMBER.
(NUMBERPAD.READ(NUMBERPAD.READ (function) NIL NIL NIL 216) NUMBERPAD/READER ACCEPTTYPEINFLG) [Function]
NUMBERPAD/READER should be a window returned by the function CREATE.NUMBERPAD.READER (see above). NUMBERPAD.READ uses the window in the same manner as the function RNUMBER.
Examples
1
(RNUMBER "How many WIDGITS would you like?")
results in the following pop-up menu:
<00>k<01><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00>@<00>@<00>"8<><38><EFBFBD><EFBFBD>@<00>"<10><10><08>@<00>D<01>ň<EFBFBD>*<10><10><08>@<00>"DP&H<>*<10><00>@<00>"TQ<>H<EFBFBD>*<10>p<EFBFBD>@<00>"TR$E<10><10><08>@<00>"(R$E<10><10><08>@<00>(Q<>B8<><38><EFBFBD>@<00>@<00> @<00>@<00>@<00>p8<03>@<00>@@<00>D<10>Gq!<21>@@<00>"D0H<>B <20>@<00>"DH<><11><>@<00>"D<02><>B@<00>"L0<02><>"!@<00>4<10>
<11>@<00>@<00>@<00>@<00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<00>@<00>@<00>@<00> @<00> @<00><03><>@<00><01>m<>@<00><01>
<EFBFBD>@<00>
<EFBFBD>@<00>m<>@<00>̓@<00>@<00>@<00>@<00>@<00>@<00>@<00>@<00>`x@<00><00><00>3@<00><01> @<00>`@<00>`0@<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>``3@<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>`<00>3@<00><00>`<00>@<00><00>@<00><<00>@<00>f<00>@<00>f<00>@<00>f<00>@<00>f<00>@<00>f<00>@<00>f<00><00>|@<00><<00><01>`3@<00><00>``0@<00><00>`<00>>@<00><00>`<00>3@<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><03> 3@<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>`<00>3@<00>`x@<00>@<00>@<00>@<00>@<00>@<00>@<00>@<00><03>x@<00>0<00>3@<00>`<00>3@<00>`x3@<00><00><00>@<00><00><00>@<00><01><00>3@<00><01>x@<00>@<00>@<00>@<00>@<00>@<00>@<00>@<00>x@<00><00>@<00><00><01>c@<00><19><00>6<>@<00><19><00>7<>@<00><19><00>6<>@<00><19><00>6c@<00><x<01>3@<00>@<00>@<00>@<00>@<00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<00>@<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(RNUMBER "How far to the left?") NIL '(CLASSIC 12) '(MODERN 14) T T)
results in the following pop-up menu:
<00>f<01><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00><00><00><00><>0<00> <01><00>@P@B@B@<00>@@@B@B@<00>C7`<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C8<43>@<00>Ē@B!@B@C"@D<>@<40><00>D<EFBFBD><44>@<40>B@B#<23>G<EFBFBD>A<00>D<EFBFBD><44>A!B@B"DA<00>D<EFBFBD>BaR@R"@D<>P<00><>᳀a<E1B380>gq<67><71>8a<00><00><00><00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00>h<00><03>zh<00>RJ<h<00>^B$h<00><03>B<h<00>RJ h<00>^{<7B>h<00>h<00><00><01>h<00>ހ<07>h<00>R<><04>h<00>^<5E><07>h<00>T<><04>h<00>ր<04>h<00>h<00>h<00>h<00>h<00><03>h<00>0"@h<00>P@h<00>@h<00><03>h<00>@h<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@h<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@h<00><00> @h<00><<00>?<03>h<00>B<00>h<00>B<00>h<00>B<00>h<00>B<00>h<00>B<00>h<00>B<00>h<00>B<00> <01>h<00>B<00>` h<00><<00>`h<00><00><00>h<00><00> <05>h<00><00>  h<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>  h<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><07> h<00> ! h<00> <01>h<00>h<00>h<00>h<00>h<00>h<00>h<00><01><03>h<00>! h<00>! h<00>! h<00> `h<00> !<03>h<00>@! h<00>@! h<00><00>!@h<00><00><03>h<00>h<00>h<00>h<00>h<00>h<00>@h<00>@h<00>!@h<00>!@h<00>!8Dh<00>!DHh<00>!<00>ph<00>!<00>Ph<00>!<00>Hh<00>@!DDh<00>@8Bh<00>h<00>h<00>h<00>h<00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00><00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Limitations
1
If you choose both FLOATNGPOINTFLG and INCLUDEABORTFLG, there is no room for the backspace key (see the illustration above). Correct your input by selecting CLEAR and starting over. However, if ACCEPTTYPEINFLG is T, you can use the keyboard's backspace key.
[This page intentionally left blank]
(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "") STARTINGPAGE# 215) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 702) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL)))))-<01><00><01>T3HH<01>
<01>T2HH<01><01>5Hl<01>
l<01>2HH<01>
<01>2l<00><01><00>,ll<01>2H`<01> <01>3$$<01><01>T3<01><01>T,HH<01>
,HH<01>,HH<01>3<01><01>TF<01><01> PAGEHEADING VERSOHEADF<01><01> PAGEHEADING RECTOHEADE<01><01> PAGEHEADINGFOOTINGVE<01><01> PAGEHEADINGFOOTINGR2<00><00><01><01>, HELVETICACLASSIC
TITAN
CLASSIC
 HELVETICA  HELVETICA HELVETICA
MODERN
MODERNMODERN MODERN
MODERNMODERN
?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
 HRULE.GETFNMODERN
5
 HRULE.GETFNMODERN
6

 HRULE.GETFNMODERN
  HRULE.GETFNMODERN
  HRULE.GETFNMODERN 
'IM.INDEX.GETFNb
 HRULE.GETFNMODERN  
 HRULE.GETFNMODERN  k Y 7IM.INDEX.GETFN$IM.INDEX.GETFNMODERN
 \
 9CIM.INDEX.GETFN<00>3E    ? 
K <00>
^[<00>|50 8 !aIM.INDEX.GETFN
<00>b4IM.INDEX.GETFNMODERN
 M
%>+IM.INDEX.GETFNMODERN
 
-4 
 HRULE.GETFNMODERN .&<07> BMOBJ.GETFN3?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
$!& BMOBJ.GETFN3?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
 
 HRULE.GETFNMODERN <00>,% <00>z<EFBFBD>