Mojolicious/FBP/NewApp.pm untested

filter: Statementstmt 0.0% 0 / 56 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 70 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
ok_button
2.0
on_ok_clicked
2.0
CRAP 2.0
1 package Padre::Plugin::Mojolicious::FBP::NewApp;
2  
3 ## no critic
4  
5 # This module was generated by Padre::Plugin::FormBuilder::Perl.
6 # To change this module edit the original .fbp file and regenerate.
7 # DO NOT MODIFY THIS FILE BY HAND!
8  
9 use 5.008005;
10 use utf8;
11 use strict;
12 use warnings;
13 use Padre::Wx ();
14 use Padre::Wx::Role::Main ();
15  
16 our $VERSION = '0.06';
17 our @ISA = 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 Wx::gettext("New Mojolicious Application"),
30 Wx::DefaultPosition,
31 [ 322, 146 ],
32 Wx::DEFAULT_DIALOG_STYLE,
33 );
34  
35 my $app_name_label = Wx::StaticText->new(
36 $self,
37 -1,
38 Wx::gettext("Application Name:"),
39 );
40  
41 $self->{app_name} = Wx::TextCtrl->new(
42 $self,
43 -1,
44 "",
45 Wx::DefaultPosition,
46 Wx::DefaultSize,
47 );
48  
49 $self->{directory_label} = Wx::StaticText->new(
50 $self,
51 -1,
52 Wx::gettext("Parent Directory:"),
53 );
54  
55 $self->{directory} = Wx::DirPickerCtrl->new(
56 $self,
57 -1,
58 "",
59 Wx::gettext("Select a folder"),
60 Wx::DefaultPosition,
61 Wx::DefaultSize,
62 Wx::DIRP_DEFAULT_STYLE,
63 );
64  
65 $self->{ok_button} = Wx::Button->new(
66 $self,
67 -1,
68 Wx::gettext("OK"),
69 Wx::DefaultPosition,
70 Wx::DefaultSize,
71 );
72  
73 Wx::Event::EVT_BUTTON(
74 $self,
75 $self->{ok_button},
76 sub {
77 shift->on_ok_clicked(@_);
78 },
79 );
80  
81 $self->{cancel_button} = Wx::Button->new(
82 $self,
83 -1,
84 Wx::gettext("Cancel"),
85 Wx::DefaultPosition,
86 Wx::DefaultSize,
87 );
88  
89 Wx::Event::EVT_BUTTON(
90 $self,
91 $self->{cancel_button},
92 sub {
93 shift->on_cancel_clicked(@_);
94 },
95 );
96  
97 my $content_sizer = Wx::FlexGridSizer->new( 2, 2, 0, 0 );
98 $content_sizer->SetFlexibleDirection(Wx::BOTH);
99 $content_sizer->SetNonFlexibleGrowMode(Wx::FLEX_GROWMODE_SPECIFIED);
100 $content_sizer->Add( $app_name_label, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::LEFT | Wx::RIGHT | Wx::TOP, 5 );
101 $content_sizer->Add( $self->{app_name}, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::ALL, 5 );
102 $content_sizer->Add( $self->{directory_label}, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::ALL, 5 );
103 $content_sizer->Add( $self->{directory}, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::ALL | Wx::EXPAND, 5 );
104  
105 my $buttons_sizer = Wx::BoxSizer->new(Wx::HORIZONTAL);
106 $buttons_sizer->Add( 20, 0, 1, Wx::EXPAND, 5 );
107 $buttons_sizer->Add( $self->{ok_button}, 0, Wx::ALL, 2 );
108 $buttons_sizer->Add( $self->{cancel_button}, 0, Wx::ALL, 2 );
109  
110 my $vsizer = Wx::BoxSizer->new(Wx::VERTICAL);
111 $vsizer->Add( $content_sizer, 1, Wx::EXPAND, 5 );
112 $vsizer->Add( $buttons_sizer, 0, Wx::EXPAND, 5 );
113  
114 my $hsizer = Wx::BoxSizer->new(Wx::HORIZONTAL);
115 $hsizer->Add( $vsizer, 1, Wx::ALL | Wx::EXPAND, 5 );
116  
117 $self->SetSizer($hsizer);
118 $self->Layout;
119  
120 return $self;
121 }
122  
123 sub ok_button {
124 $_[0]->{ok_button};
125 }
126  
127 sub on_ok_clicked {
128 $_[0]->main->error('Handler method on_ok_clicked for event ok_button.OnButtonClick not implemented');
129 }
130  
131 sub on_cancel_clicked {
132 $_[0]->main->error('Handler method on_cancel_clicked for event cancel_button.OnButtonClick not implemented');
133 }
134  
135 1;
136  
137 # Copyright 2008-2011 The Padre development team as listed in Padre.pm.
138 # LICENSE
139 # This program is free software; you can redistribute it and/or
140 # modify it under the same terms as Perl 5 itself.
141