int DrawHistoryEntry(HistoryEntry he, int rowpos, Point3D tpos, Color textcolour, Color backcolour) { List <string> coldata = new List <string>(); // First we accumulate the strings List <int> tooltipattach = new List <int>(); int initialrowpos = rowpos; int maxrowpos = rowpos; if (Config(Configuration.showTime)) { coldata.Add(EDDiscoveryForm.EDDConfig.ConvertTimeToSelectedFromUTC(he.EventTimeUTC).ToString("HH:mm.ss")); } if (Config(Configuration.showIcon)) { coldata.Add("`!!ICON!!"); // dummy place holder.. } he.FillInformation(out string EventDescription, out string EventDetailedInfo); if (Config(Configuration.showDescription)) { tooltipattach.Add(coldata.Count); coldata.Add(he.EventSummary.Replace("\r\n", " ")); } if (Config(Configuration.showInformation)) { tooltipattach.Add(coldata.Count); coldata.Add(EventDescription.Replace("\r\n", " ")); } if (layoutorder == 0 && Config(Configuration.showNotes)) { coldata.Add((he.SNC != null) ? he.SNC.Note.Replace("\r\n", " ") : ""); } bool showdistance = !Config(Configuration.showDistancesOnFSDJumpsOnly) || he.IsFSDCarrierJump; if (layoutorder == 2 && Config(Configuration.showDistancePerStar)) { coldata.Add(showdistance ? DistToStar(he, tpos) : ""); } if (Config(Configuration.showXYZ)) { coldata.Add((he.System.HasCoordinate && showdistance) ? he.System.X.ToString("0.00") : ""); coldata.Add((he.System.HasCoordinate && showdistance) ? he.System.Y.ToString("0.00") : ""); coldata.Add((he.System.HasCoordinate && showdistance) ? he.System.Z.ToString("0.00") : ""); } if (layoutorder > 0 && Config(Configuration.showNotes)) { coldata.Add((he.SNC != null) ? he.SNC.Note.Replace("\r\n", " ") : ""); } if (layoutorder < 2 && Config(Configuration.showDistancePerStar)) { coldata.Add(showdistance ? DistToStar(he, tpos) : ""); } int colnum = 0; ExtendedControls.ExtPictureBox.ImageElement edsm = null; if (Config(Configuration.showEDSMButton)) { Color backtext = (backcolour.IsFullyTransparent()) ? Color.Black : backcolour; edsm = pictureBox.AddTextAutoSize(new Point(scanpostextoffset.X + columnpos[colnum++], rowpos), new Size(200, 200), "EDSM", displayfont, backtext, textcolour, 0.5F, he, "View system on EDSM".T(EDTx.UserControlSpanel_TVE)); edsm.SetAlternateImage(BaseUtils.BitMapHelpers.DrawTextIntoAutoSizedBitmap("EDSM", new Size(200, 200), displayfont, backtext, textcolour.Multiply(1.2F), 0.5F), edsm.Location, true); } string tooltip = he.EventSummary + Environment.NewLine + EventDescription + Environment.NewLine + EventDetailedInfo; List <ExtendedControls.ExtPictureBox.ImageElement> items = new List <ExtPictureBox.ImageElement>(); for (int i = 0; i < coldata.Count; i++) // then we draw them, allowing them to overfill columns if required { int nextfull = i + 1; for (; nextfull < coldata.Count && Config(Configuration.showExpandOverColumns) && coldata[nextfull].Length == 0; nextfull++) { } if (coldata[i].Equals("`!!ICON!!")) // marker for ICON.. { Image img = he.journalEntry.Icon; var e = pictureBox.AddImage(new Rectangle(scanpostextoffset.X + columnpos[colnum + i], rowpos, img.Width, img.Height), img, null, null, false); maxrowpos = Math.Max(maxrowpos, e.Location.Bottom); items.Add(e); } else { var e = AddColText(colnum + i, colnum + nextfull, rowpos, coldata[i], textcolour, backcolour, tooltipattach.Contains(i) ? tooltip : null); if (e != null) { maxrowpos = Math.Max(maxrowpos, e.Location.Bottom); items.Add(e); } } } if (edsm != null) { edsm.Translate(0, (maxrowpos - initialrowpos - edsm.Image.Height) / 2); // align to centre of rowh.. } foreach (var e in items) { e.Translate(0, (maxrowpos - initialrowpos - e.Image.Height) / 2); // align to centre of rowh.. } return(maxrowpos); }
void DrawHistoryEntry(HistoryEntry he, int rowpos, int rowheight, Point3D tpos, Color textcolour, Color backcolour) { List <string> coldata = new List <string>(); // First we accumulate the strings List <int> tooltipattach = new List <int>(); if (Config(Configuration.showTime)) { coldata.Add((EDDiscoveryForm.EDDConfig.DisplayUTC ? he.EventTimeUTC : he.EventTimeLocal).ToString("HH:mm.ss")); } if (Config(Configuration.showIcon)) { coldata.Add("`!!ICON!!"); // dummy place holder.. } he.journalEntry.FillInformation(out string EventDescription, out string EventDetailedInfo); if (Config(Configuration.showDescription)) { tooltipattach.Add(coldata.Count); coldata.Add(he.EventSummary.Replace("\r\n", " ")); } if (Config(Configuration.showInformation)) { tooltipattach.Add(coldata.Count); coldata.Add(EventDescription.Replace("\r\n", " ")); } if (layoutorder == 0 && Config(Configuration.showNotes)) { coldata.Add((he.snc != null) ? he.snc.Note.Replace("\r\n", " ") : ""); } bool showdistance = !Config(Configuration.showDistancesOnFSDJumpsOnly) || he.IsFSDJump; if (layoutorder == 2 && Config(Configuration.showDistancePerStar)) { coldata.Add(showdistance ? DistToStar(he, tpos) : ""); } if (Config(Configuration.showXYZ)) { coldata.Add((he.System.HasCoordinate && showdistance) ? he.System.X.ToString("0.00") : ""); coldata.Add((he.System.HasCoordinate && showdistance) ? he.System.Y.ToString("0.00") : ""); coldata.Add((he.System.HasCoordinate && showdistance) ? he.System.Z.ToString("0.00") : ""); } if (layoutorder > 0 && Config(Configuration.showNotes)) { coldata.Add((he.snc != null) ? he.snc.Note.Replace("\r\n", " ") : ""); } if (layoutorder < 2 && Config(Configuration.showDistancePerStar)) { coldata.Add(showdistance ? DistToStar(he, tpos) : ""); } int colnum = 0; if (Config(Configuration.showEDSMButton)) { Color backtext = (backcolour.IsFullyTransparent()) ? Color.Black : backcolour; ExtendedControls.PictureBoxHotspot.ImageElement edsm = pictureBox.AddTextFixedSizeC(new Point(scanpostextoffset.X + columnpos[colnum++], rowpos), new Size(45, 14), "EDSM", displayfont, backtext, textcolour, 0.5F, true, he, "View system on EDSM"); edsm.Translate(0, (rowheight - edsm.img.Height) / 2); // align to centre of rowh.. edsm.SetAlternateImage(BaseUtils.BitMapHelpers.DrawTextIntoFixedSizeBitmapC("EDSM", edsm.img.Size, displayfont, backtext, textcolour.Multiply(1.2F), 0.5F, true), edsm.pos, true); } string tooltip = he.EventSummary + Environment.NewLine + EventDescription + Environment.NewLine + EventDetailedInfo; for (int i = 0; i < coldata.Count; i++) // then we draw them, allowing them to overfill columns if required { int nextfull = i + 1; for (; nextfull < coldata.Count && Config(Configuration.showExpandOverColumns) && coldata[nextfull].Length == 0; nextfull++) { } if (coldata[i].Equals("`!!ICON!!")) // marker for ICON.. { Image img = he.GetIcon; ExtendedControls.PictureBoxHotspot.ImageElement e = pictureBox.AddImage(new Rectangle(scanpostextoffset.X + columnpos[colnum + i], rowpos, img.Width, img.Height), img, null, null, false); e.Translate(0, (rowheight - e.img.Height) / 2); // align to centre of rowh.. } else { AddColText(colnum + i, colnum + nextfull, rowpos, rowheight, coldata[i], textcolour, backcolour, tooltipattach.Contains(i) ? tooltip : null); } } }
public string GetEventDisplayString() { return(ManagedExceptionType ?? EventDescription.Replace(" (first/second chance not available)", "")); }