Version 0.4.0: mask, eine Eingabemaske mit eigener Oberfläche

This commit is contained in:
wkh
2026-10-11 22:08:38 +02:00
parent 837a73366d
commit e7a7577900
12 changed files with 592 additions and 4 deletions
+3
View File
@@ -4,3 +4,6 @@ Name : <Name> Company: <Company>
Street: <Street>
City : <City> State : <State> ZIP: <ZIP>
Phone : <Phone>
[Speichern] [Abbrechen]
+24
View File
@@ -0,0 +1,24 @@
: paint crt screen
exec 1>/dev/tty
cat <<SCREEN
${CLEAR} Mail List Entry Form
Name : Company:
Street:
City : State : ZIP:
Phone :
SCREEN
: read user input
cursor 3 9 ; read Name;
cursor 3 37 ; read Company;
cursor 4 9 ; read Street;
cursor 5 9 ; read City;
cursor 5 37 ; read State;
cursor 5 56 ; read ZIP;
cursor 6 9 ; read Phone;
: output table head
exec 1>&2
echo "Name Company Street City State ZIP Phone"
echo "---- ------- ------ ---- ----- --- -----"
: append row
echo "$Name $Company $Street $City $State $ZIP $Phone"
+9
View File
@@ -0,0 +1,9 @@
Mail List Entry
Name : <Name:24>
Company: <Company:24>
Street : <Street:24>
City : <City:16> State: <State:10> ZIP: <ZIP:9>
Phone : <Phone:16>
[ Save ] [ Cancel ]
+5
View File
@@ -187,6 +187,11 @@ letter form < maillist | head -5
## Run the script with: CLEAR=$(clear.rdb) sh script > table 2>&1 (the table goes to stderr)
cat entry
screen < entry
## mask draws the form itself (fields, buttons, frame) and writes the row as a table on stdout.
## It needs a terminal, so here only the picture of the form and its fields (-s) is shown.
## Try it: mask -b < maskform mask < maskform | append -h t
cat maskform
mask -s -b < maskform
## reportwriter: a sample report with page headings (the date is cut out)
reportwriter -3 Prices < inventory | grep -v 'Report Date'
## tabletom4 / tabletosed / tabletostruct were shown above
+43 -2
View File
@@ -745,6 +745,9 @@ Name : <Name> Company: <Company>
Street: <Street>
City : <City> State : <State> ZIP: <ZIP>
Phone : <Phone>
[Speichern] [Abbrechen]
$ screen < entry
: paint crt screen
exec 1>/dev/tty
@@ -755,6 +758,8 @@ Name : Company:
Street:
City : State : ZIP:
Phone :
[Speichern] [Abbrechen]
SCREEN
: read user input
cursor 3 9 ; read Name;
@@ -770,6 +775,42 @@ echo "Name Company Street City State ZIP Phone"
echo "---- ------- ------ ---- ----- --- -----"
: append row
echo "$Name $Company $Street $City $State $ZIP $Phone"
## mask draws the form itself (fields, buttons, frame) and writes the row as a table on stdout.
## It needs a terminal, so here only the picture of the form and its fields (-s) is shown.
## Try it: mask -b < maskform mask < maskform | append -h t
$ cat maskform
Mail List Entry
Name : <Name:24>
Company: <Company:24>
Street : <Street:24>
City : <City:16> State: <State:10> ZIP: <ZIP:9>
Phone : <Phone:16>
[ Save ] [ Cancel ]
$ mask -s -b < maskform
┌──────────────────────────────────────────────────────────────┐
│ Mail List Entry │
│ │
│ Name : ________________________ │
│ Company: ________________________ │
│ Street : ________________________ │
│ City : ________________ State: __________ ZIP: _________ │
│ Phone : ________________ │
│ │
│ [ Save ] [ Cancel ] │
└──────────────────────────────────────────────────────────────┘
Fields:
Name row 4 col 12 width 24
Company row 5 col 12 width 24
Street row 6 col 12 width 24
City row 7 col 12 width 16
State row 7 col 37 width 10
ZIP row 7 col 54 width 9
Phone row 8 col 12 width 16
[Save] row 10 col 6
[Cancel] row 10 col 17 (cancels)
## reportwriter: a sample report with page headings (the date is cut out)
$ reportwriter -3 Prices < inventory | grep -v 'Report Date'
Prices
@@ -804,9 +845,9 @@ Item Amount Cost Value Description
## tabletom4 / tabletosed / tabletostruct were shown above
## ===== Help and the terminal =====
$ rdb --version
rdb 0.3.0
rdb 0.4.0
$ howmany
134
135
$ whatis row
row - make a new table where rows match logical condition
row row 'column condition column-or-value ..' < table