예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
 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();
             }
         }
     }
 }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
 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);
         }
     }
 }
예제 #6
0
 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);
         }
     }
 }
예제 #7
0
 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);
         }
     }
 }
예제 #8
0
 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);
         }
     }
 }
예제 #9
0
 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);
         }
     }
 }
예제 #10
0
 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();
         }
     }
 }
예제 #11
0
 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);
         }
     }
 }
예제 #12
0
 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();
         }
     }
 }
예제 #13
0
파일: FormMain.cs 프로젝트: gahadzikwa/GAPP
 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);
         }
     }
 }
예제 #14
0
 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);
         }
     }
 }
예제 #15
0
 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();
             }
         }
     }
 }
예제 #16
0
        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);
                }
            }

        }
예제 #17
0
 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);
         }
     }
 }
예제 #18
0
파일: MapForm.cs 프로젝트: gahadzikwa/GAPP
 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);
         }
     }
 }
예제 #19
0
파일: FormMain.cs 프로젝트: gahadzikwa/GAPP
 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();
         }
     }
 }
예제 #20
0
 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);
             }
         }
     }
 }