Beispiel #1
0
 protected void ClearContent()
 {
     Lcd.LoadScreen();
     Lcd.DrawRectangle(outherWindow, true, true);
     Lcd.DrawRectangle(innerWindow, false, true);
     Lcd.WriteTextBox(font, titleRect, title, false, Lcd.Alignment.Center);
 }
Beispiel #2
0
 private void AnimationThread()
 {
     while (run)
     {
         for (int i = 0; i < rects.Count; i++)
         {
             Lcd.DrawRectangle(rects [i], i == showIndex, true);
         }
         Lcd.Update();
         if (leftToRight)
         {
             showIndex++;
             if (showIndex == rects.Count - 1)
             {
                 leftToRight = false;
             }
         }
         else
         {
             showIndex--;
             if (showIndex == 0)
             {
                 leftToRight = true;
             }
         }
         resetEvent.WaitOne(updateFrequency);
     }
 }
Beispiel #3
0
        private void DrawScrollBar()
        {
            Lcd.DrawRectangle(scrollBar, false, true);
            Lcd.DrawRectangle(scrollBar, true, false);
            Rectangle indexRec = new Rectangle(new Point(scrollBar.P1.X + (scrollBarWidth - scrollIndexWith) / 2, scrollBar.P1.Y + pagePos * indexHeight), new Point(scrollBar.P2.X - (scrollBarWidth - scrollIndexWith) / 2, scrollBar.P1.Y + pagePos * indexHeight + indexHeight));

            Lcd.DrawRectangle(indexRec, true, true);
        }
Beispiel #4
0
 public override void Draw()
 {
     Lcd.DrawRectangle(outherBox, true, true);
     Lcd.DrawRectangle(innerBox, Selected, true);
     Lcd.DrawArrow(arrowRect, Lcd.ArrowOrientation.Left, !Selected);
     Lcd.DrawLine(new Point(arrowRect.P2.X, outherBox.P1.Y + ((outherBox.P2.Y - outherBox.P1.Y) / 2)), new Point(outherBox.P2.X - 8 * characterEdge, outherBox.P1.Y + ((outherBox.P2.Y - outherBox.P1.Y) / 2)), !Selected);
     Lcd.DrawLine(new Point(outherBox.P2.X - 8 * characterEdge, outherBox.P1.Y + ((outherBox.P2.Y - outherBox.P1.Y) / 2)), new Point(outherBox.P2.X - 8 * characterEdge, outherBox.P1.Y + 4 * characterEdge), !Selected);
 }
Beispiel #5
0
 public override void Draw()
 {
     Lcd.DrawRectangle(outherBox, true, true);
     Lcd.DrawRectangle(innerBox, Selected, true);
     Lcd.WriteText(Font.SmallFont, textCenterPoint + textDisplacement, Text, !Selected);
     Lcd.DrawArrow(arrowRect, Lcd.ArrowOrientation.Up, !Selected);
     Lcd.DrawVLine(lineStart, lineLength, !Selected);
     Lcd.DrawVLine(lineStart + new Point(-1, 0), lineLength, !Selected);
     Lcd.DrawVLine(lineStart + new Point(+1, 0), lineLength, !Selected);
 }
Beispiel #6
0
 internal virtual void Draw()
 {
     OnShow();
     Lcd.DrawRectangle(outherWindow, true, true);
     Lcd.DrawRectangle(innerWindow, false, true);
     if (drawTitle)
     {
         WriteTitle();
     }
     OnDrawContent();
     Lcd.Update();
 }
Beispiel #7
0
 public virtual void Draw()
 {
     if (Disabled)
     {
         Lcd.DrawRectangle(outherBox, false, false);
         Lcd.DrawRectangle(innerBox, Selected, true);
         return;
     }
     Lcd.DrawRectangle(outherBox, true, true);
     Lcd.DrawRectangle(innerBox, Selected, true);
     Lcd.WriteText(Font.MediumFont, textCenterPoint, Text, !Selected);
 }
Beispiel #8
0
 public override void Draw()
 {
     if (Disabled)
     {
         Lcd.DrawRectangle(outherBox, true, true);
         Lcd.DrawRectangle(innerBox, Selected, true);
         Lcd.DrawLine(outherBox.P1, outherBox.P2, !Selected);
         Lcd.DrawLine(new Point(outherBox.P1.X, outherBox.P2.Y), new Point(outherBox.P2.X, outherBox.P1.Y), !Selected);
         return;
     }
     Lcd.DrawRectangle(outherBox, true, true);
     Lcd.DrawRectangle(innerBox, Selected, true);
     Lcd.DrawArrow(arrowRect, arrowOrientation, !Selected);
 }
Beispiel #9
0
 internal override void Draw()
 {
     OnShow();
     if (!frameHasBeenDrawn)
     {
         Lcd.DrawRectangle(outherWindow, true, true);
         Lcd.DrawRectangle(innerWindow, false, true);
         if (drawTitle)
         {
             WriteTitle();
         }
         frameHasBeenDrawn = true;
     }
     OnDrawContent();
     Lcd.Update();
 }
