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