Beispiel #1
0
        public override void Render(GBitmap screen)
        {
            if (IsFocused)
            {
                if (_isLastAddition > 0)
                {
                    GFont.Write(screen, "<", 2, X, Y);
                    GFont.Write(screen, "        >", 1, X, Y + GFont.GetLetterDimension(2) / 4);
                }
                else if (_isLastSubtraction > 0)
                {
                    GFont.Write(screen, "<", 1, X, Y + GFont.GetLetterDimension(2) / 4);
                    GFont.Write(screen, "    >", 2, X, Y);
                }
                else
                {
                    GFont.Write(screen, "<   >", 2, X, Y);
                }
            }
            int xOffset = 0;

            if (Value.ToString().Length < 3)
            {
                xOffset = GFont.GetStringWidth(" ", 2) / 2;
            }
            if (Value.ToString().Length < 2)
            {
                xOffset += GFont.GetStringWidth(" ", 2) / 2;
            }
            GFont.Write(screen, " " + Value, 2, X + xOffset, Y);
        }
Beispiel #2
0
 public override void Render(Gfx.GBitmap screen)
 {
     if (IsFocused)
     {
         int x = X + GFont.GetStringWidth(Text.Substring(0, _cursorPos), Size);
         if (_cursorShowing > 0)
         {
             screen.DrawLine(Color.White, 2, x, Y, x, Y + Height);
         }
         _cursorShowing--;
         if (_cursorShowing < -8)
         {
             _cursorShowing = 8;
         }
     }
     base.Render(screen);
 }