Changeset 10792
- Timestamp:
- 02/14/10 01:03:47 (2 years ago)
- Location:
- trunk/Padre
- Files:
-
- 37 edited
-
lib/Padre.pm (modified) (1 diff)
-
lib/Padre/Action.pm (modified) (1 diff)
-
lib/Padre/Action/Edit.pm (modified) (1 diff)
-
lib/Padre/Action/File.pm (modified) (1 diff)
-
lib/Padre/Config/Upgrade.pm (modified) (1 diff)
-
lib/Padre/Document.pm (modified) (1 diff)
-
lib/Padre/Document/Perl.pm (modified) (2 diffs)
-
lib/Padre/Document/Perl/Help.pm (modified) (1 diff)
-
lib/Padre/Document/Perl/Lexer.pm (modified) (1 diff)
-
lib/Padre/MimeTypes.pm (modified) (1 diff)
-
lib/Padre/PluginManager.pm (modified) (1 diff)
-
lib/Padre/Task/HTTPClient/LWP.pm (modified) (1 diff)
-
lib/Padre/Util.pm (modified) (1 diff)
-
lib/Padre/Wx/Ack.pm (modified) (2 diffs)
-
lib/Padre/Wx/Debugger.pm (modified) (1 diff)
-
lib/Padre/Wx/Debugger/View.pm (modified) (1 diff)
-
lib/Padre/Wx/Dialog/Preferences.pm (modified) (3 diffs)
-
lib/Padre/Wx/Dialog/RegexEditor.pm (modified) (4 diffs)
-
lib/Padre/Wx/Dialog/WindowList.pm (modified) (4 diffs)
-
lib/Padre/Wx/Directory/TreeCtrl.pm (modified) (1 diff)
-
lib/Padre/Wx/Editor.pm (modified) (4 diffs)
-
lib/Padre/Wx/FindResult.pm (modified) (1 diff)
-
lib/Padre/Wx/Main.pm (modified) (13 diffs)
-
lib/Padre/Wx/Menu/File.pm (modified) (4 diffs)
-
lib/Padre/Wx/Menu/Run.pm (modified) (3 diffs)
-
lib/Padre/Wx/Menu/View.pm (modified) (1 diff)
-
lib/Padre/Wx/Menubar.pm (modified) (3 diffs)
-
lib/Padre/Wx/Notebook.pm (modified) (4 diffs)
-
lib/Padre/Wx/Outline.pm (modified) (1 diff)
-
lib/Padre/Wx/Syntax.pm (modified) (1 diff)
-
lib/Padre/Wx/ToolBar.pm (modified) (2 diffs)
-
script/padre (modified) (1 diff)
-
share/examples/absolute_beginner/05_do_it_again.pl (modified) (1 diff)
-
share/examples/absolute_beginner/07_short_salat.pl (modified) (4 diffs)
-
t/94-padre-file-remote.t (modified) (2 diffs)
-
xt/actions.t (modified) (1 diff)
-
xt/mimetype.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre.pm
r10583 r10792 227 227 # Process the action queue 228 228 if ( defined $self->opts->{actionqueue} ) { 229 for my $action ( split( /\,/, $self->opts->{actionqueue} ) ) {229 foreach my $action ( split( /\,/, $self->opts->{actionqueue} ) ) { 230 230 next if $action eq ''; # Skip empty action names 231 231 unless ( defined $self->actions->{$action} ) { -
trunk/Padre/lib/Padre/Action.pm
r10777 r10792 196 196 &{ $self->{event} }(@args); 197 197 } elsif ( ref( $self->{event} ) eq 'ARRAY' ) { 198 for my $item ( @{ $self->{event} } ) {198 foreach my $item ( @{ $self->{event} } ) { 199 199 next if ref($item) ne 'CODE'; # TO DO: Catch error and source (Ticket #666) 200 200 &{$item}(@args); -
trunk/Padre/lib/Padre/Action/Edit.pm
r10470 r10792 280 280 my $text = $event->GetText; 281 281 my $selection; 282 for my $item (@items) {282 foreach my $item (@items) { 283 283 if ( $item->{text} eq $text ) { 284 284 $selection = $item; -
trunk/Padre/lib/Padre/Action/File.pm
r10764 r10792 400 400 comment => Wx::gettext('Remove the entries from the recent files list'), 401 401 menu_event => sub { 402 my $lock = Padre::Current->main->lock('UPDATE', 'DB', 'refresh_recent'); 402 403 Padre::DB::History->delete( 'where type = ?', 'files' ); 403 $self->update_recentfiles;404 404 }, 405 405 ); -
trunk/Padre/lib/Padre/Config/Upgrade.pm
r10436 r10792 38 38 my $self = shift; 39 39 40 for my $storage ( 'human', 'host' ) {40 foreach my $storage ( 'human', 'host' ) { 41 41 42 42 if ( !defined( $self->$storage->{Version} ) ) { -
trunk/Padre/lib/Padre/Document.pm
r10732 r10792 939 939 940 940 # TO DO this is strange, do we really need to do it with all? 941 for my $i ( 0 .. 31 ) {941 foreach my $i ( 0 .. 31 ) { 942 942 $editor->StartStyling( 0, $i ); 943 943 $editor->SetStyling( $editor->GetLength, 0 ); -
trunk/Padre/lib/Padre/Document/Perl.pm
r10782 r10792 722 722 723 723 #print "Name '$name'\n"; 724 for my $i ( 0 .. @lines - 1 ) {724 foreach my $i ( 0 .. @lines - 1 ) { 725 725 726 726 #print "L: $lines[$i]\n"; … … 933 933 { 934 934 935 for my $candidate (935 foreach my $candidate ( 936 936 $self->project_tagsfile, $config->perl_tags_file, 937 937 File::Spec->catfile( $ENV{PADRE_HOME}, 'perltags' ) -
trunk/Padre/lib/Padre/Document/Perl/Help.pm
r10561 r10792 153 153 my %seen; 154 154 require File::Find::Rule; 155 for my $path (@INC) {156 for my $file ( File::Find::Rule->name('*.pm')->in($path) ) {155 foreach my $path (@INC) { 156 foreach my $file ( File::Find::Rule->name('*.pm')->in($path) ) { 157 157 my $module = substr( $file, length($path) + 1 ); 158 158 $module =~ s/.pm$//; -
trunk/Padre/lib/Padre/Document/Perl/Lexer.pm
r10436 r10792 361 361 my $editor = $doc->editor; 362 362 363 for my $i ( 0 .. 31 ) {363 foreach my $i ( 0 .. 31 ) { 364 364 $editor->StartStyling( $styling_start_pos, $i ); 365 365 $editor->SetStyling( $styling_end_pos - $styling_start_pos, 0 ); -
trunk/Padre/lib/Padre/MimeTypes.pm
r10767 r10792 760 760 sub menu_view_mimes { 761 761 my %menu_view_mimes = (); 762 for my $mime_type ( keys %MIME_TYPES ) {762 foreach my $mime_type ( keys %MIME_TYPES ) { 763 763 my $mime_type_name = $MIME_TYPES{$mime_type}{name}; 764 764 if ($mime_type_name) { -
trunk/Padre/lib/Padre/PluginManager.pm
r10681 r10792 741 741 my $event = shift; 742 742 743 for my $module ( keys %{ $self->{plugins} } ) {743 foreach my $module ( keys %{ $self->{plugins} } ) { 744 744 745 745 # TODO: Re-enable the commented out error messages when the failing modules -
trunk/Padre/lib/Padre/Task/HTTPClient/LWP.pm
r10436 r10792 60 60 # content (POST data) and query (GET data) may be passed as hash ref's 61 61 # and they're converted automatically: 62 for my $var ( 'query', 'content' ) {62 foreach my $var ( 'query', 'content' ) { 63 63 next unless ref( $self->{$var} ) eq 'HASH'; 64 64 $self->{$var} = join( -
trunk/Padre/lib/Padre/Util.pm
r10615 r10792 416 416 my $dir = $olddir; 417 417 while (1) { 418 for my $testfilename ( 'Makefile.PL', 'Build.PL', 'dist.ini', 'padre.yml' ) {418 foreach my $testfilename ( 'Makefile.PL', 'Build.PL', 'dist.ini', 'padre.yml' ) { 419 419 next unless -e File::Spec->catfile( $dir, $testfilename ); 420 420 -
trunk/Padre/lib/Padre/Wx/Ack.pm
r10436 r10792 227 227 my $is_regex = 1; 228 228 my $wanted = ( $file_types =~ s/^no// ) ? 0 : 1; 229 for my $i ( App::Ack::filetypes_supported() ) {229 foreach my $i ( App::Ack::filetypes_supported() ) { 230 230 if ( $i eq $file_types ) { 231 231 $App::Ack::type_wanted{$i} = $wanted; … … 525 525 # see t/module.t in ack distro 526 526 sub fill_type_wanted { 527 for my $i ( App::Ack::filetypes_supported() ) {527 foreach my $i ( App::Ack::filetypes_supported() ) { 528 528 $App::Ack::type_wanted{$i} = undef; 529 529 } -
trunk/Padre/lib/Padre/Wx/Debugger.pm
r10776 r10792 163 163 my $debugger = $main->debugger; 164 164 my $count = $debugger->GetItemCount; 165 for my $c ( 0 .. $count - 1 ) {165 foreach my $c ( 0 .. $count - 1 ) { 166 166 my $variable = $debugger->GetItemText($c); 167 167 -
trunk/Padre/lib/Padre/Wx/Debugger/View.pm
r10436 r10792 110 110 my $self = shift; 111 111 112 for my $i ( 0 .. 1 ) {112 foreach my $i ( 0 .. 1 ) { 113 113 my $col = $self->GetColumn($i); 114 114 $col->SetText( _get_title($i) ); -
trunk/Padre/lib/Padre/Wx/Dialog/Preferences.pm
r10681 r10792 797 797 # TO DO: Convert the internal panels to use this 798 798 799 for my $module ( sort { Wx::gettext( $PANELS{$a} ) cmp Wx::gettext( $PANELS{$b} ); } ( keys(%PANELS) ) ) {799 foreach my $module ( sort { Wx::gettext( $PANELS{$a} ) cmp Wx::gettext( $PANELS{$b} ); } ( keys(%PANELS) ) ) { 800 800 801 801 # A plugin or panel should not crash Padre on error … … 1134 1134 if ( $config->feature_config ) { 1135 1135 1136 for my $feature (@Func_List) {1136 foreach my $feature (@Func_List) { 1137 1137 $config->set( 1138 1138 'feature_' . $feature->[0], … … 1172 1172 ); 1173 1173 1174 for my $module ( keys(%PANELS) ) {1174 foreach my $module ( keys(%PANELS) ) { 1175 1175 my $preferences_page = $module->new(); 1176 1176 $preferences_page->save($data); -
trunk/Padre/lib/Padre/Wx/Dialog/RegexEditor.pm
r10621 r10792 395 395 $level = 0 unless $level; 396 396 my @children = $parent->isa('PPIx::Regexp::Node') ? $parent->children : (); 397 for my $child (@children) {397 foreach my $child (@children) { 398 398 next if $child->content eq ''; 399 399 my $class_name = $child->class; … … 413 413 @array = () unless @array; 414 414 my @elements = $parent->isa('PPIx::Regexp::Node') ? $parent->elements : (); 415 for my $element (@elements) {415 foreach my $element (@elements) { 416 416 my $content = $element->content; 417 417 next if $content eq ''; … … 492 492 my @chars = split( //, $original_text ); 493 493 my $pos = 0; 494 for my $char (@chars) {494 foreach my $char (@chars) { 495 495 if ( $pos == $match_start ) { 496 496 $self->{matched_text}->BeginTextColour(Wx::wxRED); … … 527 527 # $self->{regex}->Clear; 528 528 # my @elements = _parse_regex_elements; 529 # for my $element (@elements) {529 # foreach my $element (@elements) { 530 530 # my $class_name = $element->element->class; 531 531 # if ($class_name eq 'PPIx::Regexp::Token::CharClass::Simple') { -
trunk/Padre/lib/Padre/Wx/Dialog/WindowList.pm
r10744 r10792 91 91 my @pages; 92 92 93 for my $listitem ( 0 .. ( $self->_list->GetItemCount - 1 ) ) {93 foreach my $listitem ( 0 .. ( $self->_list->GetItemCount - 1 ) ) { 94 94 my $item = $self->{items}->[ $self->_list->GetItem($listitem)->GetData ]; 95 95 next unless $item->{selected}; … … 273 273 Wx::Event::EVT_BUTTON( $self, $bc, \&_on_butclose_clicked ); 274 274 275 for my $button_no ( 0 .. $#{ $self->{buttons} || [] } ) {275 foreach my $button_no ( 0 .. $#{ $self->{buttons} || [] } ) { 276 276 if ( !defined( $self->{button_clicks}->[$button_no] ) ) { 277 277 warn 'Too many buttons defined!'; … … 389 389 390 390 my $count; 391 for my $item ( @{ $self->{items} } ) {391 foreach my $item ( @{ $self->{items} } ) { 392 392 ++$count if $item->{selected}; 393 393 } … … 395 395 my $method = $count ? 'Enable' : 'Disable'; 396 396 397 for my $button ( @{ $self->{buttons} || [] } ) {397 foreach my $button ( @{ $self->{buttons} || [] } ) { 398 398 $button->[2]->$method if defined( $button->[2] ); 399 399 } -
trunk/Padre/lib/Padre/Wx/Directory/TreeCtrl.pm
r10589 r10792 351 351 352 352 # Loops thought the node's total children 353 for my $item ( 1 .. $self->GetChildrenCount($root) ) {353 foreach my $item ( 1 .. $self->GetChildrenCount($root) ) { 354 354 355 355 ( my $node, $cookie ) = $item == 1 ? $self->GetFirstChild($root) : $self->GetNextChild( $root, $cookie ); -
trunk/Padre/lib/Padre/Wx/Editor.pm
r10681 r10792 749 749 } 750 750 751 # when the focus is received by the editor751 # When the focus is received by the editor 752 752 sub on_focus { 753 my ( $self, $event ) = @_; 754 my $doc = Padre::Current->document; 755 756 TRACE( "Focus received file: " . ( $doc->filename || '' ) ) if DEBUG; 757 758 my $main = $self->main; 759 760 # to show/hide the document specific Perl menu 753 my $self = shift; 754 my $event = shift; 755 my $main = $self->main; 756 my $document = $main->current->document; 757 TRACE( "Focus received file: " . ( $document->filename || '' ) ) if DEBUG; 758 759 # To show/hide the document specific Perl menu 761 760 # don't refresh on each focus event 762 $main->refresh_menu 763 if ( !defined( $main->{last_refresh_editor} ) ) 764 or ( $main->{last_refresh_editor} ne $self ); 765 $main->{last_refresh_editor} = $self; 766 767 $main->update_directory; 761 my $lock = $main->lock('UPDATE', 'refresh_menu', 'refresh_directory'); 768 762 769 763 # TO DO … … 771 765 # we should restrict some of the updates to cases when we switch from one file to 772 766 # another 773 774 767 if ( $self->needs_manual_colorize ) { 775 768 TRACE("needs_manual_colorize") if DEBUG; 776 769 my $lexer = $self->GetLexer; 777 770 if ( $lexer == Wx::wxSTC_LEX_CONTAINER ) { 778 $doc ->colorize;771 $document->colorize; 779 772 } else { 780 $doc ->remove_color;773 $document->remove_color; 781 774 $self->Colourise( 0, $self->GetLength ); 782 775 } … … 1212 1205 $end--; 1213 1206 } 1214 for my $line ( $begin .. $end ) {1207 foreach my $line ( $begin .. $end ) { 1215 1208 1216 1209 # insert $str (# or //) … … 1253 1246 $end--; 1254 1247 } 1255 for my $line ( $begin .. $end ) {1248 foreach my $line ( $begin .. $end ) { 1256 1249 my $first = $self->PositionFromLine($line); 1257 1250 my $last = $first + $length; -
trunk/Padre/lib/Padre/Wx/FindResult.pm
r10436 r10792 195 195 my $self = shift; 196 196 197 for my $i ( 0 .. 1 ) {197 foreach my $i ( 0 .. 1 ) { 198 198 my $col = $self->GetColumn($i); 199 199 $col->SetText( _get_title($i) ); -
trunk/Padre/lib/Padre/Wx/Main.pm
r10767 r10792 114 114 ); 115 115 116 # Start with a simple placeholder title 117 $self->SetTitle('Padre'); 118 116 119 # Save a reference back to the parent IDE 117 120 $self->{ide} = $ide; … … 124 127 # so that we can do locking operations during startup. 125 128 $self->{locker} = Padre::Locker->new($self); 126 127 # Determine the window title (needs ide & config)128 $self->refresh_title;129 129 130 130 # Remember where the editor started from, … … 246 246 Padre::Wx::ID_TIMER_POSTINIT, 247 247 sub { 248 $_[0]-> _timer_post_init;248 $_[0]->timer_post_init; 249 249 }, 250 250 ); … … 656 656 } 657 657 658 sub _timer_post_init {658 sub timer_post_init { 659 659 my $self = shift; 660 660 my $config = $self->config; … … 1159 1159 sub add_refresh_listener { 1160 1160 my ( $self, @listeners ) = @_; 1161 for my $l (@listeners) {1161 foreach my $l (@listeners) { 1162 1162 if ( !grep { $_ eq $l } @{ $self->{refresh_listeners} } ) { 1163 1163 Scalar::Util::weaken($l); … … 1267 1267 =pod 1268 1268 1269 =head2 C<refresh_outline> 1270 1271 $main->refresh_outline; 1272 1273 Force a refresh of the outline panel. 1274 1275 =cut 1276 1277 sub refresh_outline { 1278 my $self = shift; 1279 return unless $self->has_outline; 1280 return if $self->locked('REFRESH'); 1281 return unless $self->menu->view->{show_outline}->IsChecked; 1282 $self->outline->refresh; 1283 return; 1284 } 1285 1286 =pod 1287 1269 1288 =head3 C<refresh_menu> 1270 1289 … … 1337 1356 my $self = shift; 1338 1357 return if $self->locked('REFRESH'); 1339 $self->menu->file-> update_recentfiles;1358 $self->menu->file->refresh_recent; 1340 1359 } 1341 1360 … … 2616 2635 } 2617 2636 2618 2619 2620 sub update_directory {2621 my $self = shift;2622 2623 # update the directory listing2624 if ( $self->has_directory ) {2625 if ( $self->menu->view->{directory}->IsChecked ) {2626 $self->directory->refresh;2627 }2628 }2629 2630 }2631 2632 2633 2637 =pod 2634 2638 … … 3315 3319 } 3316 3320 3317 my $lock = $self->lock('REFRESH');3321 my $lock = $self->lock('REFRESH'); 3318 3322 my $document = Padre::Document->new( filename => $file, ); 3319 3323 … … 3398 3402 3399 3403 sub create_tab { 3400 my ( $self, $editor, $title ) = @_; 3404 my $self = shift; 3405 my $editor = shift; 3406 my $title = shift; 3401 3407 $title ||= '(' . Wx::gettext('Unknown') . ')'; 3408 3409 my $lock = $self->lock('refresh'); 3402 3410 $self->notebook->AddPage( $editor, $title, 1 ); 3403 3411 $editor->SetFocus; 3404 my $id = $self->notebook->GetSelection; 3405 $self->refresh; 3406 return $id; 3412 return $self->notebook->GetSelection; 3407 3413 } 3408 3414 … … 3641 3647 3642 3648 my @files; 3643 for my $filename (@filenames) {3649 foreach my $filename (@filenames) { 3644 3650 3645 3651 if ( $filename =~ /[\*\?]/ ) { … … 3810 3816 SCOPE: { 3811 3817 my $lock = $self->lock('refresh'); 3812 for my $reload_page_no ( 0 .. $#reload_pages ) {3818 foreach my $reload_page_no ( 0 .. $#reload_pages ) { 3813 3819 $progress->update( $reload_page_no, ( $reload_page_no + 1 ) . '/' . scalar(@reload_pages) ); 3814 3820 … … 4444 4450 SCOPE: { 4445 4451 my $lock = $self->lock('refresh'); 4446 for my $close_page_no ( 0 .. $#close_pages ) {4452 foreach my $close_page_no ( 0 .. $#close_pages ) { 4447 4453 $progress->update( $close_page_no, ( $close_page_no + 1 ) . '/' . scalar(@close_pages) ); 4448 4454 -
trunk/Padre/lib/Padre/Wx/Menu/File.pm
r10772 r10792 257 257 $self->{recentfiles}->AppendSeparator; 258 258 259 $self->update_recentfiles; 259 # NOTE: Do NOT do an initial fill during the constructor 260 # We'll do one later anyway, and the list is premature at this point. 261 # $self->refresh_recent; 260 262 261 263 $self->AppendSeparator; … … 279 281 280 282 sub title { 281 my $self = shift; 282 283 return Wx::gettext('&File'); 283 Wx::gettext('&File'); 284 284 } 285 285 286 287 288 286 sub refresh { 289 my $self = shift;290 my $current = _CURRENT(@_);291 my $doc = $current->document ? 1 : 0;292 293 $self->{open_in_file_browser}->Enable($doc );287 my $self = shift; 288 my $current = _CURRENT(@_); 289 my $document = $current->document ? 1 : 0; 290 291 $self->{open_in_file_browser}->Enable($document); 294 292 if (Padre::Constant::WIN32) { 295 293 296 294 #Win32 297 $self->{open_with_default_system_editor}->Enable($doc );298 $self->{open_in_command_line}->Enable($doc );295 $self->{open_with_default_system_editor}->Enable($document); 296 $self->{open_in_command_line}->Enable($document); 299 297 } else { 300 298 … … 304 302 $self->{open_in_command_line}->Enable(0); 305 303 } 306 $self->{close}->Enable($doc );307 $self->{close_all}->Enable($doc );308 $self->{close_all_but_current}->Enable($doc );309 $self->{reload_file}->Enable($doc );310 $self->{reload_all}->Enable($doc );311 $self->{save}->Enable($doc );312 $self->{save_as}->Enable($doc );313 $self->{save_all}->Enable($doc );314 $self->{print}->Enable($doc );315 defined( $self->{open_session} ) and $self->{open_selection}->Enable($doc );316 defined( $self->{save_session} ) and $self->{save_session}->Enable($doc );317 $self->{docstat}->Enable($doc );304 $self->{close}->Enable($document); 305 $self->{close_all}->Enable($document); 306 $self->{close_all_but_current}->Enable($document); 307 $self->{reload_file}->Enable($document); 308 $self->{reload_all}->Enable($document); 309 $self->{save}->Enable($document); 310 $self->{save_as}->Enable($document); 311 $self->{save_all}->Enable($document); 312 $self->{print}->Enable($document); 313 defined( $self->{open_session} ) and $self->{open_selection}->Enable($document); 314 defined( $self->{save_session} ) and $self->{save_session}->Enable($document); 315 $self->{docstat}->Enable($document); 318 316 319 317 return 1; 320 318 } 321 319 322 sub update_recentfiles{320 sub refresh_recent { 323 321 my $self = shift; 324 322 … … 345 343 346 344 # Handle "File not found" situation 347 Padre::DB::History->delete( 'where name = ? and type = ?', $file, 'files' ); 348 $self->update_recentfiles; 345 Padre::Current->main->lock('UPDATE', 'DB', 'refresh_recent'); 346 Padre::DB::History->delete( 347 'where name = ? and type = ?', 348 $file, 'files', 349 ); 349 350 Wx::MessageBox( 350 351 sprintf( Wx::gettext("File %s not found."), $file ), -
trunk/Padre/lib/Padre/Wx/Menu/Run.pm
r10436 r10792 8 8 use Padre::Wx (); 9 9 use Padre::Wx::Menu (); 10 use Padre::Current qw{_CURRENT};10 use Padre::Current ('_CURRENT'); 11 11 12 12 our $VERSION = '0.56'; … … 127 127 $self->{run_command}->Enable(1); 128 128 $self->{stop}->Enable(0); 129 $self->{main}->refresh_toolbar(_CURRENT);130 129 return; 131 130 } … … 137 136 $self->{run_command}->Enable(0); 138 137 $self->{stop}->Enable(1); 139 $self->{main}->refresh_toolbar(_CURRENT);140 138 return; 141 139 } -
trunk/Padre/lib/Padre/Wx/Menu/View.pm
r10778 r10792 51 51 52 52 # Show or hide GUI elements 53 for my $element (@GUI_ELEMENTS) {53 foreach my $element (@GUI_ELEMENTS) { 54 54 55 55 next unless defined($element); -
trunk/Padre/lib/Padre/Wx/Menubar.pm
r10670 r10792 117 117 my @items; 118 118 119 for my $item ( split( /\;/, $config->main_menubar_items ) ) {119 foreach my $item ( split( /\;/, $config->main_menubar_items ) ) { 120 120 if ( $item eq 'menu._document' ) { 121 121 next unless defined( $main->current ); … … 145 145 146 146 my $count = -1; 147 for my $item (@items) {147 foreach my $item (@items) { 148 148 if ( $item =~ /^menu\.(.+)$/ ) { 149 149 my $menu = $1; … … 198 198 # is a collision 199 199 $title =~ s/\&//g; 200 for my $pos ( 0 .. ( length($title) - 1 ) ) {200 foreach my $pos ( 0 .. ( length($title) - 1 ) ) { 201 201 my $char = lc( substr( $title, $pos, 1 ) ); 202 202 -
trunk/Padre/lib/Padre/Wx/Notebook.pm
r10659 r10792 72 72 } 73 73 74 75 76 77 74 78 ###################################################################### 75 79 # Main Methods … … 92 96 } 93 97 98 99 100 101 94 102 ###################################################################### 95 103 # Event Handlers … … 98 106 my $self = shift; 99 107 my $main = $self->main; 108 my $lock = $main->lock('UPDATE', 'refresh', 'refresh_outline'); 100 109 my $editor = $self->current->editor; 101 if ($editor) { 110 111 if ( $editor ) { 102 112 my $history = $main->{page_history}; 103 113 my $current = Scalar::Util::refaddr($editor); … … 108 118 # TO DO: Violates encapsulation 109 119 $editor->{Document}->set_indentation_style; 120 } 110 121 111 # make sure the outline is refreshed for the new doc112 # TO DO: Violates encapsulation113 if ( $main->has_outline ) {114 $main->outline->clear;115 $main->outline->force_next(1);116 }117 }118 $main->refresh;119 122 $main->{ide}->plugin_manager->plugin_event('editor_changed'); 120 123 } -
trunk/Padre/lib/Padre/Wx/Outline.pm
r10436 r10792 115 115 } 116 116 117 sub refresh { 118 my $self = shift; 119 $self->clear; 120 $self->force_next(1); 121 } 122 117 123 sub running { 118 124 !!( $_[0]->{timer} and $_[0]->{timer}->IsRunning ); -
trunk/Padre/lib/Padre/Wx/Syntax.pm
r10692 r10792 302 302 my $self = shift; 303 303 304 for my $i ( 0 .. 2 ) {304 foreach my $i ( 0 .. 2 ) { 305 305 my $col = $self->GetColumn($i); 306 306 $col->SetText( _get_title($i) ); -
trunk/Padre/lib/Padre/Wx/ToolBar.pm
r10436 r10792 53 53 # within config.yml. 54 54 55 for my $item ( split( /\;/, $config->main_toolbar_items ) ) {55 foreach my $item ( split( /\;/, $config->main_toolbar_items ) ) { 56 56 57 57 if ( $item eq '|' ) { … … 139 139 my $selection = ( defined $text and $text ne '' ) ? 1 : 0; 140 140 141 for my $item ( keys( %{ $self->{item_list} } ) ) {141 foreach my $item ( keys( %{ $self->{item_list} } ) ) { 142 142 143 143 my $action = $self->{item_list}->{$item}; -
trunk/Padre/script/padre
r10615 r10792 131 131 132 132 if ($PRELOAD) { 133 134 133 # Load the entire application into memory immediately 135 134 Padre->import(':everything'); 135 # use Aspect; 136 # aspect( 'NYTProf', 137 # call qr/^Padre::/ & 138 # call qr/\b(?:refresh|update)\w*\z/ & ! 139 # call qr/^Padre::(?:Locker|Wx::Progress)::/ 140 # ); 136 141 } 137 142 -
trunk/Padre/share/examples/absolute_beginner/05_do_it_again.pl
r8739 r10792 72 72 # Perl could also be used for cooking: 73 73 74 for my $fruit ( "Orange", "Apple", "Strawberry", "Melon", "Lemon" ) {74 foreach my $fruit ( "Orange", "Apple", "Strawberry", "Melon", "Lemon" ) { 75 75 print "1 $fruit\n"; 76 76 } -
trunk/Padre/share/examples/absolute_beginner/07_short_salat.pl
r8739 r10792 51 51 # Sounds like a job for a loop and I'll start with a for try 52 52 53 for my $argument_number ( 0 .. 2 ) {53 foreach my $argument_number ( 0 .. 2 ) { 54 54 print $_[$argument_number] . "\n"; 55 55 } … … 81 81 # variables until now, but this can't wait any longer 82 82 83 for my $argument_number ( 0 .. $number_of_items ) {83 foreach my $argument_number ( 0 .. $number_of_items ) { 84 84 85 85 # The number of the first argument is fixed, so there is no need to push it … … 105 105 my $number_of_items = $_[0]; 106 106 107 for my $argument_number ( 1 .. $number_of_items ) {107 foreach my $argument_number ( 1 .. $number_of_items ) { 108 108 print "Cut " . $_[$argument_number] . " in stripes\n"; 109 109 } … … 114 114 my $number_of_items = $_[0]; 115 115 116 for my $argument_number ( 1 .. $number_of_items ) {116 foreach my $argument_number ( 1 .. $number_of_items ) { 117 117 print "Cut " . $_[$argument_number] . " in pieces\n"; 118 118 } -
trunk/Padre/t/94-padre-file-remote.t
r10438 r10792 47 47 ); 48 48 49 for my $url ( keys(%HTTP_Tests) ) {49 foreach my $url ( keys(%HTTP_Tests) ) { 50 50 $file = Padre::File->new($url); 51 51 ok( defined($file), 'HTTP ' . $url . ': Create Padre::File object' ); … … 94 94 95 95 # Test some FTP servers 96 for my $url (96 foreach my $url ( 97 97 'ftp://ftp.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg', 98 98 'ftp://ftp.proftpd.org/README.MIRRORS', # Proftpd -
trunk/Padre/xt/actions.t
r10498 r10792 68 68 69 69 # Run the action checks... 70 for my $action (sort(keys(%{$VAR1->{actions}}))) {70 foreach my $action (sort(keys(%{$VAR1->{actions}}))) { 71 71 72 72 if ($action =~ /^run\./) { -
trunk/Padre/xt/mimetype.t
r10751 r10792 54 54 55 55 # Some fixed test texts 56 for my $text (sort(keys(%test_texts))) {56 foreach my $text (sort(keys(%test_texts))) { 57 57 is(Padre::MimeTypes->guess_mimetype($text,''),$test_texts{$text},$test_texts{$text}); 58 58 } 59 59 60 60 # Some fixed test filenames 61 for my $file (sort(keys(%test_files))) {61 foreach my $file (sort(keys(%test_files))) { 62 62 is(Padre::MimeTypes->guess_mimetype('',$file),$test_files{$file},$file); 63 63 }
Note: See TracChangeset
for help on using the changeset viewer.