Beispiel #10
0
        public override void OnDrawTitle(Font f, Rectangle r, bool color)
        {
            int       xCheckBoxSize = (int)f.maxWidth;
            Rectangle outer         = new Rectangle(new Point(Lcd.Width - xCheckBoxSize + edgeSize, r.P1.Y + edgeSize), new Point(r.P2.X - edgeSize, r.P2.Y - edgeSize));
            Rectangle innter        = new Rectangle(new Point(Lcd.Width - xCheckBoxSize + lineSize + edgeSize, r.P1.Y + lineSize + edgeSize), new Point(r.P2.X - lineSize - edgeSize, r.P2.Y - lineSize - edgeSize));
            Point     fontPoint     = f.TextSize("v");
            Point     checkPoint    = new Point(Lcd.Width - xCheckBoxSize + (int)fontPoint.X - edgeSize, r.P1.Y);

            Lcd.WriteTextBox(f, r, text, color);
            Lcd.DrawRectangle(outer, color, true);
            Lcd.DrawRectangle(innter, !color, true);
            if (Checked)
            {
                Lcd.WriteText(f, checkPoint, "v", color);
            }
        }
Beispiel #11
0
        public override void Draw()
        {
            Lcd.DrawRectangle(outherBox, true, true);
            Lcd.DrawRectangle(innerBox, Selected, true);
            string character = SelectedCharacter;

            if (character == null)
            {
                character = " ";
            }
            if (!useSmallFont)
            {
                Lcd.WriteText(resultFont, textCenterPoint, currentLine + SelectedCharacter, !Selected);
                int xUnderLine = innerBox.P1.X + characterEdge + resultFont.TextSize(currentLine).X;
                int yUnderLine = innerBox.P2.Y - 1;
                Lcd.DrawHLine(new Point(xUnderLine, yUnderLine), resultFont.TextSize(character).X, true);
            }
            else
            {
                if (showLine)
                {
                    if (inputLines.Count > 1)
                    {
                        Point topPoint = new Point(innerBox.P1.X + characterEdge, innerBox.P1.Y);
                        Lcd.WriteText(resultFont, topPoint, inputLines [inputLines.Count - 2], !Selected);
                        Lcd.WriteText(resultFont, topPoint + new Point(0, ((int)resultFont.maxHeight - 1)), inputLines [inputLines.Count - 1], !Selected);
                        Lcd.WriteText(resultFont, topPoint + new Point(0, ((int)resultFont.maxHeight - 1) * 2), currentLine + SelectedCharacter, !Selected);
                    }
                    else
                    {
                        Point topPoint = new Point(innerBox.P1.X + characterEdge, textCenterPoint.Y);
                        Lcd.WriteText(resultFont, topPoint, inputLines [inputLines.Count - 1], !Selected);
                        Lcd.WriteText(resultFont, topPoint + new Point(0, (int)resultFont.maxHeight - 1), currentLine + SelectedCharacter, !Selected);
                        int xUnderLine = innerBox.P1.X + characterEdge + resultFont.TextSize(currentLine).X;
                        int yUnderLine = innerBox.P2.Y - 1;
                        Lcd.DrawHLine(new Point(xUnderLine, yUnderLine), resultFont.TextSize(character).X, true);
                    }
                }
                else
                {
                    Lcd.WriteText(resultFont, textCenterPoint + new Point(0, 5), currentLine + SelectedCharacter, !Selected);
                    int xUnderLine = innerBox.P1.X + characterEdge + resultFont.TextSize(currentLine).X;
                    int yUnderLine = innerBox.P2.Y - 1;
                    Lcd.DrawHLine(new Point(xUnderLine, yUnderLine), resultFont.TextSize(character).X, true);
                }
            }
        }
Beispiel #12
0
        protected void DrawLeftButton(string text, bool color, int textSize)
        {
            if (textSize == 0)
            {
                textSize = font.TextSize(text).X;
            }
            textSize += buttonTextOffset;
            Point left1      = bottomLineCenter + new Point(-boxMiddleOffset - (int)textSize, (int)-font.maxHeight / 2);
            Point left2      = bottomLineCenter + new Point(-boxMiddleOffset, (int)font.maxHeight / 2);
            Point leftOuter1 = left1 + new Point(-buttonEdge, -buttonEdge);
            Point leftOuter2 = left2 + new Point(buttonEdge, buttonEdge);

            Rectangle leftRect      = new Rectangle(left1, left2);
            Rectangle leftOuterRect = new Rectangle(leftOuter1, leftOuter2);

            Lcd.DrawRectangle(leftOuterRect, true, true);
            Lcd.WriteTextBox(font, leftRect, text, color, Lcd.Alignment.Center);
        }
Beispiel #13
0
        protected void DrawCenterButton(string text, bool color, int textSize)
        {
            if (textSize == 0)
            {
                textSize = font.TextSize(text).X;
            }
            textSize += buttonTextOffset;
            Point buttonP1 = bottomLineCenter + new Point((int)-textSize / 2, (int)-font.maxHeight / 2);
            Point buttonP2 = bottomLineCenter + new Point((int)textSize / 2, (int)font.maxHeight / 2);

            Point buttonP1Outer = buttonP1 + new Point(-buttonEdge, -buttonEdge);
            Point buttonp2Outer = buttonP2 + new Point(buttonEdge, buttonEdge);

            Rectangle buttonRect     = new Rectangle(buttonP1, buttonP2);
            Rectangle buttonRectEdge = new Rectangle(buttonP1Outer, buttonp2Outer);

            Lcd.DrawRectangle(buttonRectEdge, true, true);
            Lcd.WriteTextBox(font, buttonRect, text, color, Lcd.Alignment.Center);
        }
Beispiel #14
0
		public void DrawRectangle (int xStart, int yStart, int xEnd, int yEnd,  bool color, bool fill)
		{
			Lcd.DrawRectangle(new Rectangle(new Point(xStart,yStart), new Point(xEnd, yEnd)), color, fill);	
		}