| 1 | package Padre::Plugin::Cookbook::Recipe04::FBP::MainFB; | ||
| 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 | 1 | ▶ | use v5.10.1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 0 | ▶ | use Padre::Wx (); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 13 | use Padre::Wx::Role::Main (); | ||
| 14 | |||
| 15 | our $VERSION = '0.24'; | ||
| 16 | our @ISA = qw{ | ||
| 17 | Padre::Wx::Role::Main | ||
| 18 | Wx::Dialog | ||
| 19 | }; | ||
| 20 | |||
| 21 | sub new { | ||
| 22 | my $class = shift; | ||
| 23 | my $parent = shift; | ||
| 24 | |||
| 25 | my $self = $class->SUPER::new( | ||
| 26 | $parent, | ||
| 27 | -1, | ||
| 28 | Wx::gettext("Main"), | ||
| 29 | Wx::DefaultPosition, | ||
| 30 | Wx::DefaultSize, | ||
| 31 | Wx::DEFAULT_DIALOG_STYLE | Wx::RESIZE_BORDER, | ||
| 32 | ); | ||
| 33 | |||
| 34 | $self->{package_name} = Wx::StaticText->new( | ||
| 35 | $self, | ||
| 36 | -1, | ||
| 37 | Wx::gettext("ConfigDB"), | ||
| 38 | ); | ||
| 39 | $self->{package_name}->SetFont( | ||
| 40 | Wx::Font->new( 14, 70, 90, 92, 0, "" ) | ||
| 41 | ); | ||
| 42 | |||
| 43 | $self->{relation_title} = Wx::StaticText->new( | ||
| 44 | $self, | ||
| 45 | -1, | ||
| 46 | Wx::gettext("Relation Name"), | ||
| 47 | ); | ||
| 48 | $self->{relation_title}->SetFont( | ||
| 49 | Wx::Font->new( 14, 70, 90, 90, 0, "" ) | ||
| 50 | ); | ||
| 51 | |||
| 52 | $self->{display_cardinality} = Wx::StaticText->new( | ||
| 53 | $self, | ||
| 54 | -1, | ||
| 55 | Wx::gettext("Cardinality"), | ||
| 56 | ); | ||
| 57 | |||
| 58 | $self->{about} = Wx::Button->new( | ||
| 59 | $self, | ||
| 60 | -1, | ||
| 61 | Wx::gettext("About"), | ||
| 62 | Wx::DefaultPosition, | ||
| 63 | Wx::DefaultSize, | ||
| 64 | ); | ||
| 65 | |||
| 66 | Wx::Event::EVT_BUTTON( | ||
| 67 | $self, | ||
| 68 | $self->{about}, | ||
| 69 | sub { | ||
| 70 | shift->about_clicked(@_); | ||
| 71 | }, | ||
| 72 | ); | ||
| 73 | |||
| 74 | $self->{m_staticline1_1} = Wx::StaticLine->new( | ||
| 75 | $self, | ||
| 76 | -1, | ||
| 77 | Wx::DefaultPosition, | ||
| 78 | Wx::DefaultSize, | ||
| 79 | Wx::LI_HORIZONTAL, | ||
| 80 | ); | ||
| 81 | |||
| 82 | $self->{list_ctrl} = Wx::ListCtrl->new( | ||
| 83 | $self, | ||
| 84 | -1, | ||
| 85 | Wx::DefaultPosition, | ||
| 86 | Wx::DefaultSize, | ||
| 87 | Wx::LC_EDIT_LABELS | Wx::LC_REPORT, | ||
| 88 | ); | ||
| 89 | $self->{list_ctrl}->SetMinSize( [ 560, 188 ] ); | ||
| 90 | |||
| 91 | Wx::Event::EVT_LIST_COL_CLICK( | ||
| 92 | $self, | ||
| 93 | $self->{list_ctrl}, | ||
| 94 | sub { | ||
| 95 | shift->_on_list_col_clicked(@_); | ||
| 96 | }, | ||
| 97 | ); | ||
| 98 | |||
| 99 | Wx::Event::EVT_LIST_ITEM_ACTIVATED( | ||
| 100 | $self, | ||
| 101 | $self->{list_ctrl}, | ||
| 102 | sub { | ||
| 103 | shift->_on_list_item_activated(@_); | ||
| 104 | }, | ||
| 105 | ); | ||
| 106 | |||
| 107 | my $m_staticline1_2 = Wx::StaticLine->new( | ||
| 108 | $self, | ||
| 109 | -1, | ||
| 110 | Wx::DefaultPosition, | ||
| 111 | Wx::DefaultSize, | ||
| 112 | Wx::LI_HORIZONTAL, | ||
| 113 | ); | ||
| 114 | |||
| 115 | $self->{m_staticText5} = Wx::StaticText->new( | ||
| 116 | $self, | ||
| 117 | -1, | ||
| 118 | Wx::gettext("config.db"), | ||
| 119 | ); | ||
| 120 | $self->{m_staticText5}->SetFont( | ||
| 121 | Wx::Font->new( Wx::NORMAL_FONT->GetPointSize, 70, 90, 92, 0, "" ) | ||
| 122 | ); | ||
| 123 | |||
| 124 | $self->{relations} = Wx::RadioBox->new( | ||
| 125 | $self, | ||
| 126 | -1, | ||
| 127 | Wx::gettext("Relations"), | ||
| 128 | Wx::DefaultPosition, | ||
| 129 | Wx::DefaultSize, | ||
| 130 | [ | ||
| 131 | "Plugin", | ||
| 132 | "Session", | ||
| 133 | "SessionFile", | ||
| 134 | "Bookmark", | ||
| 135 | "History", | ||
| 136 | "HostConfig", | ||
| 137 | "Snippets", | ||
| 138 | "RecentlyUsed", | ||
| 139 | "LastPositionInFile", | ||
| 140 | "DebugBreakpoints", | ||
| 141 | ], | ||
| 142 | 2, | ||
| 143 | Wx::RA_SPECIFY_ROWS, | ||
| 144 | ); | ||
| 145 | $self->{relations}->SetSelection(0); | ||
| 146 | |||
| 147 | $self->{m_staticline1_3} = Wx::StaticLine->new( | ||
| 148 | $self, | ||
| 149 | -1, | ||
| 150 | Wx::DefaultPosition, | ||
| 151 | Wx::DefaultSize, | ||
| 152 | Wx::LI_HORIZONTAL, | ||
| 153 | ); | ||
| 154 | |||
| 155 | $self->{update} = Wx::Button->new( | ||
| 156 | $self, | ||
| 157 | -1, | ||
| 158 | Wx::gettext("Update"), | ||
| 159 | Wx::DefaultPosition, | ||
| 160 | Wx::DefaultSize, | ||
| 161 | ); | ||
| 162 | |||
| 163 | Wx::Event::EVT_BUTTON( | ||
| 164 | $self, | ||
| 165 | $self->{update}, | ||
| 166 | sub { | ||
| 167 | shift->update_clicked(@_); | ||
| 168 | }, | ||
| 169 | ); | ||
| 170 | |||
| 171 | $self->{show} = Wx::Button->new( | ||
| 172 | $self, | ||
| 173 | -1, | ||
| 174 | Wx::gettext("Show"), | ||
| 175 | Wx::DefaultPosition, | ||
| 176 | Wx::DefaultSize, | ||
| 177 | ); | ||
| 178 | $self->{show}->Disable; | ||
| 179 | |||
| 180 | Wx::Event::EVT_BUTTON( | ||
| 181 | $self, | ||
| 182 | $self->{show}, | ||
| 183 | sub { | ||
| 184 | shift->show_clicked(@_); | ||
| 185 | }, | ||
| 186 | ); | ||
| 187 | |||
| 188 | $self->{clean} = Wx::Button->new( | ||
| 189 | $self, | ||
| 190 | -1, | ||
| 191 | Wx::gettext("Clean"), | ||
| 192 | Wx::DefaultPosition, | ||
| 193 | Wx::DefaultSize, | ||
| 194 | ); | ||
| 195 | $self->{clean}->Disable; | ||
| 196 | |||
| 197 | Wx::Event::EVT_BUTTON( | ||
| 198 | $self, | ||
| 199 | $self->{clean}, | ||
| 200 | sub { | ||
| 201 | shift->clean_clicked(@_); | ||
| 202 | }, | ||
| 203 | ); | ||
| 204 | |||
| 205 | $self->{width_adjust} = Wx::Button->new( | ||
| 206 | $self, | ||
| 207 | -1, | ||
| 208 | Wx::gettext("Adjust Width"), | ||
| 209 | Wx::DefaultPosition, | ||
| 210 | Wx::DefaultSize, | ||
| 211 | ); | ||
| 212 | $self->{width_adjust}->Disable; | ||
| 213 | |||
| 214 | Wx::Event::EVT_BUTTON( | ||
| 215 | $self, | ||
| 216 | $self->{width_adjust}, | ||
| 217 | sub { | ||
| 218 | shift->width_adjust_clicked(@_); | ||
| 219 | }, | ||
| 220 | ); | ||
| 221 | |||
| 222 | my $close_button = Wx::Button->new( | ||
| 223 | $self, | ||
| 224 | Wx::ID_CANCEL, | ||
| 225 | Wx::gettext("Close"), | ||
| 226 | Wx::DefaultPosition, | ||
| 227 | Wx::DefaultSize, | ||
| 228 | ); | ||
| 229 | $close_button->SetDefault; | ||
| 230 | |||
| 231 | my $bSizer6 = Wx::BoxSizer->new(Wx::VERTICAL); | ||
| 232 | $bSizer6->Add( $self->{relation_title}, 0, Wx::ALL, 5 ); | ||
| 233 | $bSizer6->Add( $self->{display_cardinality}, 0, Wx::ALL, 5 ); | ||
| 234 | |||
| 235 | my $bSizer1 = Wx::BoxSizer->new(Wx::HORIZONTAL); | ||
| 236 | $bSizer1->Add( $self->{package_name}, 0, Wx::ALL, 5 ); | ||
| 237 | $bSizer1->Add( 0, 0, 1, Wx::EXPAND, 5 ); | ||
| 238 | $bSizer1->Add( $bSizer6, 1, Wx::EXPAND, 5 ); | ||
| 239 | $bSizer1->Add( 0, 0, 1, Wx::EXPAND, 5 ); | ||
| 240 | $bSizer1->Add( $self->{about}, 0, Wx::ALL, 5 ); | ||
| 241 | |||
| 242 | my $bSizer5 = Wx::BoxSizer->new(Wx::HORIZONTAL); | ||
| 243 | $bSizer5->Add( $self->{list_ctrl}, 1, Wx::ALL | Wx::EXPAND, 3 ); | ||
| 244 | |||
| 245 | my $fgSizer2 = Wx::FlexGridSizer->new( 0, 2, 0, 0 ); | ||
| 246 | $fgSizer2->SetFlexibleDirection(Wx::BOTH); | ||
| 247 | $fgSizer2->SetNonFlexibleGrowMode(Wx::FLEX_GROWMODE_SPECIFIED); | ||
| 248 | $fgSizer2->Add( $self->{m_staticText5}, 0, Wx::ALL, 5 ); | ||
| 249 | $fgSizer2->Add( $self->{relations}, 0, Wx::ALL, 5 ); | ||
| 250 | |||
| 251 | my $buttons = Wx::BoxSizer->new(Wx::HORIZONTAL); | ||
| 252 | $buttons->Add( $self->{update}, 0, Wx::ALL, 5 ); | ||
| 253 | $buttons->Add( 0, 0, 1, Wx::EXPAND, 5 ); | ||
| 254 | $buttons->Add( $self->{show}, 0, Wx::ALL, 5 ); | ||
| 255 | $buttons->Add( 0, 0, 1, Wx::EXPAND, 5 ); | ||
| 256 | $buttons->Add( $self->{clean}, 0, Wx::ALL, 5 ); | ||
| 257 | $buttons->Add( 0, 0, 1, Wx::EXPAND, 5 ); | ||
| 258 | $buttons->Add( $self->{width_adjust}, 0, Wx::ALL, 5 ); | ||
| 259 | $buttons->Add( 0, 0, 1, Wx::EXPAND, 5 ); | ||
| 260 | $buttons->Add( $close_button, 0, Wx::ALL, 5 ); | ||
| 261 | |||
| 262 | my $vsizer = Wx::BoxSizer->new(Wx::VERTICAL); | ||
| 263 | $vsizer->Add( $bSizer1, 0, Wx::EXPAND, 3 ); | ||
| 264 | $vsizer->Add( $self->{m_staticline1_1}, 0, Wx::EXPAND | Wx::ALL, 1 ); | ||
| 265 | $vsizer->Add( $bSizer5, 1, Wx::ALL | Wx::EXPAND, 1 ); | ||
| 266 | $vsizer->Add( $m_staticline1_2, 0, Wx::ALL | Wx::EXPAND, 1 ); | ||
| 267 | $vsizer->Add( $fgSizer2, 0, Wx::ALL | Wx::EXPAND, 3 ); | ||
| 268 | $vsizer->Add( $self->{m_staticline1_3}, 0, Wx::EXPAND | Wx::ALL, 1 ); | ||
| 269 | $vsizer->Add( $buttons, 0, Wx::EXPAND, 3 ); | ||
| 270 | |||
| 271 | my $sizer = Wx::BoxSizer->new(Wx::HORIZONTAL); | ||
| 272 | $sizer->Add( $vsizer, 1, Wx::ALL, 1 ); | ||
| 273 | |||
| 274 | $self->SetSizerAndFit($sizer); | ||
| 275 | $self->Layout; | ||
| 276 | |||
| 277 | return $self; | ||
| 278 | } | ||
| 279 | |||
| 280 | sub package_name { | ||
| 281 | $_[0]->{package_name}; | ||
| 282 | } | ||
| 283 | |||
| 284 | sub relation_title { | ||
| 285 | $_[0]->{relation_title}; | ||
| 286 | } | ||
| 287 | |||
| 288 | sub display_cardinality { | ||
| 289 | $_[0]->{display_cardinality}; | ||
| 290 | } | ||
| 291 | |||
| 292 | sub list_ctrl { | ||
| 293 | $_[0]->{list_ctrl}; | ||
| 294 | } | ||
| 295 | |||
| 296 | sub relations { | ||
| 297 | $_[0]->{relations}; | ||
| 298 | } | ||
| 299 | |||
| 300 | sub show { | ||
| 301 | $_[0]->{show}; | ||
| 302 | } | ||
| 303 | |||
| 304 | sub clean { | ||
| 305 | $_[0]->{clean}; | ||
| 306 | } | ||
| 307 | |||
| 308 | sub width_adjust { | ||
| 309 | $_[0]->{width_adjust}; | ||
| 310 | } | ||
| 311 | |||
| 312 | sub about_clicked { | ||
| 313 | $_[0]->main->error('Handler method about_clicked for event about.OnButtonClick not implemented'); | ||
| 314 | } | ||
| 315 | |||
| 316 | sub _on_list_col_clicked { | ||
| 317 | $_[0]->main->error('Handler method _on_list_col_clicked for event list_ctrl.OnListColClick not implemented'); | ||
| 318 | } | ||
| 319 | |||
| 320 | sub _on_list_item_activated { | ||
| 321 | $_[0]->main->error('Handler method _on_list_item_activated for event list_ctrl.OnListItemActivated not implemented'); | ||
| 322 | } | ||
| 323 | |||
| 324 | sub update_clicked { | ||
| 325 | $_[0]->main->error('Handler method update_clicked for event update.OnButtonClick not implemented'); | ||
| 326 | } | ||
| 327 | |||
| 328 | sub show_clicked { | ||
| 329 | $_[0]->main->error('Handler method show_clicked for event show.OnButtonClick not implemented'); | ||
| 330 | } | ||
| 331 | |||
| 332 | sub clean_clicked { | ||
| 333 | $_[0]->main->error('Handler method clean_clicked for event clean.OnButtonClick not implemented'); | ||
| 334 | } | ||
| 335 | |||
| 336 | sub width_adjust_clicked { | ||
| 337 | $_[0]->main->error('Handler method width_adjust_clicked for event width_adjust.OnButtonClick not implemented'); | ||
| 338 | } | ||
| 339 | |||
| 340 | 1; | ||
| 341 | |||
| 342 | # Copyright 2008-2013 The Padre development team as listed in Padre.pm. | ||
| 343 | # LICENSE | ||
| 344 | # This program is free software; you can redistribute it and/or | ||
| 345 | # modify it under the same terms as Perl 5 itself. | ||
| 346 | |||