Changeset 11120
- Timestamp:
- 03/15/10 04:51:54 (5 months ago)
- Location:
- trunk/Padre
- Files:
-
- 24 modified
-
lib/Padre/Action/Edit.pm (modified) (1 diff)
-
lib/Padre/Action/Tools.pm (modified) (3 diffs)
-
lib/Padre/Document/Perl.pm (modified) (3 diffs)
-
lib/Padre/Locale.pm (modified) (1 diff)
-
lib/Padre/Plugin/Devel.pm (modified) (2 diffs)
-
lib/Padre/SlaveDriver.pm (modified) (2 diffs)
-
lib/Padre/Task/Outline/Perl.pm (modified) (1 diff)
-
lib/Padre/TaskManager.pm (modified) (2 diffs)
-
lib/Padre/Wx/About.pm (modified) (1 diff)
-
lib/Padre/Wx/App.pm (modified) (1 diff)
-
lib/Padre/Wx/AuiManager.pm (modified) (1 diff)
-
lib/Padre/Wx/Dialog/HelpSearch.pm (modified) (1 diff)
-
lib/Padre/Wx/Dialog/OpenResource.pm (modified) (1 diff)
-
lib/Padre/Wx/Dialog/Replace.pm (modified) (1 diff)
-
lib/Padre/Wx/Dialog/SpecialValues.pm (modified) (3 diffs)
-
lib/Padre/Wx/Dialog/WhereFrom.pm (modified) (8 diffs)
-
lib/Padre/Wx/Dialog/WindowList.pm (modified) (1 diff)
-
lib/Padre/Wx/Display.pm (modified) (3 diffs)
-
lib/Padre/Wx/DocBrowser.pm (modified) (4 diffs)
-
lib/Padre/Wx/Editor.pm (modified) (10 diffs)
-
lib/Padre/Wx/Main.pm (modified) (3 diffs)
-
lib/Padre/Wx/Menu/Edit.pm (modified) (1 diff)
-
lib/Padre/Wx/Right.pm (modified) (1 diff)
-
t/07-version.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Action/Edit.pm
r11105 r11120 319 319 }, 320 320 ); 321 321 322 322 Padre::Action->new( 323 323 name => 'edit.brace_match_select', -
trunk/Padre/lib/Padre/Action/Tools.pm
r11108 r11120 253 253 # Find 'cpanm', used to install modules 254 254 require Config; 255 my %seen = (); 256 my @where = grep { 257 defined $_ and length $_ and not $seen{$_}++ 258 } map { 259 $Config::Config{$_} 260 } qw{ 255 my %seen = (); 256 my @where = grep { defined $_ and length $_ and not $seen{$_}++ } map { $Config::Config{$_} } qw{ 261 257 sitescriptexp 262 258 sitebinexp … … 267 263 }; 268 264 my $cpanm = ''; 269 foreach my $dir ( @where ) { 265 266 foreach my $dir (@where) { 270 267 my $path = File::Spec->catfile( $dir, 'cpanm' ); 271 268 if ( -f $path ) { … … 274 271 } 275 272 } 276 unless ( $cpanm) {273 unless ($cpanm) { 277 274 $main->error( Wx::gettext("cpanm is unexpectedly not installed") ); 278 275 return; -
trunk/Padre/lib/Padre/Document/Perl.pm
r11112 r11120 346 346 # Implemented as a task. See Padre::Task::SyntaxChecker::Perl 347 347 sub check_syntax { 348 shift->_check_syntax_internals( { @_, 349 background => 0 } ); 348 shift->_check_syntax_internals( 349 { @_, 350 background => 0 351 } 352 ); 350 353 } 351 354 352 355 sub check_syntax_in_background { 353 shift->_check_syntax_internals( { @_, 354 background => 1 } ); 356 shift->_check_syntax_internals( 357 { @_, 358 background => 1 359 } 360 ); 355 361 } 356 362 … … 1294 1300 my $first = $editor->PositionFromLine($line); 1295 1301 my $col = $pos - $first; 1296 my $text = $editor->GetTextRange( $first, $pos);1302 my $text = $editor->GetTextRange( $first, $pos ); 1297 1303 1298 1304 $editor->AddText( $self->newline ); … … 1301 1307 $editor->AddText($text); 1302 1308 1303 $editor->SetCurrentPos( $pos + $col + 1 );1309 $editor->SetCurrentPos( $pos + $col + 1 ); 1304 1310 1305 1311 return 1; -
trunk/Padre/lib/Padre/Locale.pm
r11084 r11120 68 68 my $name = shift; 69 69 require Encode; 70 return $RFC4646{$name}{utf8text} ? Encode::decode( 'utf8', $RFC4646{$name}{utf8text}) : $name70 return $RFC4646{$name}{utf8text} ? Encode::decode( 'utf8', $RFC4646{$name}{utf8text} ) : $name; 71 71 } 72 72 -
trunk/Padre/lib/Padre/Plugin/Devel.pm
r11089 r11120 189 189 190 190 foreach ( 0 .. $count - 1 ) { 191 my $display = Wx::Display->new($_);191 my $display = Wx::Display->new($_); 192 192 push @displays, 193 193 { 194 194 IsPrimary => $display->IsPrimary, 195 GetGeometry => $self->_rect( $display->GetGeometry),196 GetClientArea => $self->_rect( $display->GetClientArea),195 GetGeometry => $self->_rect( $display->GetGeometry ), 196 GetClientArea => $self->_rect( $display->GetClientArea ), 197 197 }; 198 198 } 199 199 $self->_dump( 200 { GetCount => $count,200 { GetCount => $count, 201 201 DisplayList => \@displays, 202 202 } … … 207 207 my $self = shift; 208 208 my $rect = shift; 209 my %hash = map { 210 $_ => $rect->$_() 211 } qw{ 209 my %hash = map { $_ => $rect->$_() } qw{ 212 210 GetTop 213 211 GetBottom -
trunk/Padre/lib/Padre/SlaveDriver.pm
r11064 r11120 128 128 129 129 require Storable; 130 $self->{cmd_queue}->enqueue( 131 Storable::freeze( [ $manager->task_queue ] ) 132 ); 133 134 return threads->object( 135 $self->{tid_queue}->dequeue 136 ); 130 $self->{cmd_queue}->enqueue( Storable::freeze( [ $manager->task_queue ] ) ); 131 132 return threads->object( $self->{tid_queue}->dequeue ); 137 133 } 138 134 … … 243 239 while ( my $args = $in->dequeue ) { # args is frozen [$main, $queue] 244 240 last if $args eq 'STOP'; 245 my $queue = Padre::SlaveDriver->new->task_queue;241 my $queue = Padre::SlaveDriver->new->task_queue; 246 242 my $worker = threads->create( \&_worker_loop, $queue ); 247 243 $out->enqueue( $worker->tid ); -
trunk/Padre/lib/Padre/Task/Outline/Perl.pm
r11115 r11120 271 271 if ( defined( $pkg->{$type} ) && scalar( @{ $pkg->{$type} } ) > 0 ) { 272 272 my $type_caption = ucfirst($type); 273 if ( exists $type_caption{$type}) {273 if ( exists $type_caption{$type} ) { 274 274 $type_caption = $type_caption{$type}; 275 } 276 else { 275 } else { 277 276 warn "Type not translated: $type_caption\n"; 278 277 } 279 278 280 279 $type_elem = $outlinebar->AppendItem( 281 280 $root, -
trunk/Padre/lib/Padre/TaskManager.pm
r11102 r11120 426 426 $self->task_queue->insert( 0, ("STOP") x scalar(@workers) ); 427 427 428 my $waitstart = [ gettimeofday()];428 my $waitstart = [ gettimeofday() ]; 429 429 430 430 # Changing the selection seems to solve the endless-loop problem … … 436 436 437 437 # Wait no more than two minutes 438 last if( tv_interval($waitstart) >= (2*60) );438 last if ( tv_interval($waitstart) >= ( 2 * 60 ) ); 439 439 440 440 # Pass time slices to the threads for finishing -
trunk/Padre/lib/Padre/Wx/About.pm
r11086 r11120 98 98 99 99 # Create the content for the About window 100 my $self = shift;101 my $splash = Padre::Util::splash();100 my $self = shift; 101 my $splash = Padre::Util::splash(); 102 102 my $created_by = Wx::gettext('Created by'); 103 103 my $padre_dev_team = Wx::gettext('The Padre Development Team'); -
trunk/Padre/lib/Padre/Wx/App.pm
r11064 r11120 50 50 my $ide = shift; 51 51 require Params::Util; 52 unless ( Params::Util::_INSTANCE( $ide, 'Padre') ) {52 unless ( Params::Util::_INSTANCE( $ide, 'Padre' ) ) { 53 53 Carp::croak("Did not provide the ide object to Padre::App->create"); 54 54 } -
trunk/Padre/lib/Padre/Wx/AuiManager.pm
r11099 r11120 65 65 # Set the lock status of the panels 66 66 sub lock_panels { 67 my $self = shift;67 my $self = shift; 68 68 my $unlock = $_[0] ? 0 : 1; 69 69 -
trunk/Padre/lib/Padre/Wx/Dialog/HelpSearch.pm
r11117 r11120 393 393 $self->_list->Select(0); 394 394 } 395 $self->_status->SetLabel( sprintf( Wx::gettext("Found %s help topic(s)\n"), $pos) );395 $self->_status->SetLabel( sprintf( Wx::gettext("Found %s help topic(s)\n"), $pos ) ); 396 396 $self->_display_help_in_viewer; 397 397 -
trunk/Padre/lib/Padre/Wx/Dialog/OpenResource.pm
r11113 r11120 261 261 ); 262 262 $self->_popup_menu( Wx::Menu->new ); 263 $self->_skip_vcs_files( $self->_popup_menu->AppendCheckItem( -1, Wx::gettext("Skip version control system files") ) ); 263 $self->_skip_vcs_files( 264 $self->_popup_menu->AppendCheckItem( -1, Wx::gettext("Skip version control system files") ) ); 264 265 $self->_skip_using_manifest_skip( 265 266 $self->_popup_menu->AppendCheckItem( -1, Wx::gettext("Skip using MANIFEST.SKIP") ) ); -
trunk/Padre/lib/Padre/Wx/Dialog/Replace.pm
r11114 r11120 572 572 my $number_of_changes = $main->replace_all($search); 573 573 if ($number_of_changes) { 574 my $message_text = $number_of_changes == 1 ? Wx::gettext('Replaced %d match') : Wx::gettext('Replaced %d matches'); 574 my $message_text = 575 $number_of_changes == 1 ? Wx::gettext('Replaced %d match') : Wx::gettext('Replaced %d matches'); 576 575 577 # remark: It would be better to use gettext for plural handling, but wxperl does not seem to support this at the moment. 576 578 $main->info( 577 sprintf( $message_text, $number_of_changes),579 sprintf( $message_text, $number_of_changes ), 578 580 Wx::gettext('Search and Replace') 579 581 ); -
trunk/Padre/lib/Padre/Wx/Dialog/SpecialValues.pm
r11110 r11120 14 14 my $categories = { 15 15 Wx::gettext('Date/Time') => [ 16 { label => Wx::gettext('Now'), action => _get_date_info('now') },17 { label => Wx::gettext('Today'), action => _get_date_info('today') },18 { label => Wx::gettext('Year'), action => _get_date_info('year') },19 { label => Wx::gettext('Epoch'), action => _get_date_info('epoch') },16 { label => Wx::gettext('Now'), action => _get_date_info('now') }, 17 { label => Wx::gettext('Today'), action => _get_date_info('today') }, 18 { label => Wx::gettext('Year'), action => _get_date_info('year') }, 19 { label => Wx::gettext('Epoch'), action => _get_date_info('epoch') }, 20 20 ], 21 21 Wx::gettext('File') => [ … … 92 92 my $value_ind = $data->{_find_specialvalue_}; 93 93 my $text = &{ $categories->{$cat_name}[$value_ind]{action} }; 94 94 95 #warn "cat : $cat_name, value $value_ind, text : $text\n"; 95 96 … … 123 124 return sub { 124 125 return scalar localtime; 125 } 126 } 127 elsif ( $type eq 'today' ) { 126 } 127 } elsif ( $type eq 'today' ) { 128 128 return sub { 129 129 my @localtime = localtime(time); 130 130 return sprintf "%s-%02s-%02s", $localtime[5] + 1900, $localtime[4], $localtime[3]; 131 } 132 } 133 elsif ( $type eq 'year' ) { 131 } 132 } elsif ( $type eq 'year' ) { 134 133 return sub { 135 134 my @localtime = localtime(time); 136 135 return $localtime[5] + 1900; 137 } 138 } 139 elsif ( $type eq 'epoch' ) { 136 } 137 } elsif ( $type eq 'epoch' ) { 140 138 return sub { 141 139 return time; 142 } 143 } 144 else { 140 } 141 } else { 145 142 return sub { 146 143 warn "date info $type not implemented yet\n"; 147 144 return ''; 148 }145 } 149 146 } 150 147 } 151 148 152 149 sub _get_file_info { 153 my $type = shift;150 my $type = shift; 154 151 my $document = Padre::Current->document; 155 my ( $lines, $chars_with_space, $chars_without_space, $words, $is_readonly, 156 $filename, $newline_type, $encoding ) = $document->stats; 157 152 my ($lines, $chars_with_space, $chars_without_space, $words, $is_readonly, 153 $filename, $newline_type, $encoding 154 ) = $document->stats; 155 158 156 if ( $type eq 'name' ) { 159 157 return sub { 160 158 return defined $filename ? $filename : Wx::gettext("No filename"); 161 159 }; 162 } 163 elsif ( $type eq 'size' ) { 160 } elsif ( $type eq 'size' ) { 164 161 return sub { 165 162 my $filename = $document->filename || $document->tempfile; 166 163 return ($filename) ? -s $filename : 0; 167 164 }; 168 } 169 elsif ( $type eq 'number of lines' ) { 165 } elsif ( $type eq 'number of lines' ) { 170 166 return sub { 171 167 return $lines; 172 168 }; 173 } 174 else { 169 } else { 175 170 return sub { 176 171 warn "file info $type not implemented yet\n"; 177 172 return ''; 178 }173 } 179 174 } 180 175 } -
trunk/Padre/lib/Padre/Wx/Dialog/WhereFrom.pm
r11119 r11120 9 9 our $VERSION = '0.58'; 10 10 11 our @ISA = qw{11 our @ISA = qw{ 12 12 Padre::Wx::Role::MainChild 13 13 Wx::Dialog … … 18 18 19 19 my $config = Padre->ide->config; 20 20 21 #return if $config->feedback_done; 21 22 … … 54 55 55 56 sub _create_controls { 56 my ( $dialog, $sizer) = @_;57 my ( $dialog, $sizer ) = @_; 57 58 58 59 # "Where did you hear..." label 59 my $wherefrom_label = Wx::StaticText->new( 60 $dialog, 61 -1, 60 my $wherefrom_label = Wx::StaticText->new( 61 $dialog, 62 -1, 62 63 Wx::gettext('Where did you hear about Padre?') 63 64 ); … … 73 74 Wx::gettext('Other (Please fill in here)'), 74 75 ]; 75 76 $dialog->{wherefrom} = Wx::ComboBox->new( 77 $dialog, 78 -1, 79 '', 76 77 $dialog->{wherefrom} = Wx::ComboBox->new( 78 $dialog, 79 -1, 80 '', 80 81 Wx::wxDefaultPosition, 81 82 Wx::wxDefaultSize, 82 83 $choices 83 84 ); 84 85 85 86 # OK button 86 87 $dialog->{button_ok} = Wx::Button->new( … … 91 92 # Cancel button 92 93 $dialog->{button_cancel} = Wx::Button->new( 93 $dialog, Wx::wxID_CANCEL, 94 $dialog, Wx::wxID_CANCEL, 94 95 Wx::gettext("Skip question without giving feedback"), 95 96 ); 96 97 97 98 # where from...? sizer 98 99 my $wherefrom_sizer = Wx::BoxSizer->new(Wx::wxHORIZONTAL); … … 103 104 # Button sizer 104 105 my $button_sizer = Wx::BoxSizer->new(Wx::wxHORIZONTAL); 105 $button_sizer->Add( $dialog->{button_ok}, 0, 0, 0 );106 $button_sizer->Add( $dialog->{button_ok}, 0, 0, 0 ); 106 107 $button_sizer->Add( $dialog->{button_cancel}, 0, Wx::wxLEFT, 5 ); 107 108 $button_sizer->AddSpacer(5); … … 116 117 # Wrap with a horizontal sizer to get left/right padding 117 118 $sizer->Add( $vsizer, 1, Wx::wxALL | Wx::wxEXPAND, 5 ); 118 119 119 120 return; 120 121 } … … 123 124 sub _bind_events { 124 125 my $dialog = shift; 125 126 126 127 # Ok button 127 Wx::Event::EVT_BUTTON( 128 $dialog, 129 $dialog->{button_ok}, 130 \&WhereFrom_ok_clicked 128 Wx::Event::EVT_BUTTON( 129 $dialog, 130 $dialog->{button_ok}, 131 \&WhereFrom_ok_clicked 131 132 ); 132 133 133 134 # Cancel or Skip feedback button 134 Wx::Event::EVT_BUTTON( 135 $dialog, 136 $dialog->{button_cancel}, 135 Wx::Event::EVT_BUTTON( 136 $dialog, 137 $dialog->{button_cancel}, 137 138 \&WhereFrom_cancel_clicked 138 139 ); -
trunk/Padre/lib/Padre/Wx/Dialog/WindowList.pm
r11066 r11120 358 358 $disk_text = Wx::gettext('CHANGED'); 359 359 } 360 $list->SetItem( $idx, 3, $disk_text );360 $list->SetItem( $idx, 3, $disk_text ); 361 361 } 362 362 -
trunk/Padre/lib/Padre/Wx/Display.pm
r11098 r11120 103 103 my $rect = shift; 104 104 my $ratio = shift; 105 my $margin = ( 1 - $ratio) / 2;105 my $margin = ( 1 - $ratio ) / 2; 106 106 $rect->width( int( $rect->width * $ratio ) ); 107 107 $rect->height( int( $rect->height * $ratio ) ); 108 $rect->x( $rect->x + int( $rect->width * $margin) );109 $rect->y( $rect->y + int( $rect->height * $margin) );108 $rect->x( $rect->x + int( $rect->width * $margin ) ); 109 $rect->y( $rect->y + int( $rect->height * $margin ) ); 110 110 return $rect; 111 111 } … … 116 116 my $rect = shift; 117 117 my $ratio = shift; 118 my $marginr = ( 1 - $ratio) / 2;119 my $marginx = int( $rect->width * $marginr);120 my $marginy = int( $rect->height * $marginr);121 my $margin = ( $marginx > $marginy) ? $marginy : $marginx;118 my $marginr = ( 1 - $ratio ) / 2; 119 my $marginx = int( $rect->width * $marginr ); 120 my $marginy = int( $rect->height * $marginr ); 121 my $margin = ( $marginx > $marginy ) ? $marginy : $marginx; 122 122 $rect->width( $rect->width - $margin * 2 ); 123 123 $rect->height( $rect->height - $margin * 2 ); … … 130 130 sub _rect_golden { 131 131 my $rect = shift; 132 if ( $rect->width > ($rect->height * GOLDEN) ) { 132 if ( $rect->width > ( $rect->height * GOLDEN ) ) { 133 133 134 # Shrink left from the right 134 $rect->width( int( $rect->height / GOLDEN) );135 $rect->width( int( $rect->height / GOLDEN ) ); 135 136 } else { 137 136 138 # Shrink up from the bottom 137 $rect->height( int( $rect->width / GOLDEN) );139 $rect->height( int( $rect->width / GOLDEN ) ); 138 140 } 139 141 return $rect; -
trunk/Padre/lib/Padre/Wx/DocBrowser.pm
r11117 r11120 111 111 Wx::wxTE_PROCESS_ENTER 112 112 ); 113 $entry->SetToolTip( Wx::ToolTip->new( Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP')) );113 $entry->SetToolTip( Wx::ToolTip->new( Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP') ) ); 114 114 115 115 Wx::Event::EVT_TEXT_ENTER( … … 128 128 Wx::wxALIGN_RIGHT 129 129 ); 130 $label->SetToolTip( Wx::ToolTip->new( Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP')) );130 $label->SetToolTip( Wx::ToolTip->new( Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP') ) ); 131 131 132 132 my $close_button = Wx::Button->new( $self, Wx::wxID_CANCEL, Wx::gettext('&Close') ); … … 369 369 $panel; 370 370 } else { 371 $self->debug( sprintf( Wx::gettext('DocBrowser: no viewer for %s'), $mime) );371 $self->debug( sprintf( Wx::gettext('DocBrowser: no viewer for %s'), $mime ) ); 372 372 } 373 373 }; … … 402 402 my $notFound = Wx::MessageDialog->new( 403 403 $self, 404 sprintf( Wx::gettext("Searched for '%s' and failed..."), $query),404 sprintf( Wx::gettext("Searched for '%s' and failed..."), $query ), 405 405 Wx::gettext('Help not found.'), 406 406 wxOK | wxCENTRE | wxICON_INFORMATION -
trunk/Padre/lib/Padre/Wx/Editor.pm
r11106 r11120 44 44 # Brace* methods 45 45 # always altern opening and starting braces in the constant 46 my $BRACES = '{}[]()';47 my $STC_INVALID_POSITION = Wx::wxSTC_INVALID_POSITION;46 my $BRACES = '{}[]()'; 47 my $STC_INVALID_POSITION = Wx::wxSTC_INVALID_POSITION; 48 48 49 49 my $data; … … 169 169 # return the character at a given position as a perl string 170 170 sub get_character_at { 171 my ( $self, $pos) = @_;171 my ( $self, $pos ) = @_; 172 172 return chr( $self->GetCharAt($pos) ); 173 173 } … … 424 424 425 425 426 427 428 429 426 430 427 … … 456 453 457 454 sub get_brace_info { 458 my ( $self, $pos) = @_;455 my ( $self, $pos ) = @_; 459 456 $pos = $self->GetCurrentPos unless defined $pos; 460 457 461 458 # try the after position first (default one for BraceMatch) 462 459 my $is_after = 1; 463 my $brace = $self->get_character_at($pos);460 my $brace = $self->get_character_at($pos); 464 461 my $is_brace = $self->get_brace_type($brace); 465 if ( !$is_brace && $pos > 0) { # try the before position466 $brace = $self->get_character_at(--$pos);467 $is_brace = $self->get_brace_type($brace) or return undef;462 if ( !$is_brace && $pos > 0 ) { # try the before position 463 $brace = $self->get_character_at( --$pos ); 464 $is_brace = $self->get_brace_type($brace) or return undef; 468 465 $is_after = 0; 469 466 } 470 467 my $is_opening = $is_brace % 2; # odd values are opening 471 return [ $pos, $brace, $is_after, $is_opening];468 return [ $pos, $brace, $is_after, $is_opening ]; 472 469 } 473 470 … … 485 482 486 483 =cut 484 487 485 my %_cached_braces; 486 488 487 sub get_brace_type { 489 my ( $self, $char) = @_;488 my ( $self, $char ) = @_; 490 489 unless (%_cached_braces) { 491 490 my $i = 1; # start from one so that all values are true 492 $_cached_braces{$_} = $i++ foreach ( split //, $BRACES);491 $_cached_braces{$_} = $i++ foreach ( split //, $BRACES ); 493 492 } 494 493 my $v = $_cached_braces{$char} or return 0; … … 501 500 # {} : never highlighted 502 501 # { } : always correct 503 #504 502 # 503 # 505 504 506 505 sub apply_style { 507 my ( $self, $style_info) = @_;506 my ( $self, $style_info ) = @_; 508 507 my %previous_style = %$style_info; 509 $previous_style{style} = $self->GetStyleAt( $style_info->{start});510 508 $previous_style{style} = $self->GetStyleAt( $style_info->{start} ); 509 511 510 $self->StartStyling( $style_info->{start}, 0xFF ); 512 511 $self->SetStyling( $style_info->{len}, $style_info->{style} ); 513 512 514 513 return \%previous_style; 515 514 } … … 517 516 518 517 my $previous_expr_hiliting_style; 518 519 519 sub highlight_braces { 520 520 my ($self) = @_; 521 521 522 522 my $expression_highlighting = $self->get_config->editor_brace_expression_highlighting; 523 523 524 524 # remove current highlighting if any 525 $self->BraceHighlight( $STC_INVALID_POSITION, $STC_INVALID_POSITION );525 $self->BraceHighlight( $STC_INVALID_POSITION, $STC_INVALID_POSITION ); 526 526 if ($previous_expr_hiliting_style) { 527 527 $self->apply_style($previous_expr_hiliting_style); 528 528 $previous_expr_hiliting_style = undef; 529 529 } 530 531 my $pos1 = $self->GetCurrentPos;532 my $info1 = $self->get_brace_info($pos1) or return;530 531 my $pos1 = $self->GetCurrentPos; 532 my $info1 = $self->get_brace_info($pos1) or return; 533 533 my ($actual_pos1) = @$info1; 534 534 535 535 my $actual_pos2 = $self->BraceMatch($actual_pos1); 536 # return if abs( $pos1 - $pos2 ) < 2; 536 537 # return if abs( $pos1 - $pos2 ) < 2; 537 538 538 539 return if $actual_pos2 == $STC_INVALID_POSITION; #Wx::wxSTC_INVALID_POSITION #???? 539 540 540 541 $self->BraceHighlight( $actual_pos1, $actual_pos2 ); 541 542 542 543 if ($expression_highlighting) { 543 my $pos2 = $self->find_matching_brace($pos1) or return; 544 my %style = (start => $pos1 < $pos2 ? $pos1 : $pos2, 545 len => abs($pos1-$pos2), style => Wx::wxSTC_STYLE_DEFAULT); 546 $previous_expr_hiliting_style = $self->apply_style(\%style); 544 my $pos2 = $self->find_matching_brace($pos1) or return; 545 my %style = ( 546 start => $pos1 < $pos2 ? $pos1 : $pos2, 547 len => abs( $pos1 - $pos2 ), style => Wx::wxSTC_STYLE_DEFAULT 548 ); 549 $previous_expr_hiliting_style = $self->apply_style( \%style ); 547 550 } 548 551 … … 564 567 565 568 =cut 569 566 570 sub find_matching_brace { 567 my ( $self, $pos) = @_;571 my ( $self, $pos ) = @_; 568 572 $pos = $self->GetCurrentPos unless defined $pos; 569 573 my $info1 = $self->get_brace_info($pos) or return; 570 my ( $actual_pos1, $brace, $is_after, $is_opening) = @$info1;571 574 my ( $actual_pos1, $brace, $is_after, $is_opening ) = @$info1; 575 572 576 my $actual_pos2 = $self->BraceMatch($actual_pos1); 573 577 return if $actual_pos2 == $STC_INVALID_POSITION; … … 587 591 588 592 =cut 593 589 594 sub goto_matching_brace { 590 my ( $self, $pos) = @_;591 my $pos2 = $self->find_matching_brace($pos) or return;595 my ( $self, $pos ) = @_; 596 my $pos2 = $self->find_matching_brace($pos) or return; 592 597 $self->GotoPos($pos2); 593 598 } … … 606 611 607 612 sub select_to_matching_brace { 608 my ( $self, $pos) = @_;613 my ( $self, $pos ) = @_; 609 614 $pos = $self->GetCurrentPos unless defined $pos; 610 my $pos2 = $self->find_matching_brace($pos) or return;611 my $start = ( $pos < $pos2) ? $self->GetSelectionStart() : $self->GetSelectionEnd();612 $self->SetSelection( $start, $pos2);613 614 } 615 615 my $pos2 = $self->find_matching_brace($pos) or return; 616 my $start = ( $pos < $pos2 ) ? $self->GetSelectionStart() : $self->GetSelectionEnd(); 617 $self->SetSelection( $start, $pos2 ); 618 619 } 620 616 621 # currently if there are 9 lines we set the margin to 1 width and then 617 622 # if another line is added it is not seen well. -
trunk/Padre/lib/Padre/Wx/Main.pm
r11105 r11120 109 109 # the previous size is completely suspect. 110 110 if ( $config->main_maximized ) { 111 $style |= Wx::wxMAXIMIZE;111 $style |= Wx::wxMAXIMIZE; 112 112 $size = [ -1, -1 ]; 113 113 $position = [ -1, -1 ]; … … 117 117 if ( $size->[0] == -1 ) { 118 118 require Padre::Wx::Display; 119 my $rect = Padre::Wx::Display::primary_default();119 my $rect = Padre::Wx::Display::primary_default(); 120 120 $size = $rect->GetSize; 121 121 $position = $rect->GetPosition; … … 352 352 $manager->alert_new; 353 353 354 unless ( $Padre::Test::VERSION) {354 unless ($Padre::Test::VERSION) { 355 355 require Padre::Wx::Dialog::WhereFrom; 356 356 Padre::Wx::Dialog::WhereFrom->new($self); -
trunk/Padre/lib/Padre/Wx/Menu/Edit.pm
r11110 r11120 163 163 'edit.brace_match', 164 164 ); 165 165 166 166 $self->{brace_match_select} = $self->add_menu_action( 167 167 $self, -
trunk/Padre/lib/Padre/Wx/Right.pm
r11099 r11120 16 16 17 17 sub new { 18 my $class = shift;19 my $main = shift;20 my $aui = $main->aui;18 my $class = shift; 19 my $main = shift; 20 my $aui = $main->aui; 21 21 my $unlock = $main->config->main_lockinterface ? 0 : 1; 22 22 -
trunk/Padre/t/07-version.t
r11072 r11120 10 10 # Search for Padre version 11 11 use_ok('Padre'); 12 ok( $Padre::VERSION,'Check Padre module version');12 ok( $Padre::VERSION, 'Check Padre module version' ); 13 13 14 14 my $ext_vers = `$^X script/padre --version`; 15 like( $ext_vers,qr/Perl Application Development and Refactoring Environment/,'Version string text');16 like( $ext_vers,qr/$Padre::VERSION/,'Version number');15 like( $ext_vers, qr/Perl Application Development and Refactoring Environment/, 'Version string text' ); 16 like( $ext_vers, qr/$Padre::VERSION/, 'Version number' );
