Changeset 468
- Timestamp:
- 10/26/08 01:06:48 (3 years ago)
- Location:
- trunk/lib/Padre/Wx
- Files:
-
- 13 edited
-
Editor.pm (modified) (1 diff)
-
GoToLine.pm (modified) (2 diffs)
-
History/TextDialog.pm (modified) (1 diff)
-
MainWindow.pm (modified) (18 diffs)
-
Menu.pm (modified) (29 diffs)
-
Menu/Help.pm (modified) (1 diff)
-
ModuleStartDialog.pm (modified) (2 diffs)
-
Output.pm (modified) (1 diff)
-
Popup.pm (modified) (3 diffs)
-
Preferences.pm (modified) (3 diffs)
-
Project.pm (modified) (9 diffs)
-
RightClick.pm (modified) (2 diffs)
-
ToolBar.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Padre/Wx/Editor.pm
r467 r468 5 5 use warnings; 6 6 7 our $VERSION = '0.12'; 7 use Wx::STC; 8 use Padre::Wx; 8 9 9 use Wx::STC;10 10 use base 'Wx::StyledTextCtrl'; 11 11 12 use Padre::Wx;12 our $VERSION = '0.12'; 13 13 14 14 sub new { -
trunk/lib/Padre/Wx/GoToLine.pm
r433 r468 7 7 # GoTo Line widget of Padre 8 8 9 use Wx qw(wxID_CANCEL);9 use Padre::Wx (); 10 10 11 11 our $VERSION = '0.12'; … … 16 16 17 17 my $dialog = Wx::TextEntryDialog->new( $self, "Line number:", "", '' ); 18 if ($dialog->ShowModal == wxID_CANCEL) {18 if ($dialog->ShowModal == Wx::wxID_CANCEL) { 19 19 return; 20 20 } -
trunk/lib/Padre/Wx/History/TextDialog.pm
r433 r468 4 4 use strict; 5 5 use warnings; 6 6 7 use Padre::DB (); 7 use Wx (); 8 use Padre::Wx (); 9 8 10 use Class::Adapter::Builder 9 11 ISA => 'Wx::TextEntryDialog', -
trunk/lib/Padre/Wx/MainWindow.pm
r463 r468 13 13 use List::Util (); 14 14 use Params::Util (); 15 use Wx qw(16 WXK_TAB wxDEFAULT_FRAME_STYLE wxMAXIMIZE wxNO_FULL_REPAINT_ON_RESIZE wxCLIP_CHILDREN17 wxLC_SINGLE_SEL wxLC_NO_HEADER wxLC_REPORT wxLIST_AUTOSIZE wxTE_READONLY wxTE_MULTILINE18 wxOK wxCENTRE wxFD_OPEN wxID_CANCEL wxFD_SAVE wxYES_NO wxYES wxCANCEL wxNO19 wxSTC_STYLE_LINENUMBER wxSTC_MARGIN_NUMBER20 );21 use Wx::Event qw(22 EVT_LIST_ITEM_ACTIVATED EVT_NOTEBOOK_PAGE_CHANGED EVT_KEY_UP EVT_CLOSE23 EVT_STC_UPDATEUI EVT_STC_CHANGE EVT_STC_STYLENEEDED24 );25 26 use base qw{Wx::Frame};27 15 28 16 use Padre::Util (); … … 31 19 use Padre::Wx::ToolBar (); 32 20 use Padre::Wx::Output (); 21 22 use base qw{Wx::Frame}; 33 23 34 24 our $VERSION = '0.12'; … … 124 114 $self->{rightbar}->InsertColumn(0, 'Methods'); 125 115 $self->{rightbar}->SetColumnWidth(0, Wx::wxLIST_AUTOSIZE); 126 EVT_LIST_ITEM_ACTIVATED(116 Wx::Event::EVT_LIST_ITEM_ACTIVATED( 127 117 $self, 128 118 $self->{rightbar}, … … 138 128 Wx::wxNO_FULL_REPAINT_ON_RESIZE | Wx::wxCLIP_CHILDREN, 139 129 ); 140 EVT_NOTEBOOK_PAGE_CHANGED(130 Wx::Event::EVT_NOTEBOOK_PAGE_CHANGED( 141 131 $self, 142 132 $self->{notebook}, … … 160 150 161 151 # Special Key Handling 162 EVT_KEY_UP( $self, sub {152 Wx::Event::EVT_KEY_UP( $self, sub { 163 153 my ($self, $event) = @_; 164 154 $self->refresh_status; … … 168 158 if ( $mod == 2 ) { # Ctrl 169 159 # Ctrl-TAB #TODO it is already in the menu 170 $self->on_next_pane if $code == W XK_TAB;160 $self->on_next_pane if $code == Wx::WXK_TAB; 171 161 } elsif ( $mod == 6 ) { # Ctrl-Shift 172 162 # Ctrl-Shift-TAB #TODO it is already in the menu 173 $self->on_prev_pane if $code == W XK_TAB;163 $self->on_prev_pane if $code == Wx::WXK_TAB; 174 164 } 175 165 return; … … 177 167 178 168 # Deal with someone closing the window 179 EVT_CLOSE( $self, \&on_close_window);180 181 EVT_STC_UPDATEUI( $self, -1, \&Padre::Wx::Editor::on_stc_update_ui );182 EVT_STC_CHANGE( $self, -1, \&Padre::Wx::Editor::on_stc_change );183 EVT_STC_STYLENEEDED( $self, -1, \&Padre::Wx::Editor::on_stc_style_needed );169 Wx::Event::EVT_CLOSE( $self, \&on_close_window); 170 171 Wx::Event::EVT_STC_UPDATEUI( $self, -1, \&Padre::Wx::Editor::on_stc_update_ui ); 172 Wx::Event::EVT_STC_CHANGE( $self, -1, \&Padre::Wx::Editor::on_stc_change ); 173 Wx::Event::EVT_STC_STYLENEEDED( $self, -1, \&Padre::Wx::Editor::on_stc_style_needed ); 184 174 185 175 # As ugly as the WxPerl icon is, the new file toolbar image is uglier … … 564 554 my $pos1 = $page->GetCurrentPos; 565 555 my $pos2 = $page->BraceMatch($pos1); 566 if ($pos2 != -1 ) { # wxSTC_INVALID_POSITION556 if ($pos2 != -1 ) { #Wx::wxSTC_INVALID_POSITION 567 557 #print "$pos1 $pos2\n"; 568 558 #$page->BraceHighlight($pos1, $pos2); … … 626 616 my ( $length, @words ) = $doc->autocomplete; 627 617 if ( $length =~ /\D/ ) { 628 Wx::MessageBox($length, "Autocompletions error", wxOK);618 Wx::MessageBox($length, "Autocompletions error", Wx::wxOK); 629 619 } 630 620 if ( @words ) { … … 772 762 my $selection = $self->selected_text(); 773 763 if (not $selection) { 774 Wx::MessageBox("Need to have something selected", "Open Selection", wxOK, $self);764 Wx::MessageBox("Need to have something selected", "Open Selection", Wx::wxOK, $self); 775 765 return; 776 766 } … … 809 799 810 800 if (not $file) { 811 Wx::MessageBox("Could not find file '$selection'", "Open Selection", wxOK, $self);801 Wx::MessageBox("Could not find file '$selection'", "Open Selection", Wx::wxOK, $self); 812 802 return; 813 803 } … … 831 821 "", 832 822 "*.*", 833 wxFD_OPEN,823 Wx::wxFD_OPEN, 834 824 ); 835 825 unless ( Padre::Util::WIN32 ) { 836 826 $dialog->SetWildcard("*"); 837 827 } 838 if ( $dialog->ShowModal == wxID_CANCEL ) {828 if ( $dialog->ShowModal == Wx::wxID_CANCEL ) { 839 829 return; 840 830 } … … 874 864 "", 875 865 "*.*", 876 wxFD_SAVE,866 Wx::wxFD_SAVE, 877 867 ); 878 if ( $dialog->ShowModal == wxID_CANCEL ) {868 if ( $dialog->ShowModal == Wx::wxID_CANCEL ) { 879 869 return 0; 880 870 } … … 886 876 "File already exists. Overwrite it?", 887 877 "Exist", 888 wxYES_NO,878 Wx::wxYES_NO, 889 879 $self, 890 880 ); 891 if ( $res == wxYES ) {881 if ( $res == Wx::wxYES ) { 892 882 $doc->_set_filename($path); 893 883 $doc->set_newline_type(Padre::Util::NEWLINE); … … 952 942 }; 953 943 if ($@) { 954 Wx::MessageBox("Could not save: $!", "Error", wxOK, $self);944 Wx::MessageBox("Could not save: $!", "Error", Wx::wxOK, $self); 955 945 return; 956 946 } … … 980 970 "File changed. Do you want to save it?", 981 971 $doc->filename || "Unsaved File", 982 wxYES_NO|wxCANCEL|wxCENTRE,972 Wx::wxYES_NO|Wx::wxCANCEL|Wx::wxCENTRE, 983 973 $self, 984 974 ); 985 if ( $ret == wxYES ) {975 if ( $ret == Wx::wxYES ) { 986 976 $self->on_save( $doc ); 987 } elsif ( $ret == wxNO ) {977 } elsif ( $ret == Wx::wxNO ) { 988 978 # just close it 989 979 } else { 990 # wxCANCEL, or when clicking on [x]980 # Wx::wxCANCEL, or when clicking on [x] 991 981 return 0; 992 982 } … … 1176 1166 if ($on) { 1177 1167 my $n = 1 + List::Util::max (2, length ($editor->GetLineCount * 2)); 1178 my $width = $n * $editor->TextWidth( wxSTC_STYLE_LINENUMBER, "9"); # width of a single character1168 my $width = $n * $editor->TextWidth(Wx::wxSTC_STYLE_LINENUMBER, "9"); # width of a single character 1179 1169 $editor->SetMarginWidth(0, $width); 1180 $editor->SetMarginType(0, wxSTC_MARGIN_NUMBER);1170 $editor->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 1181 1171 } else { 1182 1172 $editor->SetMarginWidth(0, 0); 1183 $editor->SetMarginType(0, wxSTC_MARGIN_NUMBER);1173 $editor->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 1184 1174 } 1185 1175 … … 1222 1212 eval $code; 1223 1213 if ( $@ ) { 1224 Wx::MessageBox("Error: $@", "Self error", wxOK, $self);1214 Wx::MessageBox("Error: $@", "Self error", Wx::wxOK, $self); 1225 1215 return; 1226 1216 } -
trunk/lib/Padre/Wx/Menu.pm
r457 r468 4 4 use strict; 5 5 use warnings; 6 use Params::Util qw{_INSTANCE}; 7 8 use Padre::Wx (); 6 9 use Padre::Util (); 7 use Params::Util qw{_INSTANCE};8 use Wx qw( wxID_NEW wxID_CLOSE wxID_SAVEAS wxID_EXIT wxID_UNDO wxID_REDO9 wxID_FIND wxID_HELP wxID_ABOUT wxOK wxID_CANCEL wxID_OPEN wxID_SAVE);10 use Wx::Event qw(EVT_MENU);11 10 12 11 our $VERSION = '0.12'; … … 34 33 35 34 # Opening and closing files 36 EVT_MENU( $win,35 Wx::Event::EVT_MENU( $win, 37 36 $menu->{file}->Append( Wx::wxID_NEW, '' ), 38 37 sub { … … 41 40 }, 42 41 ); 43 EVT_MENU( $win,42 Wx::Event::EVT_MENU( $win, 44 43 $menu->{file}->Append( Wx::wxID_OPEN, '' ), 45 44 sub { $_[0]->on_open }, 46 45 ); 47 EVT_MENU( $win,46 Wx::Event::EVT_MENU( $win, 48 47 $menu->{file}->Append( -1, "Open Selection\tCtrl-Shift-O" ), 49 48 sub { $_[0]->on_open_selection }, 50 49 ); 51 EVT_MENU( $win,50 Wx::Event::EVT_MENU( $win, 52 51 $menu->{file}->Append( Wx::wxID_CLOSE, '' ), 53 52 sub { $_[0]->close }, 54 53 ); 55 EVT_MENU( $win,54 Wx::Event::EVT_MENU( $win, 56 55 $menu->{file}->Append( -1, 'Close All' ), 57 56 sub { $_[0]->on_close_all }, … … 60 59 61 60 # Saving 62 EVT_MENU( $win,61 Wx::Event::EVT_MENU( $win, 63 62 $menu->{file}->Append( Wx::wxID_SAVE, '' ), 64 63 sub { $_[0]->on_save }, 65 64 ); 66 EVT_MENU( $win,65 Wx::Event::EVT_MENU( $win, 67 66 $menu->{file}->Append( Wx::wxID_SAVEAS, '' ), 68 67 sub { $_[0]->on_save_as }, 69 68 ); 70 EVT_MENU( $win,69 Wx::Event::EVT_MENU( $win, 71 70 $menu->{file}->Append( -1, 'Save All' ), 72 71 sub { $_[0]->on_save_all }, … … 77 76 $menu->{file_convert} = Wx::Menu->new; 78 77 $menu->{file}->Append( -1, "Convert...", $menu->{file_convert} ); 79 EVT_MENU( $win,78 Wx::Event::EVT_MENU( $win, 80 79 $menu->{file_convert}->Append(-1, "EOL to Windows"), 81 80 sub { $_[0]->convert_to("WIN") }, 82 81 ); 83 EVT_MENU( $win,82 Wx::Event::EVT_MENU( $win, 84 83 $menu->{file_convert}->Append(-1, "EOL to Unix"), 85 84 sub { $_[0]->convert_to("UNIX") }, 86 85 ); 87 EVT_MENU( $win,86 Wx::Event::EVT_MENU( $win, 88 87 $menu->{file_convert}->Append(-1, "EOL to Mac"), 89 88 sub { $_[0]->convert_to("MAC") }, … … 96 95 foreach my $f ( Padre::DB->get_recent_files ) { 97 96 next unless -f $f; 98 EVT_MENU( $win,97 Wx::Event::EVT_MENU( $win, 99 98 $menu->{file_recentfiles}->Append(-1, $f), 100 99 sub { … … 115 114 116 115 # Module::Start 117 EVT_MENU( $win,116 Wx::Event::EVT_MENU( $win, 118 117 $menu->{file}->Append( -1, 'Start Module' ), 119 118 \&Padre::Wx::ModuleStartDialog::on_start, … … 123 122 124 123 # Exiting 125 EVT_MENU( $win,124 Wx::Event::EVT_MENU( $win, 126 125 $menu->{file}->Append( Wx::wxID_EXIT, '' ), 127 126 sub { $_[0]->Close }, … … 136 135 137 136 # Undo/Redo 138 EVT_MENU( $win, # Ctrl-Z137 Wx::Event::EVT_MENU( $win, # Ctrl-Z 139 138 $menu->{edit}->Append( Wx::wxID_UNDO, '' ), 140 139 sub { … … 146 145 }, 147 146 ); 148 EVT_MENU( $win, # Ctrl-Y147 Wx::Event::EVT_MENU( $win, # Ctrl-Y 149 148 $menu->{edit}->Append( Wx::wxID_REDO, '' ), 150 149 sub { … … 159 158 160 159 # Random shit that doesn't fit anywhere better yet 161 EVT_MENU( $win,160 Wx::Event::EVT_MENU( $win, 162 161 $menu->{edit}->Append( Wx::wxID_FIND, '' ), 163 162 \&Padre::Wx::FindDialog::on_find, 164 163 ); 165 EVT_MENU( $win,164 Wx::Event::EVT_MENU( $win, 166 165 $menu->{edit}->Append( -1, "&Find Next\tF3" ), 167 166 \&Padre::Wx::FindDialog::on_find_next, 168 167 ); 169 EVT_MENU( $win,168 Wx::Event::EVT_MENU( $win, 170 169 $menu->{edit}->Append( -1, "Find Previous\tShift-F3" ), 171 170 \&Padre::Wx::FindDialog::on_find_previous, 172 171 ); 173 EVT_MENU( $win,172 Wx::Event::EVT_MENU( $win, 174 173 $menu->{edit}->Append( -1, "Ac&k" ), 175 174 \&Padre::Wx::Ack::on_ack, 176 175 ); 177 EVT_MENU( $win,176 Wx::Event::EVT_MENU( $win, 178 177 $menu->{edit}->Append( -1, "&Goto\tCtrl-G" ), 179 178 \&Padre::Wx::GoToLine::on_goto, 180 179 ); 181 EVT_MENU( $win,180 Wx::Event::EVT_MENU( $win, 182 181 $menu->{edit}->Append( -1, "&AutoComp\tCtrl-P" ), 183 182 \&Padre::Wx::MainWindow::on_autocompletition, 184 183 ); 185 EVT_MENU( $win,184 Wx::Event::EVT_MENU( $win, 186 185 $menu->{edit}->Append( -1, "Subs\tAlt-S" ), 187 186 sub { $_[0]->{rightbar}->SetFocus }, 188 187 ); 189 EVT_MENU( $win,188 Wx::Event::EVT_MENU( $win, 190 189 $menu->{edit}->Append( -1, "&Brace matching\tCtrl-1" ), 191 190 \&Padre::Wx::MainWindow::on_brace_matching, … … 194 193 195 194 # User Preferences 196 EVT_MENU( $win,195 Wx::Event::EVT_MENU( $win, 197 196 $menu->{edit}->Append( -1, "&Preferences" ), 198 197 \&Padre::Wx::MainWindow::on_preferences, … … 206 205 $menu->{view} = Wx::Menu->new; 207 206 $menu->{view_lines} = $menu->{view}->AppendCheckItem( -1, "Show Line numbers" ); 208 EVT_MENU( $win,207 Wx::Event::EVT_MENU( $win, 209 208 $menu->{view_lines}, 210 209 \&Padre::Wx::MainWindow::on_toggle_line_numbers, 211 210 ); 212 211 $menu->{view_eol} = $menu->{view}->AppendCheckItem( -1, "Show Newlines" ); 213 EVT_MENU( $win,212 Wx::Event::EVT_MENU( $win, 214 213 $menu->{view_eol}, 215 214 \&Padre::Wx::MainWindow::on_toggle_eol, 216 215 ); 217 216 $menu->{view_output} = $menu->{view}->AppendCheckItem( -1, "Show Output" ); 218 EVT_MENU( $win,217 Wx::Event::EVT_MENU( $win, 219 218 $menu->{view_output}, 220 219 sub { … … 227 226 # On Windows disabling the status bar is broken, so don't allow it 228 227 $menu->{view_statusbar} = $menu->{view}->AppendCheckItem( -1, "Show StatusBar" ); 229 EVT_MENU( $win,228 Wx::Event::EVT_MENU( $win, 230 229 $menu->{view_statusbar}, 231 230 \&Padre::Wx::MainWindow::on_toggle_status_bar, … … 233 232 } 234 233 $menu->{view_indentation_guide} = $menu->{view}->AppendCheckItem( -1, "Show Indentation Guide" ); 235 EVT_MENU( $win,234 Wx::Event::EVT_MENU( $win, 236 235 $menu->{view_indentation_guide}, 237 236 \&Padre::Wx::MainWindow::on_toggle_indentation_guide, 238 237 ); 239 238 $menu->{view_show_calltips} = $menu->{view}->AppendCheckItem( -1, "Show Call Tips" ); 240 EVT_MENU( $win,239 Wx::Event::EVT_MENU( $win, 241 240 $menu->{view_show_calltips}, 242 241 sub { $config->{editor_calltips} = $menu->{view_show_calltips}->IsChecked }, … … 244 243 $menu->{view}->AppendSeparator; 245 244 246 EVT_MENU( $win,245 Wx::Event::EVT_MENU( $win, 247 246 $menu->{view}->Append( -1, "Increase Font Size\tCtrl--" ), 248 247 sub { $_[0]->zoom(+1) }, 249 248 ); 250 EVT_MENU( $win,249 Wx::Event::EVT_MENU( $win, 251 250 $menu->{view}->Append( -1, "Decrease Font Size\tCtrl-+" ), 252 251 sub { $_[0]->zoom(-1) }, 253 252 ); 254 EVT_MENU( $win,253 Wx::Event::EVT_MENU( $win, 255 254 $menu->{view}->Append( -1, "Reset Font Size\tCtrl-/" ), 256 255 sub { $_[0]->zoom( -1 * $_[0]->selected_editor->GetZoom ) }, … … 258 257 259 258 $menu->{view}->AppendSeparator; 260 EVT_MENU( $win,259 Wx::Event::EVT_MENU( $win, 261 260 $menu->{view}->Append( -1, "Set Bookmark\tCtrl-B" ), 262 261 sub { Padre::Wx::Bookmarks::on_set_bookmark($_[0]) }, 263 262 ); 264 EVT_MENU( $win,263 Wx::Event::EVT_MENU( $win, 265 264 $menu->{view}->Append( -1, "Goto Bookmark\tCtrl-Shift-B" ), 266 265 sub { Padre::Wx::Bookmarks::on_goto_bookmark($_[0]) }, … … 275 274 # Perl-Specific Searches 276 275 $menu->{perl_find_unmatched} = $menu->{perl}->Append( -1, "Find Unmatched Brace" ); 277 EVT_MENU( $win,276 Wx::Event::EVT_MENU( $win, 278 277 $menu->{perl_find_unmatched}, 279 278 sub { … … 303 302 # Script Execution 304 303 $menu->{perl_run_script} = $menu->{perl}->Append( -1, "Run Script\tF5" ); 305 EVT_MENU( $win,304 Wx::Event::EVT_MENU( $win, 306 305 $menu->{perl_run_script}, 307 306 sub { $_[0]->run_perl }, 308 307 ); 309 308 $menu->{perl_run_command} = $menu->{perl}->Append( -1, "Run Command\tCtrl-F5" ); 310 EVT_MENU( $win,309 Wx::Event::EVT_MENU( $win, 311 310 $menu->{perl_run_command}, 312 311 sub { … … 333 332 ); 334 333 $menu->{perl_stop} = $menu->{perl}->Append( -1, "&Stop" ); 335 EVT_MENU( $win,334 Wx::Event::EVT_MENU( $win, 336 335 $menu->{perl_stop}, 337 336 sub { … … 346 345 347 346 # Commenting 348 EVT_MENU( $win,347 Wx::Event::EVT_MENU( $win, 349 348 $menu->{perl}->Append( -1, "&Comment Selected Lines\tCtrl-M" ), 350 349 \&Padre::Wx::MainWindow::on_comment_out_block, 351 350 ); 352 EVT_MENU( $win,351 Wx::Event::EVT_MENU( $win, 353 352 $menu->{perl}->Append( -1, "&Uncomment Selected Lines\tCtrl-Shift-M" ), 354 353 \&Padre::Wx::MainWindow::on_uncomment_block, … … 379 378 $menu->{window} = Wx::Menu->new; 380 379 if ( $experimental ) { 381 EVT_MENU( $win,380 Wx::Event::EVT_MENU( $win, 382 381 $menu->{window}->Append( -1, "&Split window" ), 383 382 \&Padre::Wx::MainWindow::on_split_window, … … 385 384 $menu->{window}->AppendSeparator; 386 385 } 387 EVT_MENU( $win,386 Wx::Event::EVT_MENU( $win, 388 387 $menu->{window}->Append(-1, "Next File\tCtrl-TAB"), 389 388 \&Padre::Wx::MainWindow::on_next_pane, 390 389 ); 391 EVT_MENU( $win,390 Wx::Event::EVT_MENU( $win, 392 391 $menu->{window}->Append(-1, "Previous File\tCtrl-Shift-TAB"), 393 392 \&Padre::Wx::MainWindow::on_prev_pane, … … 403 402 my $help = Padre::Wx::Menu::Help->new; 404 403 405 EVT_MENU( $win,404 Wx::Event::EVT_MENU( $win, 406 405 $menu->{help}->Append( Wx::wxID_HELP, '' ), 407 406 sub { $help->help($win) }, 408 407 ); 409 EVT_MENU( $win,408 Wx::Event::EVT_MENU( $win, 410 409 $menu->{help}->Append( -1, "Context Help\tCtrl-Shift-H" ), 411 410 sub { … … 420 419 ); 421 420 $menu->{help}->AppendSeparator; 422 EVT_MENU( $win,421 Wx::Event::EVT_MENU( $win, 423 422 $menu->{help}->Append( Wx::wxID_ABOUT, '' ), 424 423 sub { $help->about }, … … 434 433 if ( $experimental ) { 435 434 $menu->{experimental} = Wx::Menu->new; 436 EVT_MENU( $win,435 Wx::Event::EVT_MENU( $win, 437 436 $menu->{experimental}->Append( -1, 'Reflow Menu/Toolbar' ), 438 437 sub { … … 445 444 }, 446 445 ); 447 EVT_MENU(446 Wx::Event::EVT_MENU( 448 447 $win, 449 448 $menu->{experimental}->Append( -1, 'Run in &Padre' ), … … 498 497 $menu->Append(-1, $m->[0], $submenu); 499 498 } else { 500 EVT_MENU( $self->win, $menu->Append(-1, $m->[0]), $m->[1] );499 Wx::Event::EVT_MENU( $self->win, $menu->Append(-1, $m->[0]), $m->[1] ); 501 500 } 502 501 } … … 510 509 511 510 $self->{alt}->[$n] = $self->{window}->Append(-1, ""); 512 EVT_MENU( $self->win, $self->{alt}->[$n], sub { $_[0]->on_nth_pane($n) } );511 Wx::Event::EVT_MENU( $self->win, $self->{alt}->[$n], sub { $_[0]->on_nth_pane($n) } ); 513 512 $self->update_alt_n_menu($file, $n); 514 513 -
trunk/lib/Padre/Wx/Menu/Help.pm
r455 r468 4 4 use strict; 5 5 use warnings; 6 use Wx ();7 6 7 use Padre::Wx (); 8 8 use Padre::Util; 9 9 -
trunk/lib/Padre/Wx/ModuleStartDialog.pm
r454 r468 4 4 use strict; 5 5 use warnings; 6 7 # Module::Start widget of Padre8 9 use Wx qw( wxOK wxID_OK wxID_CANCEL wxVERTICAL wxHORIZONTAL wxEXPAND );10 use Wx::Event qw( EVT_BUTTON EVT_CHECKBOX );11 6 use Data::Dumper qw(Dumper); 12 7 use Cwd (); 8 9 # Module::Start widget of Padre 10 11 use Padre::Wx (); 13 12 14 13 our $VERSION = '0.12'; … … 29 28 30 29 $dialog->{_ok_}->SetDefault; 31 EVT_BUTTON( $dialog, $dialog->{_ok_}, \&ok_clicked );32 EVT_BUTTON( $dialog, $dialog->{_cancel_}, \&cancel_clicked );30 Wx::Event::EVT_BUTTON( $dialog, $dialog->{_ok_}, \&ok_clicked ); 31 Wx::Event::EVT_BUTTON( $dialog, $dialog->{_cancel_}, \&cancel_clicked ); 33 32 34 33 $dialog->{_module_name_}->SetFocus; -
trunk/lib/Padre/Wx/Output.pm
r462 r468 8 8 use strict; 9 9 use warnings; 10 10 11 use Padre::Wx (); 11 12 -
trunk/lib/Padre/Wx/Popup.pm
r456 r468 6 6 #use base 'Wx::PopupTransientWindow'; 7 7 #use base 'Wx::PopupWindow'; 8 use Wx qw(:everything);9 use Wx::Event qw(:everything); 8 use Padre::Wx (); 9 10 10 use base qw(Wx::PlPopupTransientWindow); 11 11 … … 16 16 my( $self, $event ) = @_; 17 17 # my $dc = Wx::PaintDC->new( $self ); 18 # $dc->SetBrush( Wx::Brush->new( Wx::Colour->new( 0, 192, 0 ), wxSOLID ) );19 # $dc->SetPen( Wx::Pen->new( Wx::Colour->new( 0, 0, 0 ), 1, wxSOLID ) );18 # $dc->SetBrush( Wx::Brush->new( Wx::Colour->new( 0, 192, 0 ), Wx::wxSOLID ) ); 19 # $dc->SetPen( Wx::Pen->new( Wx::Colour->new( 0, 0, 0 ), 1, Wx::wxSOLID ) ); 20 20 # $dc->DrawRectangle( 0, 0, $self->GetSize->x, $self->GetSize->y ); 21 21 … … 25 25 my $class = shift; 26 26 my $self = $class->SUPER::new(@_); 27 EVT_PAINT( $self, \&on_paint);27 Wx::Event::EVT_PAINT( $self, \&on_paint); 28 28 29 29 print "xxx $self\n"; -
trunk/lib/Padre/Wx/Preferences.pm
r433 r468 4 4 use strict; 5 5 use warnings; 6 use Wx qw(wxID_OK wxID_CANCEL wxDEFAULT_FRAME_STYLE); 7 use Wx::Event qw(EVT_BUTTON);6 7 use Padre::Wx (); 8 8 9 9 our $VERSION = '0.12'; … … 12 12 my ( $class, $win, $config ) = @_; 13 13 14 my $dialog = Wx::Dialog->new( $win, -1, "Preferences", [-1, -1], [550, 200], wxDEFAULT_FRAME_STYLE);14 my $dialog = Wx::Dialog->new( $win, -1, "Preferences", [-1, -1], [550, 200], Wx::wxDEFAULT_FRAME_STYLE); 15 15 16 16 my $y = 10; … … 44 44 45 45 $y += $HEIGHT; 46 my $ok = Wx::Button->new( $dialog, wxID_OK, '', [10, $y] );47 my $cancel = Wx::Button->new( $dialog, wxID_CANCEL, '', [120, $y], $ok->GetSize );48 EVT_BUTTON( $dialog, $ok, sub { $dialog->EndModal(wxID_OK) } );49 EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(wxID_CANCEL) } );46 my $ok = Wx::Button->new( $dialog, Wx::wxID_OK, '', [10, $y] ); 47 my $cancel = Wx::Button->new( $dialog, Wx::wxID_CANCEL, '', [120, $y], $ok->GetSize ); 48 Wx::Event::EVT_BUTTON( $dialog, $ok, sub { $dialog->EndModal(Wx::wxID_OK) } ); 49 Wx::Event::EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(Wx::wxID_CANCEL) } ); 50 50 $ok->SetDefault; 51 if ($dialog->ShowModal == wxID_CANCEL) {51 if ($dialog->ShowModal == Wx::wxID_CANCEL) { 52 52 return; 53 53 } -
trunk/lib/Padre/Wx/Project.pm
r453 r468 9 9 # Project related widgets of Padre 10 10 11 use Wx qw(wxOK wxID_OK wxID_CANCEL wxVERTICAL wxHORIZONTAL wxALL);11 use Padre::Wx (); 12 12 13 13 our $VERSION = '0.12'; … … 21 21 # set current project 22 22 # run 23 Wx::MessageBox("Not implemented yet", "Not Yes", wxOK, $self);23 Wx::MessageBox("Not implemented yet", "Not Yes", Wx::wxOK, $self); 24 24 25 25 return; … … 29 29 my ($self) = @_; 30 30 31 #Wx::MessageBox("Not implemented yet", "Not Yes", wxOK, $self);31 #Wx::MessageBox("Not implemented yet", "Not Yes", Wx::wxOK, $self); 32 32 #return; 33 33 # popup a window with a list of projects previously selected, … … 40 40 my $dialog = Wx::Dialog->new( $self, -1, "Select Project", [-1, -1], [-1, -1]); 41 41 42 my $box = Wx::BoxSizer->new( wxVERTICAL );43 my $row1 = Wx::BoxSizer->new( wxHORIZONTAL );44 my $row2 = Wx::BoxSizer->new( wxHORIZONTAL );45 my $row3 = Wx::BoxSizer->new( wxHORIZONTAL );46 my $row4 = Wx::BoxSizer->new( wxHORIZONTAL );42 my $box = Wx::BoxSizer->new( Wx::wxVERTICAL ); 43 my $row1 = Wx::BoxSizer->new( Wx::wxHORIZONTAL ); 44 my $row2 = Wx::BoxSizer->new( Wx::wxHORIZONTAL ); 45 my $row3 = Wx::BoxSizer->new( Wx::wxHORIZONTAL ); 46 my $row4 = Wx::BoxSizer->new( Wx::wxHORIZONTAL ); 47 47 48 48 $box->Add($row1); … … 51 51 $box->Add($row4); 52 52 53 $row1->Add( Wx::StaticText->new( $dialog, -1, 'Select Project Name or type in new one'), 1, wxALL, 3 );53 $row1->Add( Wx::StaticText->new( $dialog, -1, 'Select Project Name or type in new one'), 1, Wx::wxALL, 3 ); 54 54 55 55 my @projects = keys %{ $config->{projects} }; 56 56 my $choice = Wx::ComboBox->new( $dialog, -1, '', [-1, -1], [-1, -1], \@projects); 57 $row2->Add( $choice, 1, wxALL, 3);57 $row2->Add( $choice, 1, Wx::wxALL, 3); 58 58 59 59 my $dir_selector = Wx::Button->new( $dialog, -1, 'Select Directory'); 60 $row2->Add($dir_selector, 1, wxALL, 3);60 $row2->Add($dir_selector, 1, Wx::wxALL, 3); 61 61 62 62 my $path = Wx::StaticText->new( $dialog, -1, ''); 63 $row3->Add( $path, 1, wxALL, 3 );63 $row3->Add( $path, 1, Wx::wxALL, 3 ); 64 64 65 65 EVT_BUTTON( $dialog, $dir_selector, sub {on_pick_project_dir($path, @_) } ); … … 72 72 # be local in the development directory and checked in to version control. 73 73 74 my $ok = Wx::Button->new( $dialog, wxID_OK, '');75 my $cancel = Wx::Button->new( $dialog, wxID_CANCEL, '');76 EVT_BUTTON( $dialog, $ok, sub { $dialog->EndModal( wxID_OK) } );77 EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal( wxID_CANCEL) } );78 $row4->Add($cancel, 1, wxALL, 3);79 $row4->Add($ok, 1, wxALL, 3);74 my $ok = Wx::Button->new( $dialog, Wx::wxID_OK, ''); 75 my $cancel = Wx::Button->new( $dialog, Wx::wxID_CANCEL, ''); 76 EVT_BUTTON( $dialog, $ok, sub { $dialog->EndModal(Wx::wxID_OK) } ); 77 EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(Wx::wxID_CANCEL) } ); 78 $row4->Add($cancel, 1, Wx::wxALL, 3); 79 $row4->Add($ok, 1, Wx::wxALL, 3); 80 80 81 81 $dialog->SetSizer($box); 82 82 #$box->SetSizeHints( $self ); 83 83 84 if ($dialog->ShowModal == wxID_CANCEL) {84 if ($dialog->ShowModal == Wx::wxID_CANCEL) { 85 85 return; 86 86 } … … 109 109 # my ($choice, $self, $event) = @_; 110 110 # my $dialog = Wx::TextEntryDialog->new( $self, "Project Name", "", '' ); 111 # if ($dialog->ShowModal == wxID_CANCEL) {111 # if ($dialog->ShowModal == Wx::wxID_CANCEL) { 112 112 # return; 113 113 # } … … 122 122 123 123 my $dialog = Wx::DirDialog->new( $self, "Select Project Directory", $default_dir); 124 if ($dialog->ShowModal == wxID_CANCEL) {124 if ($dialog->ShowModal == Wx::wxID_CANCEL) { 125 125 #print "Cancel\n"; 126 126 return; … … 137 137 sub on_test_project { 138 138 my ($self) = @_; 139 Wx::MessageBox("Not implemented yet", "Not Yes", wxOK, $self);139 Wx::MessageBox("Not implemented yet", "Not Yes", Wx::wxOK, $self); 140 140 } 141 141 -
trunk/lib/Padre/Wx/RightClick.pm
r433 r468 7 7 # Find and Replace widget of Padre 8 8 9 use Wx qw(:everything); 10 use Wx::Event qw(:everything); 9 use Padre::Wx (); 11 10 12 11 our $VERSION = '0.12'; … … 17 16 my @options = qw(abc def); 18 17 my $HEIGHT = 30; 19 my $dialog = Wx::Dialog->new( $self, -1, "", [-1, -1], [100, 50 + $HEIGHT * $#options], wxBORDER_SIMPLE);18 my $dialog = Wx::Dialog->new( $self, -1, "", [-1, -1], [100, 50 + $HEIGHT * $#options], Wx::wxBORDER_SIMPLE); 20 19 #$dialog->; 21 20 foreach my $i (0..@options-1) { 22 EVT_BUTTON( $dialog, Wx::Button->new( $dialog, -1, $options[$i], [10, 10+$HEIGHT*$i] ), sub {on_right(@_, $i)} );21 Wx::Event::EVT_BUTTON( $dialog, Wx::Button->new( $dialog, -1, $options[$i], [10, 10+$HEIGHT*$i] ), sub {on_right(@_, $i)} ); 23 22 } 24 23 my $ret = $dialog->Show; 25 24 #print "ret\n"; 26 #my $pop = Padre::Wx::Popup->new($self); #, wxSIMPLE_BORDER);25 #my $pop = Padre::Wx::Popup->new($self); #, Wx::wxSIMPLE_BORDER); 27 26 #$pop->Move($event->GetPosition()); 28 27 #$pop->SetSize(300, 200); -
trunk/lib/Padre/Wx/ToolBar.pm
r459 r468 4 4 use strict; 5 5 use warnings; 6 use Wx qw( wxNO_BORDER wxTB_HORIZONTAL wxTB_FLAT wxTB_DOCKABLE wxID_NEW wxID_OPEN wxID_SAVE); 6 7 7 use Padre::Wx (); 8 8
Note: See TracChangeset
for help on using the changeset viewer.
