File Coverage

blib/lib/Wx/DemoModules/wxTextEntryDialog.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             #############################################################################
2             ## Name: lib/Wx/DemoModules/wxTextEntryDialog.pm
3             ## Purpose: wxPerl demo helper for Wx::TextEntryDialog
4             ## Author: Mattia Barbon
5             ## Modified by:
6             ## Created: 11/02/2001
7             ## RCS-ID: $Id: wxTextEntryDialog.pm 2212 2007-08-25 23:13:10Z mbarbon $
8             ## Copyright: (c) 2001, 2003, 2006-2007 Mattia Barbon
9             ## Licence: This program is free software; you can redistribute it and/or
10             ## modify it under the same terms as Perl itself
11             #############################################################################
12              
13             package Wx::DemoModules::wxTextEntryDialog;
14              
15 1     1   1262 use strict;
  1         3  
  1         39  
16 1     1   5 use base qw(Wx::DemoModules::lib::BaseModule Class::Accessor::Fast);
  1         2  
  1         76  
17              
18             use Wx qw(:id);
19              
20             sub commands {
21             my( $self ) = @_;
22              
23             return ( { label => 'Text entry dialog',
24             action => \&text_entry_dialog,
25             },
26             );
27             }
28              
29             sub text_entry_dialog {
30             my( $this ) = @_;
31             my $dialog = Wx::TextEntryDialog->new
32             ( $this, "Enter some text", "Wx::TextEntryDialog sample",
33             "I am a default value" );
34              
35             if( $dialog->ShowModal == wxID_CANCEL ) {
36             Wx::LogMessage( "User cancelled the dialog" );
37             } else {
38             Wx::LogMessage( "Text: %s", $dialog->GetValue );
39             }
40              
41             $dialog->Destroy;
42             }
43              
44             sub add_to_tags { qw(dialogs) }
45             sub title { 'wxTextEntryDialog' }
46              
47             1;