Changeset 10022


Ignore:
Timestamp:
12/28/09 18:41:44 (2 years ago)
Author:
submersible_toaster
Message:

indirectly related to issues discussed in #390 , put the selection to the X11 buffer when the editor looses focus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Wx/Editor.pm

    r10021 r10022  
    7474    Wx::Event::EVT_SET_FOCUS( $self, \&on_focus ); 
    7575    Wx::Event::EVT_MIDDLE_UP( $self, \&on_middle_up ); 
    76  
     76    Wx::Event::EVT_KILL_FOCUS( $self, \&on_kill_focus ); 
    7777    # Smart highlighting: 
    7878    # Selecting a word or small block of text causes all other occurrences to be highlighted 
     
    904904} 
    905905 
     906# Manipulate the window manager selection buffer when editor looses focus 
     907sub on_kill_focus { 
     908    my ($self,$event) = @_; 
     909    if ( Padre::Constant::WXGTK ) { 
     910        my $selection = $self->GetSelectedText; 
     911        Wx::wxTheClipboard->Open; 
     912        Wx::wxTheClipboard->UsePrimarySelection(1); 
     913        my $clip = Wx::TextDataObject->new; 
     914        $clip->SetText($selection); 
     915        Wx::wxTheClipboard->SetData($clip); 
     916        Wx::wxTheClipboard->UsePrimarySelection(0); 
     917        Wx::wxTheClipboard->Close; 
     918    } 
     919 
     920} 
     921 
     922 
    906923sub on_right_down { 
    907924    my $self  = shift; 
Note: See TracChangeset for help on using the changeset viewer.