kopia lustrzana https://github.com/jamescoxon/dl-fldigi
QSO log focus fixes
Fixed Enter refocus inhibit for Loc field Fixed refocus inhibit under certain conditions for Call fieldpull/2/head
rodzic
554d5e1ecc
commit
75096a9049
|
@ -706,13 +706,8 @@ void cb_init_mode(Fl_Widget *, void *mode)
|
|||
}
|
||||
|
||||
|
||||
void restoreFocus(Fl_Widget* w)
|
||||
void restoreFocus()
|
||||
{
|
||||
if (w && Fl::event_inside(w) && Fl::event() == FL_KEYBOARD) {
|
||||
int k = Fl::event_key();
|
||||
if (k != FL_Enter && k != FL_KP_Enter)
|
||||
return;
|
||||
}
|
||||
TransmitText->take_focus();
|
||||
}
|
||||
|
||||
|
@ -1315,8 +1310,14 @@ void cb_loc(Fl_Widget* w, void*)
|
|||
{
|
||||
oktoclear = false;
|
||||
|
||||
if (!inpLoc->size() || !progdefaults.autofill_qso_fields)
|
||||
return restoreFocus(w);
|
||||
int k = Fl::event_key();
|
||||
if (k == FL_Tab) return;
|
||||
int ev = Fl::event();
|
||||
if (!inpLoc->size() || ev != FL_KEYBOARD || k == FL_Enter || k == FL_KP_Enter)
|
||||
restoreFocus();
|
||||
|
||||
if (!progdefaults.autofill_qso_fields)
|
||||
return restoreFocus();
|
||||
|
||||
double lon[2], lat[2], distance, azimuth;
|
||||
if (locator2longlat(&lon[0], &lat[0], progdefaults.myLocator.c_str()) == RIG_OK &&
|
||||
|
@ -1326,65 +1327,66 @@ void cb_loc(Fl_Widget* w, void*)
|
|||
snprintf(az, sizeof(az), "%3.0f", azimuth);
|
||||
inpAZ->value(az);
|
||||
}
|
||||
restoreFocus();
|
||||
}
|
||||
|
||||
void cb_call(Fl_Widget* w, void*)
|
||||
{
|
||||
if (!inpCall->size()) return restoreFocus(w);
|
||||
|
||||
oktoclear = false;
|
||||
|
||||
int k = Fl::event_key();
|
||||
int ev = Fl::event();
|
||||
if (ev != FL_KEYBOARD || k == FL_Enter || k == FL_KP_Enter || k == FL_Tab) {
|
||||
inpTimeOn->value(inpTimeOff->value());
|
||||
if (inpCall->size()) {
|
||||
oktoclear = false;
|
||||
if (ev != FL_KEYBOARD || k == FL_Enter || k == FL_KP_Enter || k == FL_Tab) {
|
||||
inpTimeOn->value(inpTimeOff->value());
|
||||
|
||||
if (progdefaults.calluppercase) {
|
||||
int n = inpCall->size();
|
||||
if (n) {
|
||||
char *ucase = new char[n + 1];
|
||||
strcpy(ucase, inpCall->value());
|
||||
for (int i = 0; i < n; i++)
|
||||
ucase[i] = toupper(ucase[i]);
|
||||
inpCall->value(ucase);
|
||||
delete [] ucase;
|
||||
if (progdefaults.calluppercase) {
|
||||
int n = inpCall->size();
|
||||
if (n) {
|
||||
char *ucase = new char[n + 1];
|
||||
strcpy(ucase, inpCall->value());
|
||||
for (int i = 0; i < n; i++)
|
||||
ucase[i] = toupper(ucase[i]);
|
||||
inpCall->value(ucase);
|
||||
delete [] ucase;
|
||||
}
|
||||
}
|
||||
|
||||
if (EnableDupCheck)
|
||||
DupCheck(inpCall->value());
|
||||
|
||||
SearchLastQSO(inpCall->value());
|
||||
|
||||
if (progdefaults.autofill_qso_fields) {
|
||||
const struct dxcc* e = dxcc_lookup(inpCall->value());
|
||||
if (e) {
|
||||
double lon, lat, distance, azimuth;
|
||||
if (locator2longlat(&lon, &lat, progdefaults.myLocator.c_str()) == RIG_OK &&
|
||||
qrb(lon, lat, -e->longitude, e->latitude, &distance, &azimuth) == RIG_OK) {
|
||||
char az[4];
|
||||
snprintf(az, sizeof(az), "%3.0f", azimuth);
|
||||
inpAZ->value(az);
|
||||
}
|
||||
inpCountry->value(e->country);
|
||||
inpCountry->position(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (k == FL_Tab) return;
|
||||
}
|
||||
|
||||
if (EnableDupCheck)
|
||||
DupCheck(inpCall->value());
|
||||
|
||||
SearchLastQSO(inpCall->value());
|
||||
if (k == FL_Enter || k == FL_KP_Enter)
|
||||
return restoreFocus(w);
|
||||
if (k == FL_Tab)
|
||||
inpName->take_focus();
|
||||
}
|
||||
|
||||
if (!progdefaults.autofill_qso_fields)
|
||||
return;
|
||||
|
||||
const struct dxcc* e = dxcc_lookup(inpCall->value());
|
||||
if (!e)
|
||||
return;
|
||||
|
||||
double lon, lat, distance, azimuth;
|
||||
if (locator2longlat(&lon, &lat, progdefaults.myLocator.c_str()) == RIG_OK &&
|
||||
qrb(lon, lat, -e->longitude, e->latitude, &distance, &azimuth) == RIG_OK) {
|
||||
char az[4];
|
||||
snprintf(az, sizeof(az), "%3.0f", azimuth);
|
||||
inpAZ->value(az);
|
||||
}
|
||||
|
||||
inpCountry->value(e->country);
|
||||
inpCountry->position(0);
|
||||
|
||||
if (ev != FL_KEYBOARD || k == FL_Enter || k == FL_KP_Enter)
|
||||
restoreFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
void cb_log(Fl_Widget* w, void*)
|
||||
{
|
||||
oktoclear = false;
|
||||
restoreFocus(w);
|
||||
int k = Fl::event_key();
|
||||
int ev = Fl::event();
|
||||
if (k == FL_Tab) return;
|
||||
if (!((Fl_Input2 *)w)->size() || ev != FL_KEYBOARD || k == FL_Enter || k == FL_KP_Enter)
|
||||
restoreFocus();
|
||||
}
|
||||
|
||||
void qsoClear_cb(Fl_Widget *b, void *)
|
||||
|
@ -2432,7 +2434,8 @@ void create_fl_digi_main() {
|
|||
inpSerNo, outSerNo, inpXchg1, inpXchg2, inpXchg3 };
|
||||
for (size_t i = 0; i < sizeof(logfields)/sizeof(*logfields); i++) {
|
||||
logfields[i]->callback(cb_log);
|
||||
logfields[i]->when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED | FL_WHEN_ENTER_KEY);
|
||||
logfields[i]->when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED | FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE);
|
||||
// logfields[i]->when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED | FL_WHEN_ENTER_KEY);
|
||||
}
|
||||
// exceptions
|
||||
inpCall->callback(cb_call);
|
||||
|
|
|
@ -179,7 +179,7 @@ extern void resetOLIVIA();
|
|||
extern void resetTHOR();
|
||||
extern void resetDOMEX();
|
||||
extern void resetSoundCard();
|
||||
extern void restoreFocus(Fl_Widget* w = 0);
|
||||
extern void restoreFocus();
|
||||
extern void setReverse(int);
|
||||
extern void clearQSO();
|
||||
extern void closeRigDialog();
|
||||
|
|
Ładowanie…
Reference in New Issue