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