xref: /freebsd/contrib/dialog/samples/editbox4 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1#!/bin/sh
2# $Id: editbox4,v 1.2 2020/11/26 00:03:58 tom Exp $
3
4. ./setup-vars
5
6DIALOG_ERROR=254
7export DIALOG_ERROR
8
9. ./setup-edit
10
11cat << EOF > $input
12Hi, this is an edit box. It can be used to edit text from a file.
13
14It's like a simple text editor, with these keys implemented:
15
16PGDN	- Move down one page
17PGUP	- Move up one page
18DOWN	- Move down one line
19UP	- Move up one line
20DELETE	- Delete the current character
21BACKSPC	- Delete the previous character
22
23Unlike Xdialog, it does not do these:
24
25CTRL C	- Copy text
26CTRL V	- Paste text
27
28Because dialog normally uses TAB for moving between fields,
29this editbox uses CTRL/V as a literal-next character.  You
30can enter TAB characters by first pressing CTRL/V.  This
31example contains a few tab characters.
32
33It supports the mouse - but only for positioning in the editbox,
34or for clicking on buttons.  Your terminal (emulator) may support
35cut/paste.
36
37Try to input some text below:
38
39EOF
40
41$DIALOG --title "EDIT BOX" \
42	--fixed-font "$@" --editbox $input 20 40 2>$output
43returncode=$?
44
45. ./report-edit
46