ODDRDialogImpl::ODDRDialogImpl( wxWindow* parent ) : ODDRDialogDef( parent ) { #if wxCHECK_VERSION(3,0,0) wxFloatingPointValidator<double> dSOGVal(3, &m_dSOGValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dLengthVal(3, &m_dLengthValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dIntervalVal(3, &m_dIntervalValidator, wxNUM_VAL_DEFAULT); wxIntegerValidator<int> iCOGVal(&m_iCOGValidator, wxNUM_VAL_DEFAULT); dSOGVal.SetMin(0); dLengthVal.SetMin(0); dIntervalVal.SetMin(0); iCOGVal.SetRange(0, 360); m_textCtrlSOG->SetValidator( dSOGVal ); m_textCtrlCOG->SetValidator( iCOGVal ); m_textCtrlLength->SetValidator( dLengthVal ); m_textCtrlDRPointInterval->SetValidator( dIntervalVal ); m_dSOGValidator = g_dDRSOG; m_iCOGValidator = g_iDRCOG; m_dLengthValidator = g_dDRLength; m_dIntervalValidator = g_dDRPointInterval; #else wxString s; s.Printf( _T("%.3f"), g_dDRLength ); m_textCtrlLength->SetValue( s ); if(g_bShowMag && !wxIsNaN(g_dVar)) s.Printf( _T("Course over Ground %s"), _T("(M)") ); else s.Printf( _T("Course over Ground %s"), _T("(T)") ); m_staticTextCOG->SetLabel( s ); s.Printf( _T("%.3f"), g_dDRPointInterval ); m_textCtrlDRPointInterval->SetValue( s ); m_radioBoxLengthType->SetSelection( g_iDRLengthType ); m_radioBoxIntervalType->SetSelection( g_iDRIntervalType ); m_radioBoxDistanceUnits->SetSelection( g_iDRDistanceUnits ); m_radioBoxTimeUnits->SetSelection( g_iDRTimeUnits ); if(g_pfFix.Sog != g_pfFix.Sog ) s.Printf( _T("%.3f"), g_dDRSOG ); else s.Printf( _T("%.3f"), g_pfFix.Sog ); m_textCtrlSOG->SetValue( s ); if(g_pfFix.Cog != g_pfFix.Cog ) s.Printf( _T("%i"), g_iDRCOG ); else s.Printf( _T("%.3f"), g_pfFix.Cog ); m_textCtrlCOG->SetValue( s ); #endif m_pDR = NULL; this->Layout(); }
ODPropertiesDialogImpl::ODPropertiesDialogImpl( wxWindow* parent ) : ODPropertiesDialogDef( parent ) { m_staticTextNameVal->SetLabel( wxT("OpenCPN Draw Plugin") ); m_staticTextMajorVal->SetLabel(wxString::Format(wxT("%i"), PLUGIN_VERSION_MAJOR )); m_staticTextMinorVal->SetLabel(wxString::Format(wxT("%i"), PLUGIN_VERSION_MINOR )); m_staticTextPatchVal->SetLabel( wxT(TOSTRING(PLUGIN_VERSION_PATCH)) ); m_staticTextDateVal->SetLabel( wxT(TOSTRING(PLUGIN_VERSION_DATE)) ); m_gridODWDInteractions->SetCellValue(0, 0, _("OD\\WD")); m_gridODWDInteractions->SetCellValue(0, 1, _("All")); m_gridODWDInteractions->SetCellValue(0, 2, _("Exclusion")); m_gridODWDInteractions->SetCellValue(0, 3, _("Inclusion")); m_gridODWDInteractions->SetCellValue(0, 4, _("Neither ")); m_gridODWDInteractions->SetCellValue(1, 0, _("Exclusion")); m_gridODWDInteractions->SetCellValue(2, 0, _("Inclusion")); m_gridODWDInteractions->SetCellValue(3, 0, _("Neither ")); m_gridODWDInteractions->SetCellValue(1, 1, _("Ring")); m_gridODWDInteractions->SetCellValue(2, 1, _("Ring")); m_gridODWDInteractions->SetCellValue(3, 1, _("Ring")); m_gridODWDInteractions->SetCellValue(1, 2, _("Ring")); m_gridODWDInteractions->SetCellValue(2, 2, _("No alarm")); m_gridODWDInteractions->SetCellValue(3, 2, _("No alarm")); m_gridODWDInteractions->SetCellValue(1, 3, _("No alarm")); m_gridODWDInteractions->SetCellValue(2, 3, _("Ring")); m_gridODWDInteractions->SetCellValue(3, 3, _("No alarm")); m_gridODWDInteractions->SetCellValue(1, 4, _("No alarm")); m_gridODWDInteractions->SetCellValue(2, 4, _("No alarm")); m_gridODWDInteractions->SetCellValue(3, 4, _("Ring")); SetTableCellBackgroundColours(); m_pfdDialog = NULL; #if wxCHECK_VERSION(3,0,0) && not defined(_WXMSW_) wxFloatingPointValidator<double> dODPointRangeRingStepVal(3, &m_dODPointRangRingStepValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dODPointArrivalRadiusVal(3, &m_dODPointArrivalRadiusValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dDRPathLengthVal(3, &m_dDRPathLengthValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dDRPointIntervalVal(3, &m_dODPointIntervalValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dDRPointRangeRingStepVal(3, &m_dDRPointRangRingStepValidator, wxNUM_VAL_DEFAULT); wxFloatingPointValidator<double> dSOGVal(3, &m_dSOGValidator, wxNUM_VAL_DEFAULT); wxIntegerValidator<int> iCOGVal(&m_iCOGValidator, wxNUM_VAL_DEFAULT); dODPointRangeRingStepVal.SetMin(0); dODPointArrivalRadiusVal.SetMin(0); dDRPathLengthVal.SetMin(0); dDRPointIntervalVal.SetMin(0); dDRPointRangeRingStepVal.SetMin(0); dSOGVal.SetMin(0); iCOGVal.SetRange(0, 360); m_textCtrlODPointRangeRingSteps->SetValidator( dODPointRangeRingStepVal ); m_textCtrlODPointArrivalRadius->SetValidator( dODPointArrivalRadiusVal ); m_textCtrlSOG->SetValidator( dSOGVal ); m_textCtrlCOG->SetValidator( iCOGVal ); m_textCtrlDRPathLength->SetValidator( dDRPathLengthVal ); m_textCtrlDRPointInterval->SetValidator( dDRPointIntervalVal ); m_textCtrlDRPointRangeRingSteps->SetValidator( dDRPointRangeRingStepVal ); int l_iPage = m_notebookProperties->FindPage(m_panelPath); m_notebookProperties->DeletePage(l_iPage); #else for(size_t i = 0; i < m_notebookProperties->GetPageCount(); i++) { if(m_notebookProperties->GetPageText(i) == _("Path")) { m_notebookProperties->DeletePage(i); break; } } #endif SetDialogSize(); }