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