1100978Srwatson#!/bin/sh
2100978Srwatson# $Id: editbox2,v 1.7 2010/01/13 10:20:03 tom Exp $
3100978Srwatson# example with extra- and help-buttons
4100978Srwatson
5100978Srwatson. ./setup-vars
6100978Srwatson
7100978Srwatson. ./setup-edit
8100978Srwatson
9100978Srwatsoncat << EOF > $input
10100978SrwatsonHi, this is an edit box. It can be used to edit text from a file.
11100978Srwatson
12100978SrwatsonIt's like a simple text editor, with these keys implemented:
13100978Srwatson
14100978SrwatsonPGDN	- Move down one page
15100978SrwatsonPGUP	- Move up one page
16100978SrwatsonDOWN	- Move down one line
17100978SrwatsonUP	- Move up one line
18100978SrwatsonDELETE	- Delete the current character
19100978SrwatsonBACKSPC	- Delete the previous character
20100978Srwatson
21100978SrwatsonUnlike Xdialog, it does not do these:
22100978Srwatson
23100978SrwatsonCTRL C	- Copy text
24100978SrwatsonCTRL V	- Paste text
25100978Srwatson
26100978SrwatsonBecause dialog normally uses TAB for moving between fields,
27100978Srwatsonthis editbox uses CTRL/V as a literal-next character.  You
28100978Srwatsoncan enter TAB characters by first pressing CTRL/V.  This
29100978Srwatsonexample contains a few tab characters.
30100978Srwatson
31100978SrwatsonIt supports the mouse - but only for positioning in the editbox,
32100978Srwatsonor for clicking on buttons.  Your terminal (emulator) may support
33100978Srwatsoncut/paste.
34100978Srwatson
35100978SrwatsonTry to input some text below:
36100978Srwatson
37100978SrwatsonEOF
38100978Srwatson
39100978Srwatson$DIALOG --title "EDIT BOX" \
40100978Srwatson	--extra-button \
41100978Srwatson	--help-button \
42100978Srwatson	--fixed-font "$@" --editbox $input 0 0 2>$output
43100978Srwatsonretval=$?
44100978Srwatson
45100978Srwatson. ./report-edit
46100978Srwatson