File Coverage

blib/lib/Wx/DemoModules/wxStaticText.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/wxStaticText.pm
3             ## Purpose: wxPerl demo helper for Wx::StaticText
4             ## Author: Mattia Barbon
5             ## Modified by:
6             ## Created: 13/08/2006
7             ## RCS-ID: $Id: wxStaticText.pm 2189 2007-08-21 18:15:31Z mbarbon $
8             ## Copyright: (c) 2000, 2003, 2005-2006 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::wxStaticText;
14              
15 1     1   1234 use strict;
  1         2  
  1         38  
16 1     1   5 use base qw(Wx::DemoModules::lib::BaseModule Class::Accessor::Fast);
  1         1  
  1         75  
17              
18             use Wx qw(:statictext);
19              
20             __PACKAGE__->mk_accessors( qw(statictext) );
21              
22             sub styles {
23             my( $self ) = @_;
24              
25             return ( [ wxALIGN_LEFT, 'Align left' ],
26             [ wxALIGN_CENTER, 'Align center' ],
27             [ wxALIGN_RIGHT, 'Align right' ],
28             [ wxST_NO_AUTORESIZE, 'No autoresize' ],
29             );
30             }
31              
32             sub commands {
33             my( $self ) = @_;
34              
35             return ( { with_value => 1,
36             label => 'Set label',
37             action => sub { $self->statictext->SetLabel( $_[0] ) },
38             },
39             );
40             }
41              
42             sub create_control {
43             my( $self ) = @_;
44              
45             my $statictext = Wx::StaticText->new( $self, -1, 'A label',
46             [-1, -1], [100, 200],
47             $self->style );
48              
49             return $self->statictext( $statictext );
50             }
51              
52             sub add_to_tags { qw(controls) }
53             sub title { 'wxStaticText' }
54              
55             1;