public void Bookmark(BookmarkClass bk)        // from multiple places, update this bookmark, region or system..
        {
            string note = "";
            string name;
            long?  edsmid = null;

            if (!bk.isRegion)
            {
                ISystem s = SystemCache.FindSystem(bk.StarName);
                if (s != null)    // paranoia
                {
                    InitialisePos(s);
                    edsmid = s.EDSMID;
                }
                else
                {
                    InitialisePos(bk.x, bk.y, bk.z);
                }

                SystemNoteClass sn = SystemNoteClass.GetNoteOnSystem(bk.StarName);
                note = (sn != null) ? sn.Note : "";

                name = bk.StarName;
            }
            else
            {       // region, set position, set name
                InitialisePos(bk.x, bk.y, bk.z);
                name = bk.Heading;
            }

            this.Text                  = "Update Bookmark".T(EDTx.BookmarkForm_UB);
            buttonOK.Text              = "Update".T(EDTx.BookmarkForm_Update);
            textBoxName.Text           = name;
            textBoxName.ReadOnly       = !bk.isRegion;
            textBoxName.ReturnPressed += (ctrl) => { return(true); };
            textBoxBookmarkNotes.Text  = bk.Note;
            textBoxBookmarkNotes.CursorToEnd();
            textBoxBookmarkNotes.ScrollToCaret();
            textBoxTravelNote.Text = note;
            textBoxTime.Text       = EDDConfig.Instance.ConvertTimeToSelectedFromUTC(bk.TimeUTC).ToString();
            checkBoxTarget.Checked = bk.id == TargetClass.GetTargetBookmark();      // who is the target of a bookmark (0=none)

            //foreach (Control c in panelOuter.Controls) System.Diagnostics.Debug.WriteLine("All Control {0} at {1}", c.Name, c.Top);

            if (bk.isRegion)
            {
                HideEDSM();
                HideTravelNote();   // in order note
                HideSurfaceBookmarks();
            }
            else
            {
                var edsm = new EDSMClass();
                edsmurl = edsm.GetUrlToEDSMSystem(name, edsmid);
                SurfaceBookmarks.Init(bk.StarName, bk.PlanetaryMarks);
            }


            buttonOK.Enabled = true;
        }
Exemple #2
0
        public void Update(BookmarkClass bk)        // from multiple places, update this bookmark, region or system..
        {
            string note = "";
            string name;
            long?  edsmid = null;

            if (!bk.isRegion)
            {
                ISystem s = SystemCache.FindSystem(bk.StarName);
                if (s != null)    // paranoia
                {
                    InitialisePos(s);
                    edsmid = s.EDSMID;
                }
                else
                {
                    InitialisePos(bk.x, bk.y, bk.z);
                }

                SystemNoteClass sn = SystemNoteClass.GetNoteOnSystem(bk.StarName);
                note = (sn != null) ? sn.Note : "";

                name = bk.StarName;
            }
            else
            {       // region, set position, set name
                InitialisePos(bk.x, bk.y, bk.z);
                name = bk.Heading;
            }

            this.Text                  = "Update Bookmark".Tx(this, "UB");
            buttonOK.Text              = "Update".Tx(this);
            textBoxName.Text           = name;
            textBoxName.ReadOnly       = !bk.isRegion;
            textBoxName.ReturnPressed += (ctrl) => { return(true); };
            textBoxBookmarkNotes.Text  = bk.Note;
            textBoxBookmarkNotes.CursorToEnd();
            textBoxBookmarkNotes.ScrollToCaret();
            textBoxTravelNote.Text = note;
            textBoxTime.Text       = bk.Time.ToString();
            checkBoxTarget.Checked = bk.id == TargetClass.GetTargetBookmark();      // who is the target of a bookmark (0=none)

            if (bk.isRegion)
            {
                HideEDSM();
                HideTravelNote();
                HideSurfaceBookmarks();
            }
            else
            {
                var edsm = new EDSMClass();
                edsmurl = edsm.GetUrlToEDSMSystem(name, edsmid);
                SurfaceBookmarks.Init(bk.StarName, bk.PlanetaryMarks);
            }

            buttonOK.Enabled = true;
        }
