#!/usr/bin/perl -w
# $Id: template,v 1.3 2013/07/14 22:38:48 tom Exp $

#
# Purpose:
#	To demonstrate the Perl5 Cdk Template Widget.

use strict;

#
# Initialize Cdk.
#
use Cdk;
Cdk::init();

# Create the template object.
my $template = new Cdk::Template(
    'Label'   => 'Type in a date:',
    'Plate'   => '## ## ####',
    'Overlay' => 'DD-MM-YYYY'
);

# Activate the widget.
my $date = $template->activate();

# Get the mixed date back.
my $mixedDate = $template->mix();

# Check the results.
if ( !defined $date ) {
    popupLabel( ["<C>Escape hit. No information to return."] );
}
else {
    popupLabel(
        [
            "<C>With Overlay Mixing   : $mixedDate",
            "<C>Without Overlay Mixing: $date"
        ]
    );
}

# Exit Cdk.
Cdk::end();
