Example #1
0
bool EBLProp::UpdateProperties( EBL *pInEBL )
{
    SetGlobalLocale();
    
    wxString s;

    m_checkBoxEBLFixedEndPosition->SetValue( pInEBL->m_bFixedEndPosition );
    m_radioBoxPathPersistence->SetSelection( pInEBL->m_iPersistenceType );
    m_checkBoxPathShowArrow->SetValue( pInEBL->m_bDrawArrow );
    m_checkBoxShowVRM->SetValue( pInEBL->m_bVRM );
    m_checkBoxShowEBLInfo->SetValue( pInEBL->m_bAlwaysShowInfo );
    m_checkBoxShowPerpLine->SetValue( pInEBL->m_bPerpLine );
    m_checkBoxRotateWithBoat->SetValue( pInEBL->m_bRotateWithBoat );
    m_radioBoxMaintainWith->SetSelection( pInEBL->m_iMaintainWith );
    if(pInEBL->m_bCentreOnBoat)
        m_checkBoxRotateWithBoat->Enable(true);
    else
        m_checkBoxRotateWithBoat->Enable(false);
    if(pInEBL->m_bFixedEndPosition) {
        m_radioBoxMaintainWith->Enable(false);
        m_textCtrlEBLAngle->Enable(false);
        m_textCtrlTotalLength->SetEditable(false);
    } else {
        m_radioBoxMaintainWith->Enable(true);
        m_textCtrlEBLAngle->Enable(true);
        m_textCtrlTotalLength->SetEditable(true);
    }
    
#if wxCHECK_VERSION(3,0,0) && !defined(__WXMSW__)
    if(pInEBL->m_dEBLAngle > 180)
        m_dODEBLAngleValidator = pInEBL->m_dEBLAngle - 360;
    else
        m_dODEBLAngleValidator = pInEBL->m_dEBLAngle;
    
    m_dODEBLLengthValidator = toUsrDistance_Plugin(pInEBL->m_dLength);
#else
    if(pInEBL->m_dEBLAngle > 180)
        s.Printf( _T("%.2f"), pInEBL->m_dEBLAngle - 360 );
    else
        s.Printf( _T("%.2f"), pInEBL->m_dEBLAngle );
    
    m_textCtrlEBLAngle->SetValue(s);
    
    s.Printf( _T("%5.2f"), toUsrDistance_Plugin(m_pEBL->m_dLength) );
    m_textCtrlTotalLength->SetValue(s);
#endif
    
    if(pInEBL->m_bRotateWithBoat) {
        m_checkBoxEBLFixedEndPosition->Enable(false);
    } else {
        m_checkBoxEBLFixedEndPosition->Enable(true);
    }
    
    m_bLockUpdate = false;
    
    ResetGlobalLocale();
    
    return ODPathPropertiesDialogImpl::UpdateProperties( pInEBL );
}
Example #2
0
void EBLProp::OnCancel( wxCommandEvent& event )
{
    m_bLockEBLLength = false;
    m_bLockEBLAngle = false;
    ODPathPropertiesDialogImpl::OnCancel(event);

    ResetGlobalLocale();
}
void ODPropertiesDialogImpl::OnDrawPropertiesCancelClick( wxCommandEvent& event )
{
    Show( false );
#ifdef __WXOSX__    
	EndModal(wxID_CANCEL);
#endif
    SetClientSize(m_defaultClientSize);

    ResetGlobalLocale();
    event.Skip();
}
void ODPropertiesDialogImpl::OnDrawPropertiesOKClick( wxCommandEvent& event )
{
    SaveChanges(); // write changes to globals and update config
    Show( false );
#ifdef __WXOSX__    
    EndModal(wxID_OK);
#endif
    SetClientSize(m_defaultClientSize);

    ResetGlobalLocale();
    event.Skip();
}