void WeatherRouting::OnNew( wxCommandEvent& event ) { RouteMapConfiguration configuration; if(CurrentRouteMap()) configuration = CurrentRouteMap()->GetConfiguration(); else configuration = DefaultConfiguration(); #if 0 /* to have a unique name */ for(int idx = 0;;idx++) { wxString name = configuration.Name; wxString n1 = name.BeforeLast('-'), n2 = name.AfterLast('-'); long l; if(n1.size() && n2.ToLong(&l)) name = n1; if(idx > 0) name += wxString::Format(_T("-%d"), idx); for(int i=0; i<m_lWeatherRoutes->GetItemCount(); i++) { WeatherRoute *weatherroute = reinterpret_cast<WeatherRoute*>(wxUIntToPtr(m_lWeatherRoutes->GetItemData(i))); RouteMapConfiguration c = weatherroute->routemapoverlay->GetConfiguration(); if(c.Name == name) goto outer_continue; } configuration.Name = name; break; outer_continue: } #endif AddConfiguration(configuration); m_lWeatherRoutes->SetItemState(m_lWeatherRoutes->GetItemCount() - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); OnEditConfiguration(); } void WeatherRouting::OnBatch( wxCommandEvent& event ) { m_ConfigurationBatchDialog.Reset(); m_ConfigurationBatchDialog.Show(); }
static void configure() { DefaultConfiguration()(); }