Cookbook/Recipe02/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/Recipe01/FBP/MainFB.pm ↑ Summary Cookbook/Recipe03/FBP/AboutFB.pm »
1 package Padre::Plugin::Cookbook::Recipe02::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,
33 );
34  
35 my $heading = Wx::StaticText->new(
36 $self,
37 -1,
38 "heading is a public",
39 );
40 $heading->SetFont( Wx::Font->new( Wx::wxNORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) );
41  
42 my $m_staticline1 = Wx::StaticLine->new(
43 $self,
44 -1,
45 Wx::wxDefaultPosition,
46 Wx::wxDefaultSize,
47 Wx::wxLI_HORIZONTAL,
48 );
49  
50 my $ttennis = Wx::CheckBox->new(
51 $self,
52 -1,
53 "TTennis",
54 Wx::wxDefaultPosition,
55 Wx::wxDefaultSize,
56 );
57  
58 Wx::Event::EVT_CHECKBOX(
59 $self, $ttennis,
60 sub {
61 shift->ttennis_checked(@_);
62 },
63 );
64  
65 my $ping = Wx::CheckBox->new(
66 $self,
67 -1,
68 "ping",
69 Wx::wxDefaultPosition,
70 Wx::wxDefaultSize,
71 );
72 $ping->Disable;
73  
74 Wx::Event::EVT_CHECKBOX(
75 $self, $ping,
76 sub {
77 shift->ping_checked(@_);
78 },
79 );
80  
81 my $pong = Wx::CheckBox->new(
82 $self,
83 -1,
84 "pong",
85 Wx::wxDefaultPosition,
86 Wx::wxDefaultSize,
87 );
88 $pong->Disable;
89  
90 Wx::Event::EVT_CHECKBOX(
91 $self, $pong,
92 sub {
93 shift->pong_checked(@_);
94 },
95 );
96  
97 my $m_staticText2 = Wx::StaticText->new(
98 $self,
99 -1,
100 "Static Text\nPadre Config DB\nuser defined\nattributes",
101 );
102  
103 my $user_name = Wx::RadioBox->new(
104 $self, -1,
105 "User * Name",
106 Wx::wxDefaultPosition,
107 Wx::wxDefaultSize,
108 [ "nick",
109 "cpan",
110 "e-mail",
111 ],
112 1,
113 Wx::wxRA_SPECIFY_COLS,
114 );
115 $user_name->SetSelection(0);
116  
117 my $m_staticline2 = Wx::StaticLine->new(
118 $self,
119 -1,
120 Wx::wxDefaultPosition,
121 Wx::wxDefaultSize,
122 Wx::wxLI_HORIZONTAL,
123 );
124  
125 my $name_label = Wx::StaticText->new(
126 $self,
127 -1,
128 "name_label public",
129 );
130  
131 my $name_value = Wx::TextCtrl->new(
132 $self,
133 -1,
134 "",
135 Wx::wxDefaultPosition,
136 Wx::wxDefaultSize,
137 );
138  
139 my $m_staticline3 = Wx::StaticLine->new(
140 $self,
141 -1,
142 Wx::wxDefaultPosition,
143 Wx::wxDefaultSize,
144 Wx::wxLI_HORIZONTAL,
145 );
146  
147 my $m_staticText4 = Wx::StaticText->new(
148 $self,
149 -1,
150 "Choices:",
151 );
152  
153 my $choices = Wx::Choice->new(
154 $self, -1,
155 Wx::wxDefaultPosition,
156 Wx::wxDefaultSize,
157 [ "CPL",
158 "CPL",
159 "BCPL",
160 "B",
161 "C",
162 "PL",
163 ],
164 );
165 $choices->SetSelection(0);
166  
167 my $m_staticline4 = Wx::StaticLine->new(
168 $self,
169 -1,
170 Wx::wxDefaultPosition,
171 Wx::wxDefaultSize,
172 Wx::wxLI_HORIZONTAL,
173 );
174  
175 my $output = Wx::Button->new(
176 $self,
177 -1,
178 "Output",
179 );
180  
181 Wx::Event::EVT_BUTTON(
182 $self, $output,
183 sub {
184 shift->output_clicked(@_);
185 },
186 );
187  
188 my $update = Wx::Button->new(
189 $self,
190 -1,
191 "Update",
192 );
193  
194 Wx::Event::EVT_BUTTON(
195 $self, $update,
196 sub {
197 shift->update_clicked(@_);
198 },
199 );
200  
201 my $close_button = Wx::Button->new(
202 $self,
203 Wx::wxID_CANCEL,
204 "Close",
205 );
206 $close_button->SetDefault;
207  
208 my $bSizer2 = Wx::BoxSizer->new(Wx::wxVERTICAL);
209 $bSizer2->Add( $heading, 0, Wx::wxALL, 5 );
210  
211 my $fgSizer1 = Wx::FlexGridSizer->new( 0, 2, 0, 0 );
212 $fgSizer1->SetFlexibleDirection(Wx::wxBOTH);
213 $fgSizer1->SetNonFlexibleGrowMode(Wx::wxFLEX_GROWMODE_SPECIFIED);
214 $fgSizer1->Add( $ttennis, 0, Wx::wxALL, 5 );
215 $fgSizer1->Add( $ping, 0, Wx::wxALL, 5 );
216 $fgSizer1->Add( 0, 0, 1, Wx::wxEXPAND, 5 );
217 $fgSizer1->Add( $pong, 0, Wx::wxALL, 5 );
218 $fgSizer1->Add( $m_staticText2, 0, Wx::wxALL, 5 );
219 $fgSizer1->Add( $user_name, 0, Wx::wxALL, 5 );
220  
221 my $bSizer3 = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
222 $bSizer3->Add( $name_label, 0, Wx::wxALL, 5 );
223 $bSizer3->Add( $name_value, 1, Wx::wxALL, 5 );
224  
225 my $fgSizer2 = Wx::FlexGridSizer->new( 0, 2, 0, 0 );
226 $fgSizer2->SetFlexibleDirection(Wx::wxBOTH);
227 $fgSizer2->SetNonFlexibleGrowMode(Wx::wxFLEX_GROWMODE_SPECIFIED);
228 $fgSizer2->Add( $m_staticText4, 0, Wx::wxALL, 5 );
229 $fgSizer2->Add( $choices, 0, Wx::wxALL, 5 );
230  
231 my $bSizer4 = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
232 $bSizer4->Add( $output, 0, Wx::wxALL, 5 );
233 $bSizer4->Add( $update, 0, Wx::wxALL, 5 );
234 $bSizer4->Add( $close_button, 0, Wx::wxALL, 5 );
235  
236 my $bSizer1 = Wx::BoxSizer->new(Wx::wxVERTICAL);
237 $bSizer1->Add( $bSizer2, 0, Wx::wxEXPAND, 5 );
238 $bSizer1->Add( $m_staticline1, 0, Wx::wxEXPAND | Wx::wxALL, 5 );
239 $bSizer1->Add( $fgSizer1, 1, Wx::wxEXPAND, 5 );
240 $bSizer1->Add( $m_staticline2, 0, Wx::wxEXPAND | Wx::wxALL, 5 );
241 $bSizer1->Add( $bSizer3, 0, Wx::wxEXPAND, 5 );
242 $bSizer1->Add( $m_staticline3, 0, Wx::wxEXPAND | Wx::wxALL, 5 );
243 $bSizer1->Add( $fgSizer2, 0, Wx::wxEXPAND, 5 );
244 $bSizer1->Add( $m_staticline4, 0, Wx::wxEXPAND | Wx::wxALL, 5 );
245 $bSizer1->Add( $bSizer4, 0, Wx::wxEXPAND, 5 );
246  
247 $self->SetSizer($bSizer1);
248 $self->Layout;
249 $bSizer1->Fit($self);
250  
251 $self->{heading} = $heading->GetId;
252 $self->{ttennis} = $ttennis->GetId;
253 $self->{ping} = $ping->GetId;
254 $self->{pong} = $pong->GetId;
255 $self->{user_name} = $user_name->GetId;
256 $self->{name_label} = $name_label->GetId;
257 $self->{name_value} = $name_value->GetId;
258 $self->{choices} = $choices->GetId;
259  
260 return $self;
261 }
262  
263 =pod
264
265 =over 4
266
267 =item heading ()
268
269 Public Accessor heading Auto-generated.
270
271 =back
272
273 =cut
274  
275 sub heading {
276 my $self = shift;
277 return Wx::Window::FindWindowById( $self->{heading} );
278 }
279  
280 =pod
281
282 =over 4
283
284 =item ttennis ()
285
286 Public Accessor ttennis Auto-generated.
287
288 =back
289
290 =cut
291  
292 sub ttennis {
293 my $self = shift;
294 return Wx::Window::FindWindowById( $self->{ttennis} );
295 }
296  
297 =pod
298
299 =over 4
300
301 =item ping ()
302
303 Public Accessor ping Auto-generated.
304
305 =back
306
307 =cut
308  
309 sub ping {
310 my $self = shift;
311 return Wx::Window::FindWindowById( $self->{ping} );
312 }
313  
314 =pod
315
316 =over 4
317
318 =item pong ()
319
320 Public Accessor pong Auto-generated.
321
322 =back
323
324 =cut
325  
326 sub pong {
327 my $self = shift;
328 return Wx::Window::FindWindowById( $self->{pong} );
329 }
330  
331 =pod
332
333 =over 4
334
335 =item user_name ()
336
337 Public Accessor user_name Auto-generated.
338
339 =back
340
341 =cut
342  
343 sub user_name {
344 my $self = shift;
345 return Wx::Window::FindWindowById( $self->{user_name} );
346 }
347  
348 =pod
349
350 =over 4
351
352 =item name_label ()
353
354 Public Accessor name_label Auto-generated.
355
356 =back
357
358 =cut
359  
360 sub name_label {
361 my $self = shift;
362 return Wx::Window::FindWindowById( $self->{name_label} );
363 }
364  
365 =pod
366
367 =over 4
368
369 =item name_value ()
370
371 Public Accessor name_value Auto-generated.
372
373 =back
374
375 =cut
376  
377 sub name_value {
378 my $self = shift;
379 return Wx::Window::FindWindowById( $self->{name_value} );
380 }
381  
382 =pod
383
384 =over 4
385
386 =item choices ()
387
388 Public Accessor choices Auto-generated.
389
390 =back
391
392 =cut
393  
394 sub choices {
395 my $self = shift;
396 return Wx::Window::FindWindowById( $self->{choices} );
397 }
398  
399 =pod
400
401 =over 4
402
403 =item ttennis_checked ()
404
405 Event Handler for ttennis.OnCheckBox (Required). Auto-generated.
406 You must implement this Method in your calling class.
407
408 =back
409
410 =cut
411  
412 sub ttennis_checked {
413 my $self = shift;
414 return $self->main->error('Handler method ttennis_checked for event ttennis.OnCheckBox not implemented');
415 }
416  
417 =pod
418
419 =over 4
420
421 =item ping_checked ()
422
423 Event Handler for ping.OnCheckBox (Required). Auto-generated.
424 You must implement this Method in your calling class.
425
426 =back
427
428 =cut
429  
430 sub ping_checked {
431 my $self = shift;
432 return $self->main->error('Handler method ping_checked for event ping.OnCheckBox not implemented');
433 }
434  
435 =pod
436
437 =over 4
438
439 =item pong_checked ()
440
441 Event Handler for pong.OnCheckBox (Required). Auto-generated.
442 You must implement this Method in your calling class.
443
444 =back
445
446 =cut
447  
448 sub pong_checked {
449 my $self = shift;
450 return $self->main->error('Handler method pong_checked for event pong.OnCheckBox not implemented');
451 }
452  
453 =pod
454
455 =over 4
456
457 =item output_clicked ()
458
459 Event Handler for output.OnButtonClick (Required). Auto-generated.
460 You must implement this Method in your calling class.
461
462 =back
463
464 =cut
465  
466 sub output_clicked {
467 my $self = shift;
468 return $self->main->error('Handler method output_clicked for event output.OnButtonClick not implemented');
469 }
470  
471 =pod
472
473 =over 4
474
475 =item update_clicked ()
476
477 Event Handler for update.OnButtonClick (Required). Auto-generated.
478 You must implement this Method in your calling class.
479
480 =back
481
482 =cut
483  
484 sub update_clicked {
485 my $self = shift;
486 return $self->main->error('Handler method update_clicked for event update.OnButtonClick not implemented');
487 }
488  
489 1;
490  
491 =pod
492  
493 =over 4
494  
495 =item new ()
496  
497 Constructor. Auto-generated by Padre::Plugin::FormBuilder.
498  
499 =back
500  
501 =head1 AUTHOR
502  
503 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
504  
505 =head1 SEE ALSO
506  
507 L<Padre>
508  
509 =head1 LICENSE AND COPYRIGHT
510  
511 Copyright (c) 2008-2013 The Padre development team as listed in Padre.pm.
512  
513 This module is free software; you can redistribute it and/or
514 modify it under the same terms as Perl itself.
515  
516 =cut
517  
518  
« Cookbook/Recipe01/FBP/MainFB.pm ↑ Summary Cookbook/Recipe03/FBP/AboutFB.pm »