| 1 | package Padre::Plugin::ParserTool::FBP; | ||
| 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.01'; | ||
| 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("Parser Tool"), | ||
| 30 | Wx::DefaultPosition, | ||
| 31 | [ 459, 480 ], | ||
| 32 | Wx::DEFAULT_DIALOG_STYLE | Wx::RESIZE_BORDER, | ||
| 33 | ); | ||
| 34 | |||
| 35 | my $input_label = Wx::StaticText->new( | ||
| 36 | $self, | ||
| 37 | -1, | ||
| 38 | Wx::gettext("Input Text"), | ||
| 39 | ); | ||
| 40 | $input_label->SetFont( Wx::Font->new( Wx::NORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) ); | ||
| 41 | |||
| 42 | $self->{input} = Wx::TextCtrl->new( | ||
| 43 | $self, | ||
| 44 | -1, | ||
| 45 | "", | ||
| 46 | Wx::DefaultPosition, | ||
| 47 | [ 200, 100 ], | ||
| 48 | Wx::TE_DONTWRAP | Wx::TE_MULTILINE, | ||
| 49 | ); | ||
| 50 | $self->{input}->SetMinSize( [ 200, 100 ] ); | ||
| 51 | |||
| 52 | Wx::Event::EVT_TEXT( | ||
| 53 | $self, | ||
| 54 | $self->{input}, | ||
| 55 | sub { | ||
| 56 | shift->refresh(@_); | ||
| 57 | }, | ||
| 58 | ); | ||
| 59 | |||
| 60 | my $module_label = Wx::StaticText->new( | ||
| 61 | $self, | ||
| 62 | -1, | ||
| 63 | Wx::gettext("Parser Module"), | ||
| 64 | ); | ||
| 65 | $module_label->SetFont( Wx::Font->new( Wx::NORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) ); | ||
| 66 | |||
| 67 | $self->{module} = Wx::ComboBox->new( | ||
| 68 | $self, -1, "PPI", | ||
| 69 | Wx::DefaultPosition, | ||
| 70 | Wx::DefaultSize, | ||
| 71 | [ "PPI", | ||
| 72 | ], | ||
| 73 | Wx::CB_DROPDOWN, | ||
| 74 | ); | ||
| 75 | |||
| 76 | my $function_label = Wx::StaticText->new( | ||
| 77 | $self, | ||
| 78 | -1, | ||
| 79 | Wx::gettext("Parser Function"), | ||
| 80 | ); | ||
| 81 | $function_label->SetFont( Wx::Font->new( Wx::NORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) ); | ||
| 82 | |||
| 83 | $self->{function} = Wx::ComboBox->new( | ||
| 84 | $self, | ||
| 85 | -1, | ||
| 86 | "PPI::Document->new(\\\$_)", | ||
| 87 | Wx::DefaultPosition, | ||
| 88 | Wx::DefaultSize, | ||
| 89 | [], | ||
| 90 | ); | ||
| 91 | |||
| 92 | my $dumper_label = Wx::StaticText->new( | ||
| 93 | $self, | ||
| 94 | -1, | ||
| 95 | Wx::gettext("Dumper Format"), | ||
| 96 | ); | ||
| 97 | $dumper_label->SetFont( Wx::Font->new( Wx::NORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) ); | ||
| 98 | |||
| 99 | $self->{dumper} = Wx::Choice->new( | ||
| 100 | $self, -1, | ||
| 101 | Wx::DefaultPosition, | ||
| 102 | Wx::DefaultSize, | ||
| 103 | [ "Stringify", | ||
| 104 | "Devel::Dumpvar", | ||
| 105 | "Data::Dumper", | ||
| 106 | "PPI::Dumper", | ||
| 107 | ], | ||
| 108 | ); | ||
| 109 | $self->{dumper}->SetSelection(3); | ||
| 110 | |||
| 111 | Wx::Event::EVT_CHOICE( | ||
| 112 | $self, | ||
| 113 | $self->{dumper}, | ||
| 114 | sub { | ||
| 115 | shift->refresh(@_); | ||
| 116 | }, | ||
| 117 | ); | ||
| 118 | |||
| 119 | my $output_label = Wx::StaticText->new( | ||
| 120 | $self, | ||
| 121 | -1, | ||
| 122 | Wx::gettext("Output Structure"), | ||
| 123 | ); | ||
| 124 | $output_label->SetFont( Wx::Font->new( Wx::NORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) ); | ||
| 125 | |||
| 126 | $self->{output} = Wx::TextCtrl->new( | ||
| 127 | $self, | ||
| 128 | -1, | ||
| 129 | "", | ||
| 130 | Wx::DefaultPosition, | ||
| 131 | [ 400, 200 ], | ||
| 132 | Wx::TE_DONTWRAP | Wx::TE_MULTILINE | Wx::TE_READONLY, | ||
| 133 | ); | ||
| 134 | $self->{output}->SetMinSize( [ 400, 200 ] ); | ||
| 135 | $self->{output}->SetBackgroundColour( Wx::Colour->new( 240, 240, 240 ) ); | ||
| 136 | |||
| 137 | my $input_sizer = Wx::BoxSizer->new(Wx::VERTICAL); | ||
| 138 | $input_sizer->Add( $input_label, 0, Wx::ALL | Wx::EXPAND, 5 ); | ||
| 139 | $input_sizer->Add( $self->{input}, 1, Wx::EXPAND, 0 ); | ||
| 140 | |||
| 141 | my $options_sizer = Wx::BoxSizer->new(Wx::VERTICAL); | ||
| 142 | $options_sizer->SetMinSize( [ 200, -1 ] ); | ||
| 143 | $options_sizer->Add( $module_label, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::ALIGN_LEFT | Wx::ALL, 5 ); | ||
| 144 | $options_sizer->Add( $self->{module}, 0, Wx::EXPAND | Wx::LEFT, 5 ); | ||
| 145 | $options_sizer->Add( $function_label, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::ALIGN_LEFT | Wx::ALL, 5 ); | ||
| 146 | $options_sizer->Add( $self->{function}, 0, Wx::EXPAND | Wx::LEFT, 3 ); | ||
| 147 | $options_sizer->Add( $dumper_label, 0, Wx::ALIGN_CENTER_VERTICAL | Wx::ALIGN_LEFT | Wx::ALL, 5 ); | ||
| 148 | $options_sizer->Add( $self->{dumper}, 0, Wx::EXPAND | Wx::LEFT, 3 ); | ||
| 149 | |||
| 150 | my $top_sizer = Wx::BoxSizer->new(Wx::HORIZONTAL); | ||
| 151 | $top_sizer->Add( $input_sizer, 1, Wx::EXPAND, 5 ); | ||
| 152 | $top_sizer->Add( $options_sizer, 1, Wx::EXPAND, 5 ); | ||
| 153 | |||
| 154 | my $left_sizer = Wx::BoxSizer->new(Wx::VERTICAL); | ||
| 155 | $left_sizer->Add( $top_sizer, 0, Wx::EXPAND, 5 ); | ||
| 156 | $left_sizer->Add( $output_label, 0, Wx::ALL | Wx::EXPAND, 5 ); | ||
| 157 | $left_sizer->Add( $self->{output}, 1, Wx::EXPAND, 0 ); | ||
| 158 | |||
| 159 | my $sizer = Wx::BoxSizer->new(Wx::HORIZONTAL); | ||
| 160 | $sizer->Add( $left_sizer, 1, Wx::ALL | Wx::EXPAND, 5 ); | ||
| 161 | |||
| 162 | $self->SetSizer($sizer); | ||
| 163 | $self->Layout; | ||
| 164 | |||
| 165 | return $self; | ||
| 166 | } | ||
| 167 | |||
| 168 | sub input { | ||
| 169 | $_[0]->{input}; | ||
| 170 | } | ||
| 171 | |||
| 172 | sub module { | ||
| 173 | $_[0]->{module}; | ||
| 174 | } | ||
| 175 | |||
| 176 | sub function { | ||
| 177 | $_[0]->{function}; | ||
| 178 | } | ||
| 179 | |||
| 180 | sub dumper { | ||
| 181 | $_[0]->{dumper}; | ||
| 182 | } | ||
| 183 | |||
| 184 | sub output { | ||
| 185 | $_[0]->{output}; | ||
| 186 | } | ||
| 187 | |||
| 188 | sub refresh { | ||
| 189 | $_[0]->main->error('Handler method refresh for event input.OnText not implemented'); | ||
| 190 | } | ||
| 191 | |||
| 192 | 1; | ||
| 193 | |||
| 194 | # Copyright 2008-2012 The Padre development team as listed in Padre.pm. | ||
| 195 | # LICENSE | ||
| 196 | # This program is free software; you can redistribute it and/or | ||
| 197 | # modify it under the same terms as Perl 5 itself. | ||
| 198 |