Exemple #3
0
        public void NewSystemBookmark(ISystem system, string note, DateTime tme)    // from multipe, create a new system bookmark
        {
            this.Text              = "New System Bookmark".Tx(this, "SB");
            textBoxName.Text       = system.Name;
            textBoxTravelNote.Text = note;
            textBoxTime.Text       = tme.ToString();
            InitialisePos(system);
            buttonDelete.Hide();
            var edsm = new EDSMClass();

            edsmurl = edsm.GetUrlToEDSMSystem(system.Name, system.EDSMID);
            SurfaceBookmarks.Init(system.Name);
            buttonOK.Enabled = true;
        }
        public void NewSystemBookmark(ISystem system, string note, DateTime timeutc)    // from multipe, create a new system bookmark
        {
            this.Text                  = "New System Bookmark".T(EDTx.BookmarkForm_SB);
            textBoxName.Text           = system.Name;
            textBoxName.ReturnPressed += (ctrl) => { return(true); };
            textBoxTravelNote.Text     = note;
            textBoxTime.Text           = EDDConfig.Instance.ConvertTimeToSelectedFromUTC(timeutc).ToString();
            InitialisePos(system);
            buttonDelete.Hide();
            var edsm = new EDSMClass();

            edsmurl = edsm.GetUrlToEDSMSystem(system.Name, system.EDSMID);
            SurfaceBookmarks.Init(system.Name);
            buttonOK.Enabled = true;
        }
Exemple #5
0
 public void NewFreeEntrySystemBookmark(DateTime tme)     // new system bookmark anywhere
 {
     this.Text        = "New System Bookmark".Tx(this, "NSB");
     textBoxName.Text = "Enter a system name...".Tx(this, "ESN");
     validatestarname = true;
     textBoxName.SetAutoCompletor(SystemCache.ReturnSystemAutoCompleteList, true);
     textBoxName.ClearOnFirstChar = true;
     textBoxName.SelectAll();
     textBoxName.Focus();
     textBoxTime.Text = tme.ToString();
     validatestarname = true;
     buttonDelete.Hide();
     buttonEDSM.Enabled = false;
     buttonOK.Enabled   = false;
     SurfaceBookmarks.Init("");
 }
 public void NewFreeEntrySystemBookmark(DateTime timeutc)     // new system bookmark anywhere
 {
     this.Text                  = "New System Bookmark".T(EDTx.BookmarkForm_NSB);
     textBoxName.Text           = "Enter a system name...".T(EDTx.BookmarkForm_ESN);
     textBoxName.ReturnPressed += (ctrl) => { return(true); };
     validatestarname           = true;
     textBoxName.SetAutoCompletor(SystemCache.ReturnSystemAutoCompleteList, true);
     textBoxName.ClearOnFirstChar = true;
     textBoxName.SelectAll();
     textBoxName.Focus();
     textBoxTime.Text = EDDConfig.Instance.ConvertTimeToSelectedFromUTC(timeutc).ToString();
     validatestarname = true;
     buttonDelete.Hide();
     buttonEDSM.Enabled = false;
     buttonOK.Enabled   = false;
     SurfaceBookmarks.Init("");
 }
        private void textBox_TextChanged(object sender, EventArgs e)
        {
            if (validatestarname)
            {
                ISystem f = SystemCache.FindSystem(textBoxName.Text);
                if (f != null && f.HasCoordinate)
                {
                    InitialisePos(f);
                    var edsm = new EDSMClass();
                    edsmurl = edsm.GetUrlToEDSMSystem(f.Name, f.EDSMID);
                    SurfaceBookmarks.Init(f.Name);
                }
                else
                {
                    textBoxX.Text = textBoxY.Text = textBoxZ.Text = "";
                }

                buttonEDSM.Enabled = buttonOK.Enabled = ValidateData() && f != null;
            }
            else
            {
                buttonOK.Enabled = ValidateData();
            }
        }
        private void textBox_TextChanged(object sender, EventArgs e)
        {
            if (validatestarname)
            {
                ISystem f = SystemCache.FindSystem(textBoxName.Text, null, false);       // no edsm lookup, too slow to do interactively.
                if (f != null && f.HasCoordinate)
                {
                    InitialisePos(f);
                    var edsm = new EDSMClass();
                    edsmurl = edsm.GetUrlToSystem(f.Name);
                    SurfaceBookmarks.Init(f.Name, helist);
                }
                else
                {
                    textBoxX.Text = textBoxY.Text = textBoxZ.Text = "";
                }

                buttonEDSM.Enabled = buttonOK.Enabled = ValidateData() && f != null;
            }
            else
            {
                buttonOK.Enabled = ValidateData();
            }
        }
 private void HideSurfaceBookmarks()
 {
     SurfaceBookmarks.Hide(); ShiftControls(buttonOK, SurfaceBookmarks);
 }
Exemple #10
0
 // from compass, new system bookmark at position
 public void NewSystemBookmark(ISystem system, string note, DateTime timeutc, string planet, double latitude, double longitude)
 {
     NewSystemBookmark(system, note, timeutc);
     SurfaceBookmarks.AddSurfaceLocation(planet, latitude, longitude);
 }
Exemple #11
0
 public void Bookmark(BookmarkClass bk, string planet, double latitude, double longitude)  // from compass, bookmark at planet/lat/long
 {
     Bookmark(bk);
     SurfaceBookmarks.AddSurfaceLocation(planet, latitude, longitude);
 }