Changeset 5575


Ignore:
Timestamp:
06/25/09 03:52:43 (3 years ago)
Author:
waxhead
Message:

Added 'Not Found' MessageBox? when a search fails to find a term

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Wx/Dialog/Find.pm

    r5548 r5575  
    465465        $text, $regex, $from, $to, $backwards 
    466466    ); 
    467     return unless defined $start; 
     467     
     468     
     469    if( ! defined $start ){ 
     470        $self->_not_found; 
     471        return; 
     472    }; 
    468473    $editor->SetSelection( $start, $end ); 
    469474 
     
    527532} 
    528533 
     534sub _not_found { 
     535    my( $self ) = @_; 
     536    # Want to see if not found this is  
     537    # where to show a MessageBox. 
     538    my $term   = Padre::DB::History->previous('search'); 
     539    Wx::MessageBox( 
     540        sprintf( Wx::gettext("Failed to find '%s' in current document."), $term ), 
     541        Wx::gettext('Not Found'), 
     542        Wx::wxOK, 
     543        $self, 
     544    );   
     545     
     546} 
     547 
    5295481; 
    530549 
Note: See TracChangeset for help on using the changeset viewer.