public TrackProfileControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            This = this;

            tgc = new TrackGraphControl();
            tgc.Dock = System.Windows.Forms.DockStyle.Fill;
            tgc.enableDisable = this;

            tgc.itemSelected += new GraphItemEvent(this.itemSelectedHandler);
            tgc.itemRangeSelected += new GraphItemsRangeEvent(this.itemsRangeSelectedHandler);

            graphPanel.Controls.Add(tgc);
        }
示例#2
0
        public TrackProfileControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            This = this;

            tgc               = new TrackGraphControl();
            tgc.Dock          = System.Windows.Forms.DockStyle.Fill;
            tgc.enableDisable = this;

            tgc.itemSelected      += new GraphItemEvent(this.itemSelectedHandler);
            tgc.itemRangeSelected += new GraphItemsRangeEvent(this.itemsRangeSelectedHandler);

            graphPanel.Controls.Add(tgc);
        }
示例#3
0
        // args will contain list of files dragged onto QM icon when starting the program
        public MainForm(string[] args)
        {
            LibSys.StatusBar.WriteLine("Starting GUI");
            Project.mainForm = this;		// Project.MessageBox needs this one (TODO:check this....)
            Project.mainCommand = this;

            m_args = (string[])args.Clone();	// we need to null out some elements as we process them
            /*
            #if DEBUG
                        if(m_args != null && m_args.Length > 0)
                        {
                            string allargs = "ARGs:\n";
                            foreach (string arg in m_args)
                            {
                                allargs += arg;
                                allargs += "\n";
                            }
                            Project.MessageBox(this, allargs);
                        }
            #endif
            */
            /*
            byte[] bytes = new byte[] { 20, 235, 205, 66, 253, 124, 179, 65, 122, 193, 88, 65, 6, 19, 143, 65, 3, 0, 245, 195, 255, 255, 165, 65, 34, 65, 183, 96, 45, 131, 203, 192, 226, 63, 63, 112, 14, 149, 182, 109, 0, 192, 204, 60, 137, 59, 0, 176, 12, 187, 53, 22, 35, 187, 12, 119, 0, 66, 13, 0, 159, 18, 0, 0 };
            float f = new GPacket().fromFloatBytes(bytes, 0);
            new GPacket().toFloatBytes(f, bytes, 0);
            GPacket.fromDoubleBytesS(bytes, 26);
            */

            // it is important to have access to quakemap.ini so that we do not create
            // mapping and terraserver cache folders in random places. Check it and exit if it is not there:
            Project.mapsPath = Project.mapsPathDefault; //  Project.readIniFile("MAPSDIR");
            LibSys.StatusBar.WriteLine("Default location for mapping cache in " + Project.mapsPath);

            LibSys.StatusBar.WriteLine("Getting ready");
            while(true)
            {
                if(Project.goingDown)
                {
                    return;
                }

                if (File.Exists(Project.GetMiscPath(Project.OPTIONS_FILE_NAME)))
                {
                    break;
                }

                m_firstTime = true;
                Project.serverAvailable = true;

                // End User License Agreement:
                new DlgEula().ShowDialog();

                // Home Location:
                new DlgZipcode().ShowDialog();
            }

            LibSys.StatusBar.WriteLine("System check 1");

            // debug
            /*
            Project.ReadOptions();
            new DlgGpsSelect(new GpsInsertWaypoint(WaypointsCache.insertWaypoint)).ShowDialog();
            Project.Exit();
            return;
            */
            // end debug

            DateTime t1 = DateTime.Now;
            Project.ReadOptions();
            TimeSpan ts = DateTime.Now - t1;
            LibSys.StatusBar.WriteLine("ReadOptions() took " + ts.Milliseconds + " ms");

            LibSys.StatusBar.WriteLine("Greeting");
            if(Project.showHelpAtStart && !m_firstTime && m_greeting.Length > 0)
            {
                m_greeting = m_greeting + "\n\n...initializing, please wait...\n...trying to reach the server...\n...framework " + Environment.Version;
                // display greeting in a separate thread, and proceed with initializing:
                m_greetingThread =	new Thread( new ThreadStart(ShowGreeting));
                // see Entry.cs for how the current culture is set:
                m_greetingThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; //new CultureInfo("en-US", false);
                m_greetingThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; //new CultureInfo("en-US", false);
                m_greetingThread.IsBackground = true;	// terminate with the main process
                m_greetingThread.Name = "Greeting";
                m_greetingThread.Start();
            }

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.photoToGeotiffMenuItem.Visible = false;

            this.m_plannerControl = new TrackProfileControl();
            this.m_plannerControl.Dock = System.Windows.Forms.DockStyle.Fill;

            this.plannerPanel.Controls.Add(m_plannerControl);

            opacityPopup = new OpacityPopup();

            Project.resetGpsBabelWrapperExecutable();

            this.aboutMenuItem.Text = "&About " + Project.PROGRAM_NAME_HUMAN;

            this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.MainForm_MouseWheel);

            LibSys.StatusBar.setInterface(statusBar, statusBar2, mainProgressBar);
            LibSys.StatusBar.WriteLine("GUI up");
        }
