Pvoice/Dialog.pm untested

filter: Statementstmt 0.0% 0 / 44 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 59 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
Append
2.0
OnClose
2.0
CRAP 2.0
1 package AAC::Pvoice::Dialog;
2 use strict;
3 use warnings;
4
5 our $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $=~/(\d+)\.(\d+)/);
6
7 use Wx qw(:everything);
8 use Wx::Event qw(EVT_CLOSE);
9
10 use base 'Wx::Dialog';
11
12 sub new
13 {
14 my $class = shift;
15 my $self = $class->SUPER::new(@_);
16 my ($x, $y) = ($self->GetClientSize->GetWidth,
17 $self->GetClientSize->GetHeight);
18
19 $self->{margin} = 10;
20 $self->{ITEMSPACING} = 4;
21 $self->{selectionborder} = 3;
22 $self->{backgroundcolour} = Wx::Colour->new(220,220,220);
23 $self->SetBackgroundColour(wxWHITE);
24
25 $self->{panel} = AAC::Pvoice::Panel->new( $self, # parent
26 -1, # id
27 [$self->{margin},
28 $self->{margin}], # position
29 [$x-2*$self->{margin},
30 $y-2*$self->{margin}],# size
31 wxNO_3D|wxWANTS_CHARS, # style
32 1, # disabletextrow
33 $self->{ITEMSPACING}, # rowspacing
34 $self->{selectionborder}, # selectionborderwidth
35 1); # disabletitle
36
37 $self->{panel}->BackgroundColour($self->{backgroundcolour});
38 $self->WarpPointer($self->{margin}+1,$self->{margin}+1);
39 $self->SetFocus();
40 EVT_CLOSE($self, \&OnClose);
41 return $self;
42 }
43
44 sub Append
45 {
46 my $self = shift;
47 $self->{panel}->Append(@_);
48 }
49
50 sub OnClose
51 {
52 my $self = shift;
53 $self->Destroy();
54 }
55
56 sub Show
57 {
58 my $self = shift;
59 my $bool = shift;
60 $self->{panel}->Finalize();
61 $self->SUPER::Show($bool);
62 }
63
64 sub ShowModal
65 {
66 my $self = shift;
67 $self->{panel}->Finalize();
68 $self->SUPER::ShowModal();
69 }
70
71 1;
72
73 __END__