private void ScanDisplay_MouseDown(object sender, MouseEventArgs e) { if (chkEditMode.Checked == true) { m_bLeftButtonDown = true; this.Cursor = Cursors.Cross; m_ClickPoint = new Point(e.X, e.Y); } //화면초기화 ScanDisplay.Refresh(); }
private void ScanDisplay_MouseMove(object sender, MouseEventArgs e) { if (chkEditMode.Checked == true) { if (m_bLeftButtonDown) { //X좌표 계산 if (e.X < m_ClickPoint.X) { m_CurrentTopLeft.X = e.X; m_CurrentBottomRight.X = m_ClickPoint.X; } else { m_CurrentTopLeft.X = m_ClickPoint.X; m_CurrentBottomRight.X = e.X; } //Y좌표계산 if (e.Y < m_ClickPoint.Y) { m_CurrentTopLeft.Y = e.Y; m_CurrentBottomRight.Y = m_ClickPoint.Y; } else { m_CurrentTopLeft.Y = m_ClickPoint.Y; m_CurrentBottomRight.Y = e.Y; } //화면초기화 ScanDisplay.Refresh(); //사각형 그리기 g.DrawRectangle(m_MyPen, m_CurrentTopLeft.X, m_CurrentTopLeft.Y, m_CurrentBottomRight.X - m_CurrentTopLeft.X, m_CurrentBottomRight.Y - m_CurrentTopLeft.Y); //Console.WriteLine("그리기 {0} {1} {2} {3} ", CurrentTopLeft.X, CurrentTopLeft.Y, CurrentBottomRight.X - CurrentTopLeft.X, CurrentBottomRight.Y - CurrentTopLeft.Y); } } }
void ShowScanPopOut(Object tag) // tag can be a Isystem or an He.. output depends on it. { if (tag == null) { return; } ExtendedControls.ConfigurableForm f = new ExtendedControls.ConfigurableForm(); int width = Math.Max(250, this.FindForm().Width * 4 / 5); int height = 800; HistoryEntry he = tag as HistoryEntry; ISystem sys = SysFrom(tag); ScanDisplay sd = null; string title = "System".Tx(this, "Sys") + ": " + sys.Name; if (he != null && (he.EntryType == JournalTypeEnum.Market || he.EntryType == JournalTypeEnum.EDDCommodityPrices)) // station data.. { JournalCommodityPricesBase jm = he.journalEntry as JournalCommodityPricesBase; jm.FillInformation(out string info, out string detailed, 1); f.Add(new ExtendedControls.ConfigurableForm.Entry("RTB", typeof(ExtendedControls.RichTextBoxScroll), detailed, new Point(0, 40), new Size(width - 20, height - 85), null)); title += ", " + "Station".Tx(this) + ": " + jm.Station; } else { // default is the scan display output sd = new ScanDisplay(); sd.CheckEDSM = CheckEDSM; sd.ShowMoons = sd.ShowMaterials = sd.ShowOverlays = true; sd.SetSize(48); sd.Size = new Size(width - 20, 1024); sd.DrawSystem(sys, null, discoveryform.history); height = Math.Min(800, Math.Max(400, sd.DisplayAreaUsed.Y)) + 100; f.Add(new ExtendedControls.ConfigurableForm.Entry("Sys", null, null, new Point(0, 40), new Size(width - 20, height - 85), null) { control = sd }); } f.Add(new ExtendedControls.ConfigurableForm.Entry("OK", typeof(ExtendedControls.ButtonExt), "OK".Tx(), new Point(width - 20 - 80, height - 40), new Size(80, 24), "")); f.Trigger += (dialogname, controlname, ttag) => { if (controlname == "OK" || controlname == "Cancel") { f.Close(); } }; f.Init(this.FindForm().Icon, new Size(width, height), new Point(-999, -999), title, null, null); if (sd != null) { sd.DrawSystem(sys, null, discoveryform.history); } f.Show(this.FindForm()); }