private void showInGeWptButton_Click(object sender, System.EventArgs e)
        {
            ArrayList selected = GetSelectedRowsView(waypointsDataGrid);
            if(selected.Count > 0)
            {
                ClearMessages();
            #if DEBUG
                string str = "";
            #endif
                int columnWptId = 0;
                DataTable table = m_waypointsDS.Tables[0];
                ArrayList waypoints = new ArrayList();		// array of Waypoint
                for(int i=0; i < selected.Count ;i++)
                {
                    int row = (int)selected[i];
                    int waypointId = (int)waypointsDataGrid[row, columnWptId];
            #if DEBUG
                    str += "" + row + "=" + waypointId + " ";
            #endif
                    Waypoint wpt = WaypointsCache.getWaypointById(waypointId);
                    if(wpt != null)
                    {
                        //m_wptIdToSelect = wpt.Id;
                        waypoints.Add(wpt);
                    }
                }
            #if DEBUG
                messageWptLabel.Text = "selected: " + str;
            #else
                messageWptLabel.Text = "";
            #endif

                bool skipIt = false;

                if(Project.kmlOptions.ShowInPopup)
                {
                    KmlOptionsPopup kmlOptionsPopup = new KmlOptionsPopup();

                    Point ppop = showInGeWptButton.PointToScreen(new Point(-270, -145));
                    kmlOptionsPopup.Top = ppop.Y;
                    kmlOptionsPopup.Left = ppop.X;

                    kmlOptionsPopup.ShowDialog(this);
                    skipIt = !kmlOptionsPopup.doContinue;
                }

                if(!skipIt)
                {
                    GoogleEarthManager.runWaypoints(waypoints);
                }
            }
            else
            {
                //messageWptLabel.Text = "Error: select a waypoint first";
                Project.ShowPopup(wptSaveButton, "\nselect a waypoint(s) first" + Project.SELECT_HELP, Point.Empty);
            }
        }
Exemple #2
0
        private void cm_wptGoogleEarthMenuItem_Click(object sender, System.EventArgs e)
        {
            if(rightClickWaypoint != null)
            {
                bool skipIt = false;

                if(Project.kmlOptions.ShowInPopup)
                {
                    KmlOptionsPopup kmlOptionsPopup = new KmlOptionsPopup();

                    kmlOptionsPopup.Top = this.mainPictureBox.PointToScreen(rightClickPoint).Y + 10;
                    kmlOptionsPopup.Left = this.mainPictureBox.PointToScreen(rightClickPoint).X + 10;

                    kmlOptionsPopup.ShowDialog(this);
                    skipIt = !kmlOptionsPopup.doContinue;
                }

                ArrayList waypoints = new ArrayList(1);
                waypoints.Add(rightClickWaypoint);

                if(!skipIt)
                {
                    GoogleEarthManager.runWaypoints(waypoints);
                }
            }
        }
        private void showInGeTracksRoutes(DataGrid dataGrid, DataSet dataSet)
        {
            ArrayList selected = GetSelectedRows(dataGrid);
            if(selected.Count > 0)
            {
                ClearMessages();
            #if DEBUG
                string str = "";
            #endif
                int column = 0;
                DataTable table = dataSet.Tables[0];
                ArrayList tracks = new ArrayList();		// array of Track
                for(int i=0; i < selected.Count ;i++)
                {
                    int row = (int)selected[i];
                    long trackId = (long)((int)dataGrid[row, column]);
            #if DEBUG
                    str += "" + row + "=" + trackId + " ";
            #endif
                    Track trk = WaypointsCache.getTrackById(trackId);
                    if(trk != null)
                    {
                        m_trackIdToSelect = trk.Id;
                        tracks.Add(trk);
                    }
                }
            #if DEBUG
                messageTrkLabel.Text = "selected: " + str;
            #else
                messageTrkLabel.Text = "";
            #endif

                bool skipIt = false;

                if(Project.kmlOptions.ShowInPopup)
                {
                    KmlOptionsPopup kmlOptionsPopup = new KmlOptionsPopup();

                    Point ppop = showInGeButton.PointToScreen(new Point(-270, -145));
                    kmlOptionsPopup.Top = ppop.Y;
                    kmlOptionsPopup.Left = ppop.X;

                    kmlOptionsPopup.ShowDialog(this);
                    skipIt = !kmlOptionsPopup.doContinue;
                }

                if(!skipIt)
                {
                    GoogleEarthManager.runTracks(tracks);
                }
            }
            else
            {
                //messageTrkLabel.Text = "Error: select a track first";
                Project.ShowPopup(saveButton, "\nselect a track/route first" + Project.SELECT_HELP, Point.Empty);
            }
        }
Exemple #4
0
        private void cm_trackGoogleEarthMenuItem_Click(object sender, System.EventArgs e)
        {
            Track trk = WaypointsCache.getTrackById(cm_trackId);
            if(trk != null)
            {
                m_cameraManager.zoomToCorners(trk.TopLeft, trk.BottomRight);

                bool skipIt = false;

                if(Project.kmlOptions.ShowInPopup)
                {
                    KmlOptionsPopup kmlOptionsPopup = new KmlOptionsPopup();

                    kmlOptionsPopup.Top = this.mainPictureBox.PointToScreen(rightClickPoint).Y + 10;
                    kmlOptionsPopup.Left = this.mainPictureBox.PointToScreen(rightClickPoint).X + 10;

                    kmlOptionsPopup.ShowDialog(this);
                    skipIt = !kmlOptionsPopup.doContinue;
                }

                if(!skipIt)
                {
                    GoogleEarthManager.runTrack(trk);
                }
            }
        }