1251839Sbapt#! /bin/sh
2251839Sbapt# $Id: checklist12,v 1.3 2012/12/23 22:27:51 tom Exp $
3251839Sbapt
4251839Sbapt. ./setup-vars
5251839Sbapt
6251839Sbapt. ./setup-edit
7251839Sbapt
8251839Sbaptcase "x$DIALOGOPTS" in
9251839Sbapt*--no-items*|*--noitem*)
10251839Sbapt	CUT="cut -d: -f1,3"
11251839Sbapt	;;
12251839Sbapt*)
13251839Sbapt	CUT="cat"
14251839Sbapt	;;
15251839Sbaptesac
16251839Sbapt
17251839Sbapt$CUT >$input <<-EOF
18251839Sbapt	Apple:It's an apple.:off
19251839Sbapt	Dog:No, that's not my dog.:ON
20251839Sbapt	Orange:Yeah, that's juicy.:off
21251839Sbapt	Chicken:Normally not a pet.:off
22251839Sbapt	Cat:No, never put a dog and a cat together!:oN
23251839Sbapt	Fish:Cats like fish.:On
24251839Sbapt	Lemon:You know how it tastes.:on
25251839SbaptEOF
26251839Sbaptcat $input | sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' >$output
27251839Sbaptcat $output >$input
28251839Sbapt
29251839Sbapt$DIALOG --backtitle "No Such Organization" \
30251839Sbapt	--title "CHECKLIST BOX" "$@" \
31251839Sbapt        --checklist "Hi, this is a checklist box. You can use this to \n\
32251839Sbaptpresent a list of choices which can be turned on or \n\
33251839Sbaptoff. If there are more items than can fit on the \n\
34251839Sbaptscreen, the list will be scrolled. You can use the \n\
35251839SbaptUP/DOWN arrow keys, the first letter of the choice as a \n\
36251839Sbapthot key, or the number keys 1-9 to choose an option. \n\
37251839SbaptPress SPACE to toggle an option on/off. \n\n\
38251839Sbapt  Which of the following are fruits?" 20 61 5 \
39251839Sbapt	--file $input 2> $output
40251839Sbapt
41251839Sbaptretval=$?
42251839Sbapt
43251839Sbapttempfile=$output
44251839Sbapt. ./report-tempfile
45