private void button3_Click(object sender, EventArgs e) { WaypointListItem wpi = listBox1.SelectedItem as WaypointListItem; if (wpi != null) { Framework.Data.Waypoint wp = wpi.WP; Framework.Data.Location l; if (wp.Lat != null && wp.Lon != null) { l = new Framework.Data.Location((double)wp.Lat, (double)wp.Lon); } else { l = new Framework.Data.Location(Core.ActiveGeocache.Lat, Core.ActiveGeocache.Lon); } using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, l)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox8.Text = Utils.Conversion.GetCoordinatesPresentation(dlg.Result); } } } }
private void setAdditionalCoordsToolStripMenuItem_Click(object sender, EventArgs e) { if (Core.ActiveGeocache != null) { Framework.Data.Location l = new Framework.Data.Location(); if (Core.ActiveGeocache.ContainsCustomLatLon) { l.SetLocation((double)Core.ActiveGeocache.CustomLat, (double)Core.ActiveGeocache.CustomLon); } else { l.SetLocation(Core.ActiveGeocache.Lat, Core.ActiveGeocache.Lon); } using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, l)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Core.ActiveGeocache.BeginUpdate(); Core.ActiveGeocache.CustomLat = dlg.Result.Lat; Core.ActiveGeocache.CustomLon = dlg.Result.Lon; Core.ActiveGeocache.EndUpdate(); } } } }
private void button4_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, null)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox10.Text = Utils.Conversion.GetCoordinatesPresentation(dlg.Result.Lat, dlg.Result.Lon); } } }
private void button1_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Updater._core, string.IsNullOrEmpty(textBox1.Text) ? Updater._core.CenterLocation : Utils.Conversion.StringToLocation(textBox1.Text))) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox1.Text = Utils.Conversion.GetCoordinatesPresentation(dlg.Result); } } }
private void button1_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(_core, _core.HomeLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _core.HomeLocation.SetLocation(dlg.Result.Lat, dlg.Result.Lon); textBoxHomecoords.Text = Utils.Conversion.GetCoordinatesPresentation(_core.HomeLocation); } } }
private void buttonLocation_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(_core, _core.CenterLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Center = dlg.Result; textBoxLocation.Text = Utils.Conversion.GetCoordinatesPresentation(Center); } } }
private void button2_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, Core.CenterLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string s = Utils.Conversion.GetCoordinatesPresentation(dlg.Result.Lat, dlg.Result.Lon); listBox1.Items.Add(s); PluginSettings.Instance.CustomWaypointsList.Add(s); } } }
private void button5_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(_core, _core.CenterLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LocationInfo li = new LocationInfo(); li.Location = new Framework.Data.Location(dlg.Result.Lat, dlg.Result.Lon); li.Name = string.Format("{0} - {1}", Utils.LanguageSupport.Instance.GetTranslation(STR_CUSTOMWP), listBox2.Items.Count); listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); } } }
private void button2_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(_core, _core.CenterLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _core.CenterLocation.SetLocation(dlg.Result.Lat, dlg.Result.Lon); textBoxCentercoords.Text = Utils.Conversion.GetCoordinatesPresentation(_core.CenterLocation); _core.Geocaches.BeginUpdate(); foreach (Framework.Data.Geocache gc in _core.Geocaches) { Utils.Calculus.SetDistanceAndAngleGeocacheFromLocation(gc, _core.CenterLocation); } _core.Geocaches.EndUpdate(); } } }
private void toolStripStatusLabelHomeLocation_DoubleClick(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, Core.HomeLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Core.HomeLocation.SetLocation(dlg.Result.Lat, dlg.Result.Lon); } } }
void bActionDistanceToLocation_Click(object sender, RoutedEventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, Core.CenterLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { (((sender as Button).Parent as Grid).Children[0] as TextBox).Text = Utils.Conversion.GetCoordinatesPresentation(dlg.Result); } } }
private void button3_Click(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(_core, null)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox10.Text = Utils.Conversion.GetCoordinatesPresentation(dlg.Result.Lat, dlg.Result.Lon); } } }
private void toolStripStatusLabelCenterLocation_DoubleClick(object sender, EventArgs e) { using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, Core.CenterLocation)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Core.CenterLocation.SetLocation(dlg.Result.Lat, dlg.Result.Lon); Core.Geocaches.BeginUpdate(); foreach (Framework.Data.Geocache gc in Core.Geocaches) { Utils.Calculus.SetDistanceAndAngleGeocacheFromLocation(gc, Core.CenterLocation); } Core.Geocaches.EndUpdate(); } } }
private void button5_Click(object sender, EventArgs e) { WaypointListItem wpi = listBox1.SelectedItem as WaypointListItem; if (wpi != null) { Framework.Data.UserWaypoint wp = wpi.WP; Framework.Data.Location l = new Framework.Data.Location(wp.Lat, wp.Lon); using (Utils.Dialogs.GetLocationForm dlg = new Utils.Dialogs.GetLocationForm(Core, l)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox8.Text = Utils.Conversion.GetCoordinatesPresentation(dlg.Result); } } } }