private void Init(string c, GBitmap t)
 {
     this.Capture   = c;
     this.Thumbnail = t;
     this.Width     = Thumbnail.Width;
     this.Height    = Thumbnail.Height + GFont.GetLetterDimension(1) + 10;
 }
Esempio n. 2
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);
        }
Esempio n. 3
0
        public override void Render(GBitmap screen)
        {
            for (int i = 0; i < Items.Length; ++i)
            {
                string Output = Items[i];

                if (i == Selected)
                {
                    Output = "> " + Output + " <";
                }

                GFont.WriteXCenter(screen, Output, FontSize, StartY + i * 20);
            }
        }
Esempio n. 4
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);
 }
Esempio n. 5
0
        public override void Render(GBitmap screen)
        {
            int yo = Y;

            foreach (string line in Lines)
            {
                if (X > 0)
                {
                    GFont.Write(screen, line, 1, X, yo);
                }
                else
                {
                    GFont.WriteXCenter(screen, line, 1, yo);
                }

                yo += 15;
            }
        }
        public override void Render(GBitmap screen)
        {
            int index = 0;
            int cols  = 0;

            int sx = X;
            int x  = sx;
            int y  = Y;

            foreach (GridItem item in Grid)
            {
                if (ItemW != -1 && ItemH != -1)
                {
                    item.Width  = ItemW;
                    item.Height = ItemH;
                }

                ++cols;

                if (Selected == index)
                {
                    screen.FillRect(SelectionColor, x - SelectionBorder, y - SelectionBorder, item.Width + SelectionBorder, item.Height + SelectionBorder);
                    screen.EraseRect(x, y, item.Width - SelectionBorder, item.Height - SelectionBorder);
                }

                screen.Blit(item.Thumbnail, x + (item.Width - item.Thumbnail.Width) / 2, y + (item.Height - item.Thumbnail.Height) / 2);
                GFont.WriteCenter(screen, item.Capture, 1, x, y + item.Height + 10, item.Width);

                x += item.Width + Margin;

                if (cols >= MaxRowWidth)
                {
                    cols = 0;
                    x    = sx;
                    y   += item.Height + 20 + Margin;
                }

                ++index;
            }
        }
Esempio n. 7
0
        public override void Render(Gfx.GBitmap screen)
        {
            if (Text != null)
            {
                switch (Alignment)
                {
                case TextAlignment.CenterScreen:
                    GFont.WriteXCenter(screen, Text, Size, Y);
                    break;

                case TextAlignment.Left:
                    GFont.Write(screen, Text, Size, X, Y);
                    break;

                case TextAlignment.Right:
                    GFont.WriteRight(screen, Text, Size, X, Y, Width);
                    break;

                case TextAlignment.Center:
                    GFont.WriteCenter(screen, Text, Size, X, Y, Width);
                    break;
                }
            }
        }
 public override void Render(GBitmap screen)
 {
     GFont.Write(screen, "<" + Values[CurrentIndex] + ">", 1, X, Y);
 }