Ejemplo n.º 1
0
        public void DrawArc(QRectangle Rectangle, float StartAngle, float SweepAngle, QPen Pen)
        {
#if WPF
#else
            DrawingTarget.DrawArc(Pen.Pen, Rectangle.X, Rectangle.Y, Rectangle.Width, Rectangle.Height, StartAngle, SweepAngle);
#endif
        }
Ejemplo n.º 2
0
        protected override void SetupLayout()
        {
            this.rect = this.screenSize.GetRectangleDockedBottomRight(new QSize(355, 190), 20);

            const float LEFT_MARGIN = 10;

            titleLoc = rect.TopLeft + new QPoint(LEFT_MARGIN, 10);

            float x = rect.Left + LEFT_MARGIN;
            float y = rect.Top + 40;

            float margin = 10;

            rects[0] = new QRectangle(x, y, YEAR_WIDTH, BOX_HEIGHT);

            x       += YEAR_WIDTH + margin;
            rects[1] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[2] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[3] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[4] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[5] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[6] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            QPoint offset = new QPoint(-2, 3);

            slash1 = rects[0].TopRight + offset;
            slash2 = rects[1].TopRight + offset;
            colon1 = rects[3].TopRight + offset;
            colon2 = rects[4].TopRight + offset;

            localLoc = new QPoint(rects[6].Center.X - 1, rects[6].Bottom - 5);

            help1Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 100);
            help2Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 76);
            help3Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 52);
            help4Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 28);
        }
Ejemplo n.º 3
0
        protected override void SetupLayout()
        {
            this.rect = this.screenSize.GetRectangleDockedBottomRight(new QSize(340, 230), 20);

            const float LEFT_MARGIN = 10;

            titleLoc = rect.TopLeft + new QPoint(LEFT_MARGIN, 10);

            findTextBorder = new QRectangle(rect.TopLeft + new QPoint(LEFT_MARGIN, 40), new QSize(rect.Width - LEFT_MARGIN * 2, 30));
            findTextPoint  = findTextBorder.Location + new QPoint(4, 2);
            hintRectangle  = new QRectangle(rect.Left + LEFT_MARGIN, findTextPoint.Y + 40, findTextBorder.Width, 40);

            help1Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 100);
            help2Loc = new QPoint(help1Loc.X, help1Loc.Y + 24);
            help3Loc = new QPoint(help2Loc.X, help2Loc.Y + 24);
            help4Loc = new QPoint(help3Loc.X, help3Loc.Y + 30);
        }
Ejemplo n.º 4
0
 public void Render()
 {
     if (locked || --messageCountdown > 0)
     {
         if (messageSize == QSize.Empty)
         {
             messageSize     = renderer.MeasureText(message, renderer.ExtraLargeFont);
             this.screenSize = QSize.Empty;
         }
         if (renderer.ScreenSize != this.screenSize)
         {
             rect            = new QRectangle((renderer.ScreenSize.Width - messageSize.Width) / 2, renderer.ScreenSize.Height - 100, messageSize.Width, messageSize.Height);
             this.screenSize = renderer.ScreenSize;
             textLocation    = new QPoint(rect.X + rect.Width / 40, rect.Y + 1);
         }
         renderer.FillRectangle(rect, fillPen, borderPen);
         renderer.DrawString(message, textLocation, forePen, renderer.ExtraLargeFont);
     }
 }
Ejemplo n.º 5
0
        protected override void SetupLayout()
        {
            this.rect = this.screenSize.GetRectangleDockedBottomRight(new QSize(400, 195), 20);

            const float LEFT_MARGIN = 10;

            titleLoc = rect.TopLeft + new QPoint(LEFT_MARGIN, 10);

            float x      = rect.Left + LEFT_MARGIN;
            float y      = rect.Top + 40;
            float margin = 3;

            rects[0] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[1] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[2] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[3] = new QRectangle(x, y, CHAR_WIDTH, BOX_HEIGHT);

            x       += CHAR_WIDTH + margin * 4;
            rects[4] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[5] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[6] = new QRectangle(x, y, NUM_WIDTH, BOX_HEIGHT);

            x       += NUM_WIDTH + margin;
            rects[7] = new QRectangle(x, y, CHAR_WIDTH, BOX_HEIGHT);

            latLoc = rects[0].BottomLeft + new QPoint(70, 2);
            lngLoc = rects[4].BottomLeft + new QPoint(70, 2);

            help1Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 76);
            help2Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 52);
            help3Loc = new QPoint(rect.Left + LEFT_MARGIN, rect.Bottom - 28);
        }
Ejemplo n.º 6
0
 private void setupGeometry()
 {
     drawCenter = new QPoint(center.X, Location.Y + Size.Height * 0.7);
     arcRect    = QRectangle.GetRectangleCenteredOn(drawCenter, innerSize);
     textPoint  = new QPoint(center.X, Location.Y + Size.Height * 0.8);
 }
Ejemplo n.º 7
0
 public bool Equals(QRectangle R)
 {
     return(this == R);
 }
