Changeset 10035
- Timestamp:
- 01/02/10 01:52:06 (8 months ago)
- Files:
-
- 1 modified
-
trunk/Padre/lib/Padre/Wx/Editor.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Wx/Editor.pm
r10023 r10035 813 813 sub on_smart_highlight_begin { 814 814 my ( $self, $event ) = @_; 815 815 816 my $selection = $self->GetSelectedText; 816 817 $self->put_text_to_clipboard($selection, 1);818 817 my $selection_length = length $selection; 819 818 return if $selection_length == 0; … … 855 854 } 856 855 } 857 856 858 857 } 859 858 … … 871 870 if ( Padre::Constant::WXGTK and defined $text and $text ne '' ) { 872 871 873 874 $self->put_text_to_clipboard($text,1); 875 876 872 # Only on X11 based platforms 873 # Wx::wxTheClipboard->UsePrimarySelection(1); 874 $self->put_text_to_clipboard($text); 875 876 # Wx::wxTheClipboard->UsePrimarySelection(0); 877 877 } 878 878 … … 892 892 # It seems that another event is doing something but not within this module. 893 893 # Please look at ticket #390 for details! 894 Wx::wxTheClipboard->UsePrimarySelection(1); 895 if (Padre::Constant::WIN32) 896 { 897 Padre::Current->editor->Paste; 898 } 899 894 895 Padre::Current->editor->Paste; 896 900 897 my $doc = $self->{Document}; 901 898 if ( $doc->can('event_on_middle_up') ) { 902 899 $doc->event_on_middle_up( $self, $event ); 903 900 } 904 Wx::wxTheClipboard->UsePrimarySelection(0); 901 905 902 $event->Skip; 906 903 return; 907 904 } 905 908 906 # Manipulate the window manager selection buffer when editor looses focus 909 907 sub on_kill_focus { … … 1061 1059 sub Paste { 1062 1060 my $self = shift; 1063 1061 1062 # Workaround for Copy/Paste bug ticket #390 1064 1063 my $text = $self->get_text_from_clipboard; 1065 1064 1066 1065 if ($text) { 1067 1066 … … 1126 1125 } 1127 1126 1128 # put_text_to_clipboard1129 # $self->put_text_to_clipboard($text, $clipboard_Number )1130 # where X11 based display systems1131 # clipboard number is either the GTK clipboard or the X111132 # clipboard. Clipboard 1 is used for normal X11 copy onselect and1133 # paste on middle button. Has no affect on windows.1134 # Puts Text on the clipboard1135 1136 1127 sub put_text_to_clipboard { 1137 my ( $self, $text , $clipboard) = @_;1128 my ( $self, $text ) = @_; 1138 1129 @_ = (); # Feeble attempt to kill Scalars Leaked 1139 1140 1141 if (!defined($clipboard)){ 1142 $clipboard = 0 ; 1143 } 1144 1145 if ($text eq ''){return;} 1130 1131 return if $text eq ''; 1132 1146 1133 # Backup last clipboard value: 1147 1134 $self->{Clipboard_Old} = $self->get_text_from_clipboard; 1148 1149 1150 1135 1136 # if $self->{Clipboard_Old} ne $self->get_text_from_clipboard; 1137 1151 1138 Wx::wxTheClipboard->Open; 1152 Wx::wxTheClipboard->UsePrimarySelection($clipboard);1153 1139 Wx::wxTheClipboard->SetData( Wx::TextDataObject->new($text) ); 1154 1140 Wx::wxTheClipboard->Close; 1155 1141 1156 1142 return; 1157 1143 } … … 1160 1146 1161 1147 my $self = shift; 1162 1148 1163 1149 my $text = ''; 1164 1150 Wx::wxTheClipboard->Open;
