Cookbook/Recipe03/FBP/MainFB.pm

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.6% 13 / 15 CC 1 SCAR 0.7
CC
1
Cov
82%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Cookbook/Recipe03/FBP/AboutFB.pm ↑ Summary Cookbook/Recipe04/FBP/AboutFB.pm »
1 package Padre::Plugin::Cookbook::Recipe03::FBP::MainFB;
2  
3 # This module was generated by Padre::Plugin::FormBuilder::PerlX.
4 # To change this module, edit the original .fbp file and regenerate.
5 # DO NOT MODIFY BY HAND!
6  
7 2 ▶use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 # use diagnostics;
11 # use utf8;
12 # use autodie;
13 0 ▶use Padre::Wx ();
Subroutine BEGIN: called CC=1 SCAR=2.6
14 use Padre::Wx::Role::Main ();
15  
16 our $VERSION = '0.24';
17 use parent -norequire, qw(
18 Padre::Wx::Role::Main
19 Wx::Dialog
20 );
21  
22 sub new {
23 my $class = shift;
24 my $parent = shift;
25  
26 my $self = $class->SUPER::new(
27 $parent,
28 -1,
29 "Main",
30 Wx::wxDefaultPosition,
31 Wx::wxDefaultSize,
32 Wx::wxDEFAULT_DIALOG_STYLE | Wx::wxRESIZE_BORDER,
33 );
34 $self->SetSizeHints( [ 240, -1 ], Wx::wxDefaultSize );
35  
36 my $package_name = Wx::StaticText->new(
37 $self,
38 -1,
39 "Main_Public_Label",
40 );
41 $package_name->SetFont( Wx::Font->new( 12, 70, 90, 92, 0, "" ) );
42  
43 my $about = Wx::Button->new(
44 $self,
45 -1,
46 "About",
47 );
48 $about->SetDefault;
49 $about->SetFont( Wx::Font->new( Wx::wxNORMAL_FONT->GetPointSize, 70, 93, 92, 0, "" ) );
50 $about->SetToolTip("About Dialog with Controler");
51  
52 Wx::Event::EVT_BUTTON(
53 $self, $about,
54 sub {
55 shift->about_clicked(@_);
56 },
57 );
58  
59 my $m_staticline1 = Wx::StaticLine->new(
60 $self,
61 -1,
62 Wx::wxDefaultPosition,
63 Wx::wxDefaultSize,
64 Wx::wxLI_HORIZONTAL,
65 );
66  
67 my $m_staticText1 = Wx::StaticText->new(
68 $self,
69 -1,
70 "Hello World",
71 );
72  
73 my $bSizer2 = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
74 $bSizer2->Add( $package_name, 0, Wx::wxALL, 5 );
75 $bSizer2->Add( $about, 0, Wx::wxALL, 5 );
76  
77 my $bSizer3 = Wx::BoxSizer->new(Wx::wxVERTICAL);
78 $bSizer3->Add( $m_staticText1, 0, Wx::wxALIGN_CENTER | Wx::wxALL, 5 );
79  
80 my $bSizer1 = Wx::BoxSizer->new(Wx::wxVERTICAL);
81 $bSizer1->Add( $bSizer2, 1, Wx::wxEXPAND, 5 );
82 $bSizer1->Add( $m_staticline1, 0, Wx::wxEXPAND | Wx::wxALL, 5 );
83 $bSizer1->Add( $bSizer3, 1, Wx::wxEXPAND, 5 );
84  
85 $self->SetSizer($bSizer1);
86 $self->Layout;
87 $bSizer1->Fit($self);
88 $bSizer1->SetSizeHints($self);
89  
90 $self->{package_name} = $package_name->GetId;
91  
92 return $self;
93 }
94  
95 =pod
96
97 =over 4
98
99 =item package_name ()
100
101 Public Accessor package_name Auto-generated.
102
103 =back
104
105 =cut
106  
107 sub package_name {
108 my $self = shift;
109 return Wx::Window::FindWindowById( $self->{package_name} );
110 }
111  
112 =pod
113
114 =over 4
115
116 =item about_clicked ()
117
118 Event Handler for about.OnButtonClick (Required). Auto-generated.
119 You must implement this Method in your calling class.
120
121 =back
122
123 =cut
124  
125 sub about_clicked {
126 my $self = shift;
127 return $self->main->error('Handler method about_clicked for event about.OnButtonClick not implemented');
128 }
129  
130 1;
131  
132 =pod
133  
134 =over 4
135  
136 =item new ()
137  
138 Constructor. Auto-generated by Padre::Plugin::FormBuilder.
139  
140 =back
141  
142 =head1 AUTHOR
143  
144 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
145  
146 =head1 SEE ALSO
147  
148 L<Padre>
149  
150 =head1 LICENSE AND COPYRIGHT
151  
152 Copyright (c) 2008-2013 The Padre development team as listed in Padre.pm.
153  
154 This module is free software; you can redistribute it and/or
155 modify it under the same terms as Perl itself.
156  
157 =cut
158  
159  
« Cookbook/Recipe03/FBP/AboutFB.pm ↑ Summary Cookbook/Recipe04/FBP/AboutFB.pm »