Ejemplo n.º 8
0
 public void DrawString(string Text, QRectangle Rectangle, QPen Pen, QFont Font)
 {
     System.Windows.Forms.TextRenderer.DrawText(DrawingTarget, Text, Font.Font, Rectangle.ToRectangle(), Pen.Color, System.Windows.Forms.TextFormatFlags.WordBreak);
 }
Ejemplo n.º 9
0
 public void FillRectangle(QRectangle Rectangle, QPen FillPen, QPen BorderPen)
 {
     DrawingTarget.FillRectangle(FillPen, Rectangle);
     DrawingTarget.DrawRectangle(BorderPen, Rectangle);
 }
Ejemplo n.º 10
0
 public void DrawRectangle(QRectangle Rectangle, QPen Pen)
 {
     DrawingTarget.DrawRectangle(Pen, Rectangle.Location, Rectangle.Size);
 }
Ejemplo n.º 11
0
 public void DrawArc(QRectangle Rectangle, double StartAngle, double SweepAngle, QPen Pen)
 {
     this.DrawArc(Rectangle, (float)StartAngle, (float)SweepAngle, Pen);
 }
Ejemplo n.º 12
0
 public static void DrawRectangle(this Graphics G, QPen Pen, QRectangle Rectangle)
 {
     G.DrawRectangle(Pen.Pen, Rectangle.X, Rectangle.Y, Rectangle.Width, Rectangle.Height);
 }
Ejemplo n.º 13
0
 public static void FillRectangle(this Graphics G, QPen Pen, QRectangle Rectangle)
 {
     G.FillRectangle(Pen.Brush, Rectangle.X, Rectangle.Y, Rectangle.Width, Rectangle.Height);
 }
Ejemplo n.º 14
0
        protected override void SetupLayout()
        {
            QSize size = new QSize(800, 474);

            rect = new QRectangle((renderer.ScreenSize.Width - size.Width) / 2, 20, size.Width, size.Height);

            renderList = new List <Tuple <string, QPoint, QPen, QFont> >();

            float margin         = 14;
            float lineSpace      = 20;
            float largeLineSpace = lineSpace + 10;
            float firstLine      = rect.Y + margin;

            QPoint pt = new QPoint(rect.X + margin, firstLine);

            firstLine += 36;

            addToHelpList("Key Commands  ([F1] Show / Hide This Help)", ref pt, 0, renderer.ExtraLargeFont, forePen);

            pt.Y = firstLine;

            addToHelpList("[1] Ecliptic View", ref pt, 0, renderer.LargeFont, forePen);
            addToHelpList("[2] Planet Surface View", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[3] Top Down View", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[4] Following View", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[F2] Show / Hide Status Info", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F3] Search", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F4] Show / Hide Flight Instruments", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F5] Change Label View", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F6] Switch Solid/Vector Planets", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[F7] Show Fewer Stars", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F8] Show More Stars", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[F9] Show/Hide Constellations", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F10] Change Constellation Patterns", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[F11] Show/Hide Constellation Boundaries", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[F12] Highlight Sunlit Surfaces", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Right Click] Mouse Look On / Off", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            pt = new QPoint(rect.X + rect.Size.Width * 0.38, firstLine);

            addToHelpList("[Left] View Previous Object", ref pt, 0, renderer.LargeFont, forePen);
            addToHelpList("[Right] View Next Object", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[Up] Fly to Next Object", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[Down] Fly to Previous Object", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[<] View the Moon", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[>] Fly to Earth", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[R] Swap Position and View", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[\\] Adjust Date/Time", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[=] Switch Local/UTC Time", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[P] Pause", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[T] Go to Today", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[Z] Slow Down", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[X] Speed Up", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[C] Reverse Time", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Page Up] Zoom In", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[Page Down] Zoom Out", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[Home] Zoom In Full", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[End] Zoom Out Full", ref pt, lineSpace, renderer.LargeFont, forePen);

            pt = new QPoint(rect.X + rect.Size.Width * 0.67, firstLine);

            addToHelpList("[5] Show / Hide Ecliptic Grid", ref pt, 0, renderer.LargeFont, forePen);
            addToHelpList("[6] Show / Hide Equatorial Grid", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[7] Show / Hide Local Grid", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[W] Pan Up", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[S] Pan Down", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[A] Pan Left", ref pt, lineSpace, renderer.LargeFont, forePen);
            addToHelpList("[D] Pan Right", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Q] Tilt Left", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[E] Tilt Right", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Space] Reset Panning", ref pt, largeLineSpace, renderer.LargeFont, forePen);
            addToHelpList("[Enter] Lock in on Target", ref pt, lineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Backspace] Adjust Lat/Long", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[~] Change Projection Mode", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Insert] Antialiased Graphics On / Off", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Tab] Full-Screen Mode On / Off", ref pt, largeLineSpace, renderer.LargeFont, forePen);

            addToHelpList("[Esc] Exit the simulator", ref pt, lineSpace + lineSpace, renderer.LargeItalicFont, forePen);
        }