| 1 | #! /bin/sh |
| 2 | # $Id: mixedform,v 1.9 2020/11/26 00:27:07 tom Exp $ |
| 3 | |
| 4 | . ./setup-vars |
| 5 | |
| 6 | backtitle="An Example for the use of --mixedform:" |
| 7 | returncode=0 |
| 8 | while test $returncode != 1 && test $returncode != 250 |
| 9 | do |
| 10 | returncode=$? |
| 11 | exec 3>&1 |
| 12 | returntext=`$DIALOG --title "Mixed form demonstration" --ok-label "Submit" \ |
| 13 | --backtitle "$backtitle" \ |
| 14 | --insecure "$@" \ |
| 15 | --mixedform "Here is a possible piece of a configuration program." \ |
| 16 | 20 50 0 \ |
| 17 | "Username :" 1 1 "Kiran" 1 20 10 0 2 \ |
| 18 | "Password :" 2 1 "" 2 20 8 0 1 \ |
| 19 | "Retype Password :" 3 1 "" 3 20 8 0 1 \ |
| 20 | "HOME :" 4 1 "Cisco" 4 20 40 0 0 \ |
| 21 | 2>&1 1>&3` |
| 22 | returncode=$? |
| 23 | exec 3>&- |
| 24 | show=`echo "$returntext" |sed -e 's/^/ /'` |
| 25 | |
| 26 | case $returncode in |
| 27 | $DIALOG_CANCEL) |
| 28 | "$DIALOG" \ |
| 29 | --clear \ |
| 30 | --backtitle "$backtitle" \ |
| 31 | --yesno "Really quit?" 10 30 |
| 32 | case $? in |
| 33 | $DIALOG_OK) |
| 34 | break |
| 35 | ;; |
| 36 | $DIALOG_CANCEL) |
| 37 | returncode=99 |
| 38 | ;; |
| 39 | esac |
| 40 | ;; |
| 41 | $DIALOG_OK) |
| 42 | "$DIALOG" \ |
| 43 | --clear \ |
| 44 | --backtitle "$backtitle" --no-collapse --cr-wrap \ |
| 45 | --msgbox "Resulting data:\n\ |
| 46 | $show" 10 40 |
| 47 | ;; |
| 48 | *) |
| 49 | . ./report-button |
| 50 | exit |
| 51 | ;; |
| 52 | esac |
| 53 | done |