//============================================================================== void TGJVQSOLogFrame::transferDetails( const BaseContact * lct, const BaseContestLog *matct ) { CallsignEdit->Text = lct->cs.fullCall.getValue().c_str(); LocEdit->Text = lct->loc.loc.getValue().c_str(); // also forces update of score etc // only transfer qth info if required for this ContestLog // and it might be valid... if ( contest->districtMult.getValue() || contest->otherExchange.getValue() ) { if ( ( contest->districtMult.getValue() && matct->districtMult.getValue() ) || ( contest->otherExchange.getValue() && matct->otherExchange.getValue() ) ) { if ( contest->QTHField.getValue() ) QTHEdit->Text = lct->extraText.getValue().c_str(); } } valid( cmCheckValid ); // make sure all single and cross field // validation has been done // make sure dtg gets entered if needed CallsignEdit->SetFocus(); doAutofill(); CallsignEdit->SetFocus(); }
void TGJVQSOLogFrame::transferDetails( const ListContact * lct, const ContactList */*matct*/ ) { CallsignEdit->Text = lct->cs.fullCall.getValue().c_str(); LocEdit->Text = lct->loc.loc.getValue().c_str(); // also forces update of score etc valid( cmCheckValid ); // make sure all single and cross field // validation has been done // make sure dtg gets entered if needed CallsignEdit->SetFocus(); doAutofill(); CallsignEdit->SetFocus(); }
bool EditorClientImpl::autofill(HTMLInputElement* inputElement, bool autofillFormOnly, bool autofillOnEmptyValue, bool requireCaretAtEnd) { // Cancel any pending DoAutofill call. m_autofillArgs.clear(); m_autofillTimer.stop(); // FIXME: Remove the extraneous isEnabledFormControl call below. // Let's try to trigger autofill for that field, if applicable. if (!inputElement->isEnabledFormControl() || !inputElement->isTextField() || inputElement->isPasswordField() || !inputElement->autoComplete() || !inputElement->isEnabledFormControl() || inputElement->isReadOnlyFormControl()) return false; WebString name = WebInputElement(inputElement).nameForAutofill(); if (name.isEmpty()) // If the field has no name, then we won't have values. return false; // Don't attempt to autofill with values that are too large. if (inputElement->value().length() > maximumTextSizeForAutofill) return false; m_autofillArgs = new AutofillArgs(); m_autofillArgs->inputElement = inputElement; m_autofillArgs->autofillFormOnly = autofillFormOnly; m_autofillArgs->autofillOnEmptyValue = autofillOnEmptyValue; m_autofillArgs->requireCaretAtEnd = requireCaretAtEnd; m_autofillArgs->backspaceOrDeletePressed = m_backspaceOrDeletePressed; if (!requireCaretAtEnd) doAutofill(0); else { // We post a task for doing the autofill as the caret position is not set // properly at this point (http://bugs.webkit.org/show_bug.cgi?id=16976) // and we need it to determine whether or not to trigger autofill. m_autofillTimer.startOneShot(0.0); } return true; }
void __fastcall TGJVEditFrame::EditControlExit( TObject */*Sender*/ ) { // proxied? DateEdit->ReadOnly = !contest->isPostEntry(); TimeEdit->ReadOnly = !contest->isPostEntry(); SerTXEdit->ReadOnly = true; SerTXEdit->Color = clBtnFace; TLabeledEdit *tle = dynamic_cast<TLabeledEdit *>( current ); if ( tle ) { tle->EditLabel->Font->Color = clWindowText; } if ( ( current == CallsignEdit ) || ( current == LocEdit ) ) { valid( cmCheckValid ); // make sure all single and cross field doAutofill(); } MinosParameters::getMinosParameters() ->showErrorList( ); editScreen->reportOverstrike( overstrike ); }
//--------------------------------------------------------------------------- void TGJVEditFrame::selectField( TWinControl *v ) { int dtgne = -1; bool pe = contest->isPostEntry(); if ( pe ) { dtgne = screenContact.time.notEntered(); } if ( v == 0 ) { if ( contest->isReadOnly() ) { v = CallsignEdit; } else if ( pe ) { v = ( ( dtgne != -1 ) && ( dtgne <= 1 ) ) ? DateEdit : TimeEdit; } else if ( screenContact.contactFlags & TO_BE_ENTERED ) v = TimeEdit; else v = CallsignEdit; } if ( !v || ( current == v ) ) return ; if ( ( current == CallsignEdit ) || ( current == LocEdit ) ) { valid( cmCheckValid ); // make sure all single and cross field doAutofill(); } if ( v == TimeEdit ) { ( ( TLabeledEdit * ) v ) ->ReadOnly = false; ( ( TLabeledEdit * ) v ) ->Color = clWindow; if (dtgne == 0 || dtgne == 1) { if (pe) { #warning get start time from either of previous contact OR contest start time } else { TimeEdit->SelStart = 0; TimeEdit->SelLength = 1; } } } if ( v == DateEdit ) { ( ( TLabeledEdit * ) v ) ->ReadOnly = false; ( ( TLabeledEdit * ) v ) ->Color = clWindow; if (dtgne == 0 || dtgne == 2) { if (pe) { #warning get start date from either of previous contact OR contest start date } else { DateEdit->SelStart = 0; DateEdit->SelLength = 1; } } } if ( v == SerTXEdit ) { ( ( TLabeledEdit * ) v ) ->ReadOnly = false; ( ( TLabeledEdit * ) v ) ->Color = clWindow; } if ( v->Enabled ) { v->SetFocus(); current = v; } MinosParameters::getMinosParameters() ->showErrorList( ); }
//--------------------------------------------------------------------------- bool TGJVEditFrame::doGJVOKButtonClick( TObject *Sender ) { DateEdit->ReadOnly = !contest->isPostEntry(); TimeEdit->ReadOnly = !contest->isPostEntry(); SerTXEdit->ReadOnly = true; SerTXEdit->Color = clBtnFace; if ( contest->isReadOnly() ) { return true; } GJVEditChange( Sender ); // start the match thread getScreenEntry(); // make sure it is saved if ( screenContact.contactFlags & ( LOCAL_COMMENT | DONT_PRINT | COMMENT_ONLY ) ) { logCurrentContact( false ); return true; } // validate the entry; if still invalid, spin round the invalid // controls (this should really be the job of tab, but...) TWinControl *currn = current; if ( !valid( cmCheckValid ) || ( currn == RSTTXEdit ) || ( currn == RSTRXEdit ) ) // make sure all single and cross field // validation has been done { doAutofill(); } bool was_unfilled = screenContact.contactFlags & TO_BE_ENTERED; if ( !valid( cmCheckValid ) ) // make sure all single and cross field // validation has been done { TWinControl * firstInvalid = 0; TWinControl *nextInvalid = 0; bool onCurrent = false; bool pastCurrent = false; for ( std::vector <ValidatedControl *>::iterator vcp = vcs.begin(); vcp != vcs.end(); vcp++ ) { if ( ( *vcp ) ->wc->ReadOnly || !( *vcp ) ->wc->Visible ) { continue; } if ( onCurrent ) pastCurrent = true; if ( ( *vcp ) ->wc == current ) onCurrent = true; if ( !( *vcp ) ->valid( cmValidStatus ) ) { if ( !firstInvalid ) firstInvalid = ( *vcp ) ->wc; if ( pastCurrent ) { if ( !nextInvalid ) { nextInvalid = ( *vcp ) ->wc; break; } } } } // make sure we go to the invalid field TWinControl *nextf = ( nextInvalid ) ? nextInvalid : firstInvalid; // but if it is DTG, probably want CS instead (Unless post entry) if ( ( nextf == TimeEdit ) || ( nextf == DateEdit ) ) { bool pe = contest->isPostEntry(); if ( !pe && screenContact.time.notEntered() == 0 ) { selectField( CallsignEdit ); nextf = 0; // dont show silly errors! if ( screenContact.cs.validate( ) == CS_OK ) { doAutofill(); //?????????????????????? return doGJVOKButtonClick( Sender ); } } } if ( nextf ) { if ( nextf == current ) { if ( firstInvalid != nextf ) selectField( firstInvalid ); else dlgForced(); // repeated attack on same faulty field } else selectField( nextf ); } // Show on errList on multdisp frame MinosParameters::getMinosParameters() ->showErrorList( ); return false ; } else { screenContact.contactFlags &= ~( TO_BE_ENTERED | FORCE_LOG ); } // all is OK (or we will have executed a return statement) // so do it! // we have to check if we need to save it // checkLogEntry does the log action as well if ( !was_unfilled && selectedContact ) // AND if we are logging "current" then we don't want to do this { if ( !checkLogEntry() ) // if it is the same, then don't log { return false; } } else { logCurrentContact( false ); } selectField( 0 ); // make sure we move off the "Log" default button return true; }
//--------------------------------------------------------------------------- void TGJVQSOEditFrame::selectField( TWinControl *v ) { int dtgne = -1; if ( catchup ) { dtgne = screenContact.time.notEntered(); } if ( v == 0 ) { if ( contest->isReadOnly() ) { v = CallsignEdit; } else if ( catchup ) { v = ( ( dtgne != -1 ) && ( dtgne <= 1 ) ) ? DateEdit : TimeEdit; } else if ( screenContact.contactFlags & TO_BE_ENTERED ) v = TimeEdit; else v = CallsignEdit; } if ( !v || ( current == v ) ) { if (v) v->SetFocus(); return ; } if ( ( current == CallsignEdit ) || ( current == LocEdit ) ) { valid( cmCheckValid ); // make sure all single and cross field doAutofill(); } if ( v == TimeEdit ) { ( ( TLabeledEdit * ) v ) ->ReadOnly = false; ( ( TLabeledEdit * ) v ) ->Color = clWindow; if (dtgne == 0 || dtgne == 1) { TimeEdit->SelStart = 0; TimeEdit->SelLength = 1; } } if ( v == DateEdit ) { ( ( TLabeledEdit * ) v ) ->ReadOnly = false; ( ( TLabeledEdit * ) v ) ->Color = clWindow; if (dtgne == 0 || dtgne == 2) { DateEdit->SelStart = 0; DateEdit->SelLength = 1; } } if ( v == SerTXEdit ) { ( ( TLabeledEdit * ) v ) ->ReadOnly = false; ( ( TLabeledEdit * ) v ) ->Color = clWindow; } if ( v->Enabled ) { v->SetFocus(); current = v; } MinosLoggerEvents::SendShowErrorList(); }