xref: /freebsd/contrib/dialog/samples/msgbox4-utf8 (revision 4c8945a06b01a5c8122cdeb402af36bb46a06acc)
1*4c8945a0SNathan Whitehorn#!/bin/sh
2*4c8945a0SNathan Whitehorn# $Id: msgbox4-utf8,v 1.10 2010/01/13 10:20:03 tom Exp $
3*4c8945a0SNathan Whitehorn
4*4c8945a0SNathan Whitehorn. ./setup-vars
5*4c8945a0SNathan Whitehorn
6*4c8945a0SNathan Whitehorn. ./setup-utf8
7*4c8945a0SNathan Whitehorn
8*4c8945a0SNathan Whitehornwidth=30
9*4c8945a0SNathan Whitehornwhile test $width != 61
10*4c8945a0SNathan Whitehorndo
11*4c8945a0SNathan Whitehorn$DIALOG --title "MESSAGE BOX (width $width)" --no-collapse "$@" \
12*4c8945a0SNathan Whitehorn        --msgbox "\
13*4c8945a0SNathan WhitehornThis sample is written in UTF-8.
14*4c8945a0SNathan WhitehornThere are several checking points:
15*4c8945a0SNathan Whitehorn(1) whether the fullwidth characters are displayed well or not,
16*4c8945a0SNathan Whitehorn(2) whether the width of characters are evaluated properly, and
17*4c8945a0SNathan Whitehorn(3) whether the character at line-folding is lost or not.
18*4c8945a0SNathan Whitehorn
19*4c8945a0SNathan Whitehornあいうえおかきくけこさしすせそたちつてとなにぬねの
20*4c8945a0SNathan Whitehorn1234567890123456789012345
21*4c8945a0SNathan WhitehornABCDEFGHIJKLMNOPQRSTUVWXY
22*4c8945a0SNathan Whitehorn
23*4c8945a0SNathan WhitehornHi, this is a simple message box.  You can use this to \
24*4c8945a0SNathan Whitehorndisplay any message you like.  The box will remain until \
25*4c8945a0SNathan Whitehornyou press the ENTER key." 22 $width
26*4c8945a0SNathan Whitehornretval=$?
27*4c8945a0SNathan Whitehorn
28*4c8945a0SNathan Whitehorncase $retval in
29*4c8945a0SNathan Whitehorn  $DIALOG_CANCEL)
30*4c8945a0SNathan Whitehorn    echo "Cancel pressed.";exit;;
31*4c8945a0SNathan Whitehorn  $DIALOG_ESC)
32*4c8945a0SNathan Whitehorn    echo "ESC pressed.";exit;;
33*4c8945a0SNathan Whitehornesac
34*4c8945a0SNathan Whitehorn
35*4c8945a0SNathan Whitehornwidth=`expr $width + 1`
36*4c8945a0SNathan Whitehorn
37*4c8945a0SNathan Whitehorndone
38