Esempio n. 1
0
        public static TableLine InputArea(IWidget parent, string label, int x, int y, int width = 440, int height = 30)
        {
            var rv = new TableLine(parent, height);

            rv.AddColumn(width, null, Align.Left, 20, Palette.Black, new GfxPoint(5, 5));

            var outline = VGPath.OpenVGPath();

            VGU.vguRoundRect(outline, 0, 0, width, height, 5, 5);

            rv.AddVGPath(new VGPath(outline, new VGSolidColor(Palette.LightGrey), new VGSolidColor(Palette.TextArea.Background)));
            rv.Move(x, y);

            var hitLabel = new TextArea(rv, 0, 0, rv.Width, rv.Height);

            hitLabel.SetAlign(Align.Left, new GfxPoint(5, 5));
            hitLabel.SetFont(Palette.DarkSlateGray, 20);
            hitLabel.Text = label;

            rv.OnPaint += caller =>
            {
                if (string.IsNullOrEmpty(rv.Text[0].Text))
                {
                    hitLabel.Show();
                }
                else
                {
                    hitLabel.Hide();
                }
            };


            return(rv);
        }
Esempio n. 2
0
        public static TableLine DateTime(IWidget parent, int x, int y)
        {
            const int kHeight = 40;

            var rv = new TableLine(parent, kHeight);

            rv.AddColumn(35, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // hour
            rv.AddColumn(15, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // :
            rv.AddColumn(35, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // minute
            rv.AddColumn(0, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5));  // :
            rv.AddColumn(0, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5));  // seconds
            rv.AddColumn(20, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // " - "

            rv.AddColumn(35, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // day
            rv.AddColumn(15, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // "/"
            rv.AddColumn(35, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // month
            rv.AddColumn(15, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // "/"
            rv.AddColumn(80, null, Align.Center, 40, Palette.Black, new GfxPoint(5, 5)); // year

            //rv.AddColumn(30, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // seconds

            var outline = VGPath.OpenVGPath();

            VGU.vguRoundRect(outline, 0, 0, rv.Width, kHeight, 5, 5);

            rv.AddVGPath(new VGPath(outline, new VGSolidColor(Palette.LightGrey), new VGSolidColor(Palette.TextArea.Background)));
            rv.Move(x, y);

            {
                rv.Text[0].Text = "09";
                rv.Text[1].Text = ":";
                rv.Text[2].Text = "00";
                rv.Text[3].Text = ":";
                rv.Text[4].Text = "00";
                rv.Text[5].Text = " - ";


                rv.Text[6].Text  = "01";
                rv.Text[7].Text  = "/";
                rv.Text[8].Text  = "03";
                rv.Text[9].Text  = "/";
                rv.Text[10].Text = "2014";
                //rv.Text[0].Text = ":";
                //rv.Text[0].Text = "14";
            }

            return(rv);
        }
Esempio n. 3
0
        public static TableLine DateTime(IWidget parent, int x, int y)
        {
            const int kHeight = 30;

            var rv = new TableLine(parent, kHeight);

            rv.AddColumn(25, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // hour
            rv.AddColumn(10, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // :
            rv.AddColumn(25, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // minute
            rv.AddColumn(0, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5));  // :
            rv.AddColumn(0, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5));  // seconds
            rv.AddColumn(15, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // " - "

            rv.AddColumn(25, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // day
            rv.AddColumn(10, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // "/"
            rv.AddColumn(25, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // month
            rv.AddColumn(10, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // "/"
            rv.AddColumn(55, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // year

            //rv.AddColumn(30, null, Align.Center, 20, Palette.Black, new GfxPoint(5, 5)); // seconds

            var outline = VGPath.OpenVGPath();

            VGU.vguRoundRect(outline, 0, 0, rv.Width, kHeight, 5, 5);

            rv.AddVGPath(new VGPath(outline, new VGSolidColor(Palette.LightGrey), new VGSolidColor(Palette.TextArea.Background)));
            rv.Move(x, y);

            foreach (var label in rv.Text)
            {
                label.SetFont(Palette.Black, 25);
                label.SetAlign(Align.Center);
            }

            //rv.OnShow += caller =>
            {
                rv.Text[0].Text = "09";
                rv.Text[1].Text = ":";
                rv.Text[2].Text = "00";
                rv.Text[3].Text = ":";
                rv.Text[4].Text = "00";
                rv.Text[5].Text = " - ";


                rv.Text[6].Text  = "01";
                rv.Text[7].Text  = "/";
                rv.Text[8].Text  = "03";
                rv.Text[9].Text  = "/";
                rv.Text[10].Text = "2014";
                //rv.Text[0].Text = ":";
                //rv.Text[0].Text = "14";
            }



            rv.OnPress += caller =>
            {
                var cell = caller as TextArea;
                if (cell != null)
                {
                    cell.SetFont(Palette.Red);
                }
            };

            return(rv);
        }