示例#4
0
        public override void ProcessMouseClick(Point clickPoint, GeoCoord mouseGeoLocation, bool controlDown, bool shiftDown, bool altDown)
        {
            try
            {
                if (makeRouteMode && !m_cameraManager.HasDragRectangle)
                {
                    GeoCoord rteLoc = new GeoCoord(mouseGeoLocation);
                    rteLoc.Elev = 0.0d;
                    addLocToRoute(rteLoc);
                }
                else if (Project.photoSelectPhotoMode == 1)
                {
                    Waypoint clickWpt = WaypointByPoint(clickPoint);
                    if (clickWpt != null && clickWpt.ThumbImage != null)
                    {
                        Project.photoSelectPhotoMode = 2;
                        Project.photoSelectedWptId   = clickWpt.Id;
                        Project.ShowPopup(Project.mainForm, "Now select a position where the photo should be, click on it", Project.mainForm.PointToScreen(clickPoint));
                    }
                    else
                    {
                        Project.ShowPopup(Project.mainForm, "please select a photo and click on it", Project.mainForm.PointToScreen(clickPoint));
                    }
                }
                else if (Project.photoSelectPhotoMode == 2)
                {
                    Project.photoSelectPhotoMode = 0;
                    GeoCoord clickCoord = CameraManager.This.toGeoLocation(clickPoint);
                    Project.photoSelectedCoord = new CamPos(clickCoord.Lng, clickCoord.Lat);
                    //Project.ShowPopup(Project.mainForm, "Got the position where the photo should be: " + clickCoord, Point.Empty);

                    if (Project.delegateProcessingComplete != null)
                    {
                        Project.delegateProcessingComplete();
                    }
                }
                else if (m_cameraManager.CanDrillDown)
                {
                    Waypoint clickWpt = WaypointByPoint(clickPoint);
                    if (clickWpt != null)
                    {
                        if (altDown)
                        {
                            Point screenPoint = m_pictureManager.PointToScreen(clickPoint);
                            Project.MapShowPopup(m_pictureManager.PictureBox, clickWpt.toStringPopup(), screenPoint);
                        }
                        else if (clickWpt.ThumbImage != null)
                        {
                            if (clickWpt.TrackId != -1L)
                            {
                                TrackProfileControl.setTrackByTrackpoint(clickWpt);
                            }
                            Project.mainCommand.photoViewerUp(clickWpt);
                        }
                        else
                        {
                            string tmp = clickWpt.Url;
                            if (tmp != null && tmp.StartsWith("http://"))
                            {
                                tmp = "\"" + tmp + "\"";
                                //LibSys.StatusBar.Trace(tmp);
                                Project.RunBrowser(tmp);
                            }
                            else if (tmp != null && tmp.IndexOf("\\") != -1 && File.Exists(tmp))
                            {
                                //LibSys.StatusBar.Trace(tmp);
                                Project.RunFile(tmp);
                            }
                            else if (clickWpt.TrackId != -1L)
                            {
                                TrackProfileControl.setTrackByTrackpoint(clickWpt);

                                if (clickWpt.isEndpoint)
                                {
                                    Project.mainCommand.trackProperties(clickWpt.TrackId);
                                }
                            }
                            else if (!Project.allowMapPopups)
                            {
                                Point screenPoint = m_pictureManager.PointToScreen(clickPoint);
                                Project.MapShowPopup1(m_pictureManager.PictureBox, clickWpt.toStringPopup(), screenPoint);
                            }
                        }
                    }
                }
            }
            catch {}
        }