Didn't like yesterday's fix, I changed it so that zero-length selections
are allowed. Warning: untested on WIN32 (although it seems likely that it will work). git-svn-id: file:///fltk/svn/fltk/trunk@349 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
32291ad0d5
commit
4df7511b18
@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input_.cxx,v 1.19 1999/03/01 03:44:30 bill Exp $"
|
||||
// "$Id: Fl_Input_.cxx,v 1.20 1999/03/02 07:03:14 bill Exp $"
|
||||
//
|
||||
// Common input widget routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@ -436,10 +436,7 @@ int Fl_Input_::copy() {
|
||||
} else {
|
||||
e = position(); b = mark();
|
||||
}
|
||||
if (type()!=FL_SECRET_INPUT)
|
||||
Fl::selection(*this, value()+b, e-b);
|
||||
else
|
||||
Fl::selection(*this, "*", 1);
|
||||
Fl::selection(*this, value()+b, (type()!=FL_SECRET_INPUT) ? e-b : 0);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -736,5 +733,5 @@ Fl_Input_::~Fl_Input_() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input_.cxx,v 1.19 1999/03/01 03:44:30 bill Exp $".
|
||||
// End of "$Id: Fl_Input_.cxx,v 1.20 1999/03/02 07:03:14 bill Exp $".
|
||||
//
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_cutpaste.cxx,v 1.5 1999/01/07 19:17:31 mike Exp $"
|
||||
// "$Id: Fl_cutpaste.cxx,v 1.6 1999/03/02 07:03:15 bill Exp $"
|
||||
//
|
||||
// Cut/paste code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@ -124,7 +124,7 @@ void Fl::paste(Fl_Widget &receiver) {
|
||||
|
||||
// call this when you create a selection:
|
||||
void Fl::selection(Fl_Widget &owner, const char *stuff, int len) {
|
||||
if (!stuff || len<=0) return;
|
||||
if (!stuff || len<0) return;
|
||||
if (len+1 > selection_buffer_length) {
|
||||
delete[] selection_buffer;
|
||||
selection_buffer = new char[len+100];
|
||||
@ -149,5 +149,5 @@ void Fl::selection(Fl_Widget &owner, const char *stuff, int len) {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_cutpaste.cxx,v 1.5 1999/01/07 19:17:31 mike Exp $".
|
||||
// End of "$Id: Fl_cutpaste.cxx,v 1.6 1999/03/02 07:03:15 bill Exp $".
|
||||
//
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_cutpaste_win32.cxx,v 1.4 1999/01/07 19:17:31 mike Exp $"
|
||||
// "$Id: Fl_cutpaste_win32.cxx,v 1.5 1999/03/02 07:03:15 bill Exp $"
|
||||
//
|
||||
// WIN32 cut/paste for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@ -76,7 +76,7 @@ static int selection_xevent_handler(int) {
|
||||
|
||||
// call this when you create a selection:
|
||||
void Fl::selection(Fl_Widget &owner, const char *stuff, int len) {
|
||||
if (!stuff || len<=0) return;
|
||||
if (!stuff || len<0) return;
|
||||
if (len+1 > selection_buffer_length) {
|
||||
delete[] selection_buffer;
|
||||
selection_buffer = new char[len+100];
|
||||
@ -129,5 +129,5 @@ void Fl::paste(Fl_Widget &receiver) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_cutpaste_win32.cxx,v 1.4 1999/01/07 19:17:31 mike Exp $".
|
||||
// End of "$Id: Fl_cutpaste_win32.cxx,v 1.5 1999/03/02 07:03:15 bill Exp $".
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user