From fe315583d23312199d3295913ea3f47da016cded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arvo=20J=C3=A4rve?= Date: Mon, 20 May 2013 17:51:52 -0500 Subject: [PATCH] Double Click bug fix * Double click text selection for transfer to QSO record fields --- src/include/fl_digi.h | 1 + src/widgets/FTextRXTX.cxx | 47 ++++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/include/fl_digi.h b/src/include/fl_digi.h index 70ade6ca..328cfc9a 100644 --- a/src/include/fl_digi.h +++ b/src/include/fl_digi.h @@ -118,6 +118,7 @@ extern Fl_Input2 *inpCall2; extern Fl_Input2 *inpCall3; extern Fl_Input2 *inpCall4; +extern Fl_Group *QsoInfoFrame1B; extern Fl_Group *qsoFrameView; extern Fl_Group *QsoButtonFrame; extern Fl_Group *QsoInfoFrame; diff --git a/src/widgets/FTextRXTX.cxx b/src/widgets/FTextRXTX.cxx index 92a29506..46d3f210 100644 --- a/src/widgets/FTextRXTX.cxx +++ b/src/widgets/FTextRXTX.cxx @@ -517,24 +517,39 @@ void FTextRX::handle_qso_data(int start, int end) Fl_Input* target = 0; - if (rst.match(s)) - target = inpRstIn; - else if (loc.match(s)) - target = inpLoc; - else if (call.match(s)) { // point p to substring - const regmatch_t& offsets = call.suboff()[1]; - p = s + offsets.rm_so; - *(s + offsets.rm_eo) = '\0'; - target = inpCall; - } - else if (count_if(s, s + strlen(s), static_cast(isdigit))) - target = inpQth; - else - target = *inpName->value() ? inpQth : inpName; + if (QsoInfoFrame1B->visible()) { + if (call.match(s)) { // point p to substring + const regmatch_t& offsets = call.suboff()[1]; + p = s + offsets.rm_so; + *(s + offsets.rm_eo) = '\0'; + inpCall->value(p); + inpCall->do_callback(); + } else { + inpXchgIn->position(inpXchgIn->size()); + if (inpXchgIn->size()) inpXchgIn->insert(" ", 1); + inpXchgIn->insert(s); + } + } else { + if (rst.match(s)) + target = inpRstIn; + else if (loc.match(s)) + target = inpLoc; + else if (call.match(s)) { // point p to substring + const regmatch_t& offsets = call.suboff()[1]; + p = s + offsets.rm_so; + *(s + offsets.rm_eo) = '\0'; + target = inpCall; + } + else if (count_if(s, s + strlen(s), static_cast(isdigit))) + target = inpQth; + else + target = *inpName->value() ? inpQth : inpName; - target->value(p); - target->do_callback(); + target->value(p); + target->do_callback(); + } free(s); + restoreFocus(NULL); }