Exemple #1
0
        void AddColText(int coli, int nextcol, int rowpos, int rowh, string text, Color textcolour, Color backcolour, string tooltip)
        {
            if (text.Length > 0)            // don't place empty text, do not want image handling to work on blank screen
            {
                int endpos = (nextcol == 0) ? 1920 : (columnpos[nextcol] - columnpos[coli] - 4);

                ExtendedControls.PictureBoxHotspot.ImageElement e =
                    pictureBox.AddTextAutoSize(new Point(scanpostextoffset.X + columnpos[coli], rowpos),
                                               new Size(endpos, rowh),
                                               text, displayfont, textcolour, backcolour, 1.0F, null, tooltip);

                e.Translate(0, (rowh - e.img.Height) / 2);          // align to centre of rowh..
            }
        }
Exemple #2
0
        void AddColText(int coli, int nextcol, int rowpos, int rowh, string text, Color textcolour, Color backcolour, string tooltip, Image opt = null, string imagetooltip = null)
        {
            if (text.Length > 0)            // don't place empty text, do not want image handling to work on blank screen
            {
                int endpos = (nextcol == 0) ? 1920 : (columnpos[nextcol] - columnpos[coli] - 4);

                int colpos = scanpostextoffset.X + columnpos[coli];

                if (opt != null)
                {
                    pictureBox.AddImage(new Rectangle(colpos, rowpos, 24, 24), Icons.Controls.firstdiscover, null, imagetooltip, false);
                    colpos += 24;
                }

                ExtendedControls.PictureBoxHotspot.ImageElement e =
                    pictureBox.AddTextAutoSize(new Point(colpos, rowpos),
                                               new Size(endpos, rowh),
                                               text, displayfont, textcolour, backcolour, 1.0F, null, tooltip);

                e.Translate(0, (rowh - e.img.Height) / 2);          // align to centre of rowh..
            }
        }
Exemple #3
0
        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..
            }
            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(he.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(ExtendedControls.ControlHelpers.DrawTextIntoFixedSizeBitmapC("EDSM", edsm.img.Size, displayfont, backtext, textcolour.Multiply(1.2F), 0.5F, true), edsm.pos, true);
            }

            string tooltip = he.EventSummary + Environment.NewLine + he.EventDescription + Environment.NewLine + he.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..
                {
                    Bitmap 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);
                }
            }
        }