1217309Snwhitehorn#!/bin/sh
2217309Snwhitehorn# $Id: editbox,v 1.13 2010/01/13 10:20:03 tom Exp $
3217309Snwhitehorn
4217309Snwhitehorn. ./setup-vars
5217309Snwhitehorn
6217309SnwhitehornDIALOG_ERROR=254
7217309Snwhitehornexport DIALOG_ERROR
8217309Snwhitehorn
9217309Snwhitehorn. ./setup-edit
10217309Snwhitehorn
11217309Snwhitehorncat << EOF > $input
12217309SnwhitehornHi, this is an edit box. It can be used to edit text from a file.
13217309Snwhitehorn
14217309SnwhitehornIt's like a simple text editor, with these keys implemented:
15217309Snwhitehorn
16217309SnwhitehornPGDN	- Move down one page
17217309SnwhitehornPGUP	- Move up one page
18217309SnwhitehornDOWN	- Move down one line
19217309SnwhitehornUP	- Move up one line
20217309SnwhitehornDELETE	- Delete the current character
21217309SnwhitehornBACKSPC	- Delete the previous character
22217309Snwhitehorn
23217309SnwhitehornUnlike Xdialog, it does not do these:
24217309Snwhitehorn
25217309SnwhitehornCTRL C	- Copy text
26217309SnwhitehornCTRL V	- Paste text
27217309Snwhitehorn
28217309SnwhitehornBecause dialog normally uses TAB for moving between fields,
29217309Snwhitehornthis editbox uses CTRL/V as a literal-next character.  You
30217309Snwhitehorncan enter TAB characters by first pressing CTRL/V.  This
31217309Snwhitehornexample contains a few tab characters.
32217309Snwhitehorn
33217309SnwhitehornIt supports the mouse - but only for positioning in the editbox,
34217309Snwhitehornor for clicking on buttons.  Your terminal (emulator) may support
35217309Snwhitehorncut/paste.
36217309Snwhitehorn
37217309SnwhitehornTry to input some text below:
38217309Snwhitehorn
39217309SnwhitehornEOF
40217309Snwhitehorn
41217309Snwhitehorn$DIALOG --title "EDIT BOX" \
42217309Snwhitehorn	--fixed-font "$@" --editbox $input 0 0 2>$output
43217309Snwhitehornretval=$?
44217309Snwhitehorn
45217309Snwhitehorn. ./report-edit
46