Ejemplo n.º 1
0
        private void initTileCategory()
        {
            TileCat      = new C1TileControl();
            TileCat.Dock = DockStyle.Fill;
            TileCat.Font = fEdit;

            TileCat.Orientation = LayoutOrientation.Horizontal;

            grRec = new Group();
            TileCat.Groups.Add(this.grRec);

            //peRec = new C1.Win.C1Tile.PanelElement();
            //ieRec = new C1.Win.C1Tile.ImageElement();
            tempRec                 = new C1.Win.C1Tile.Template();
            imageElementRec         = new C1.Win.C1Tile.ImageElement();
            peCat                   = new C1.Win.C1Tile.PanelElement();
            ieOrd                   = new C1.Win.C1Tile.ImageElement();
            teOrd                   = new TextElement();
            teOrd.Font              = fEdit;
            teCat                   = new TextElement();
            teCat.BackColorSelector = C1.Win.C1Tile.BackColorSelector.Unbound;
            teCat.ForeColor         = System.Drawing.Color.Black;
            teCat.ForeColorSelector = C1.Win.C1Tile.ForeColorSelector.Unbound;
            teCat.SingleLine        = true;

            imageElementRec.ImageLayout = C1.Win.C1Tile.ForeImageLayout.Stretch;
            //imageElementRec.
            //peOrd = new PanelElement();
            //peOrd.Alignment = System.Drawing.ContentAlignment.BottomLeft;
            //peOrd.Children.Add(ieOrd);
            //peOrd.Children.Add(teOrd);
            //peOrd.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
            //peCat.BackColor = tileFoodsNameColor;
            peCat.Children.Add(teCat);
            peCat.Dock    = System.Windows.Forms.DockStyle.Top;
            peCat.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);

            //TileCat.DefaultTemplate.Elements.Add(peOrd);
            TileCat.Templates.Add(this.tempRec);
            tempRec.Elements.Add(imageElementRec);

            tempRec.Elements.Add(peCat);

            //tempRec.Elements.Add(pnFoodsPrice);
            tempRec.Name                    = "tempFlickrrec";
            TileCat.ScrollOffset            = 0;
            TileCat.SurfaceContentAlignment = System.Drawing.ContentAlignment.TopLeft;
            TileCat.Padding                 = new System.Windows.Forms.Padding(0);
            TileCat.GroupPadding            = new System.Windows.Forms.Padding(20);
            //TileCat.BackColor = tileCatColor;       // tab recommend color
            //TileCat.Templates.Add(this.tempRec);

            //pnTilImage.BackColor = tilecolor;
            pnTilImage.Controls.Add(TileCat);
            setTileCategory();
            //for (int i = 0; i < dtCat.Rows.Count; i++)
            //{
            //    LoadFoods(false, i, dtCat.Rows[i]["foods_cat_id"].ToString());
            //}
        }
Ejemplo n.º 2
0
 private void AddTiles(List <ImageItem> imageList)
 {
     imageTileControl.Groups[0].Tiles.Clear();
     Console.WriteLine(imagesList.Count);
     foreach (var imageitem in imageList)
     {
         Tile tile = new Tile();
         tile.HorizontalSize = 2;
         tile.VerticalSize   = 2;
         imageTileControl.Groups[0].Tiles.Add(tile);
         Image    img = Image.FromStream(new MemoryStream(imageitem.Base64));
         Template tl  = new Template();
         C1.Win.C1Tile.ImageElement ie = new C1.Win.C1Tile.ImageElement();
         ie.ImageLayout = ForeImageLayout.Stretch;
         tl.Elements.Add(ie);
         tile.Template = tl;
         tile.Image    = img;
     }
 }
Ejemplo n.º 3
0
        private void initTC()
        {
            dtCat          = mposC.mposDB.foocDB.selectAll();
            dtRec          = mposC.mposDB.foocDB.selectAll();
            tC             = new C1DockingTab();
            tC.Dock        = System.Windows.Forms.DockStyle.Fill;
            tC.Location    = new System.Drawing.Point(0, 266);
            tC.Name        = "c1DockingTab1";
            tC.Size        = new System.Drawing.Size(669, 200);
            tC.TabIndex    = 0;
            tC.TabsSpacing = 5;
            tC.Font        = fEdit1;
            pnOrder.Controls.Add(tC);
            tabPage             = new C1DockingTabPage[dtCat.Rows.Count + 1];
            TileFoods           = new C1TileControl[dtCat.Rows.Count + 1];
            gr1                 = new Group[dtCat.Rows.Count + 1];
            tabPage[0]          = new C1DockingTabPage();
            tabPage[0].Location = new System.Drawing.Point(1, 24);
            tabPage[0].Name     = "c1DockingTabPage1";
            tabPage[0].Size     = new System.Drawing.Size(667, 175);
            tabPage[0].TabIndex = 0;
            tabPage[0].Text     = "Recommend";
            tabPage[0].Name     = "Page0";
            tC.Controls.Add(tabPage[0]);

            TileRec      = new C1TileControl();
            TileRec.Dock = DockStyle.Fill;
            if (mposC.iniC.TileFoodsOrientation.Equals("0"))
            {
                TileRec.Orientation = LayoutOrientation.Horizontal;
            }
            else
            {
                TileRec.Orientation = LayoutOrientation.Vertical;
            }
            grRec = new Group();
            TileRec.Groups.Add(this.grRec);
            grRec                          = new Group();
            panelElement1                  = new C1.Win.C1Tile.PanelElement();
            imageElement1                  = new C1.Win.C1Tile.ImageElement();
            tempFlickr                     = new C1.Win.C1Tile.Template();
            imageElement8                  = new C1.Win.C1Tile.ImageElement();
            textElement1                   = new C1.Win.C1Tile.TextElement();
            pnFoodsName                    = new C1.Win.C1Tile.PanelElement();
            pnFoodsPrice                   = new C1.Win.C1Tile.PanelElement();
            txtFoodsName                   = new C1.Win.C1Tile.TextElement();
            txtFoodsPrice                  = new C1.Win.C1Tile.TextElement();
            imageElement8.ImageLayout      = C1.Win.C1Tile.ForeImageLayout.ScaleOuter;
            txtFoodsName.BackColorSelector = C1.Win.C1Tile.BackColorSelector.Unbound;
            txtFoodsName.ForeColor         = System.Drawing.Color.Black;
            txtFoodsName.ForeColorSelector = C1.Win.C1Tile.ForeColorSelector.Unbound;
            txtFoodsName.SingleLine        = true;
            pnFoodsName.BackColor          = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            pnFoodsName.Children.Add(txtFoodsName);
            pnFoodsName.Dock    = System.Windows.Forms.DockStyle.Top;
            pnFoodsName.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
            pnFoodsPrice.AlignmentOfContents = System.Drawing.ContentAlignment.MiddleRight;
            pnFoodsPrice.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
            //panelElement11.Children.Add(panelElement12);
            pnFoodsPrice.Children.Add(txtFoodsPrice);
            pnFoodsPrice.Dock               = System.Windows.Forms.DockStyle.Bottom;
            pnFoodsPrice.FixedHeight        = 32;
            txtFoodsPrice.BackColorSelector = C1.Win.C1Tile.BackColorSelector.Unbound;
            txtFoodsPrice.Margin            = new System.Windows.Forms.Padding(0, 0, 37, 0);
            txtFoodsPrice.TextSelector      = C1.Win.C1Tile.TextSelector.Text1;
            textElement1.Font               = fEdit;
            TileRec.Font = fEdit;

            panelElement1.Alignment = System.Drawing.ContentAlignment.BottomLeft;
            panelElement1.Children.Add(imageElement1);
            panelElement1.Children.Add(textElement1);
            panelElement1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
            TileRec.DefaultTemplate.Elements.Add(panelElement1);
            TileRec.Templates.Add(this.tempFlickr);
            //TileFoods = new C1TileControl();
            TileRec.Name = "tilerec";
            TileRec.Dock = DockStyle.Fill;
            //pnOrder.Controls.Add(TileFoods);

            this.tempFlickr.Elements.Add(imageElement8);
            this.tempFlickr.Elements.Add(pnFoodsName);
            this.tempFlickr.Elements.Add(pnFoodsPrice);
            this.tempFlickr.Name            = "tempFlickrrec";
            TileRec.ScrollOffset            = 0;
            TileRec.SurfaceContentAlignment = System.Drawing.ContentAlignment.TopLeft;
            TileRec.Padding      = new System.Windows.Forms.Padding(0);
            TileRec.GroupPadding = new System.Windows.Forms.Padding(20);
            tabPage[0].Controls.Add(TileRec);
            for (int i = 1; i < dtCat.Rows.Count + 1; i++)
            {
                //if (i == 0)
                //{

                //}
                //else
                //{
                //if (i == dtCat.Rows.Count) continue;
                tabPage[i]          = new C1DockingTabPage();
                gr1[i]              = new Group();
                tabPage[i].Location = new System.Drawing.Point(1, 24);
                //tabPage.Name = "c1DockingTabPage"+i;
                tabPage[i].Size     = new System.Drawing.Size(667, 175);
                tabPage[i].TabIndex = 0;
                tabPage[i].Text     = dtCat.Rows[i - 1]["foods_cat_name"].ToString();
                tabPage[i].Name     = "Page" + i;

                //tabPage[i].Font = fEditB;
                tC.Controls.Add(tabPage[i]);

                TileFoods[i] = new C1TileControl();
                if (i == 1)
                {
                    intptr = TileFoods[i].Handle;
                }
                if (mposC.iniC.TileFoodsOrientation.Equals("0"))
                {
                    TileFoods[i].Orientation = LayoutOrientation.Horizontal;
                }
                else
                {
                    TileFoods[i].Orientation = LayoutOrientation.Vertical;
                }
                TileFoods[i].Groups.Add(this.gr1[i]);
                panelElement1                  = new C1.Win.C1Tile.PanelElement();
                imageElement1                  = new C1.Win.C1Tile.ImageElement();
                tempFlickr                     = new C1.Win.C1Tile.Template();
                imageElement8                  = new C1.Win.C1Tile.ImageElement();
                textElement1                   = new C1.Win.C1Tile.TextElement();
                pnFoodsName                    = new C1.Win.C1Tile.PanelElement();
                pnFoodsPrice                   = new C1.Win.C1Tile.PanelElement();
                txtFoodsName                   = new C1.Win.C1Tile.TextElement();
                txtFoodsPrice                  = new C1.Win.C1Tile.TextElement();
                imageElement8.ImageLayout      = C1.Win.C1Tile.ForeImageLayout.ScaleOuter;
                txtFoodsName.BackColorSelector = C1.Win.C1Tile.BackColorSelector.Unbound;
                txtFoodsName.ForeColor         = System.Drawing.Color.Black;
                txtFoodsName.ForeColorSelector = C1.Win.C1Tile.ForeColorSelector.Unbound;
                txtFoodsName.SingleLine        = true;
                pnFoodsName.BackColor          = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
                pnFoodsName.Children.Add(txtFoodsName);
                pnFoodsName.Dock    = System.Windows.Forms.DockStyle.Top;
                pnFoodsName.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
                pnFoodsPrice.AlignmentOfContents = System.Drawing.ContentAlignment.MiddleRight;
                pnFoodsPrice.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
                //panelElement11.Children.Add(panelElement12);
                pnFoodsPrice.Children.Add(txtFoodsPrice);
                pnFoodsPrice.Dock               = System.Windows.Forms.DockStyle.Bottom;
                pnFoodsPrice.FixedHeight        = 32;
                txtFoodsPrice.BackColorSelector = C1.Win.C1Tile.BackColorSelector.Unbound;
                txtFoodsPrice.Margin            = new System.Windows.Forms.Padding(0, 0, 37, 0);
                txtFoodsPrice.TextSelector      = C1.Win.C1Tile.TextSelector.Text1;
                textElement1.Font               = fEdit;
                TileFoods[i].Font               = fEdit;

                panelElement1.Alignment = System.Drawing.ContentAlignment.BottomLeft;
                panelElement1.Children.Add(imageElement1);
                panelElement1.Children.Add(textElement1);
                panelElement1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
                TileFoods[i].DefaultTemplate.Elements.Add(panelElement1);
                TileFoods[i].Templates.Add(this.tempFlickr);
                //TileFoods = new C1TileControl();
                TileFoods[i].Name = "tile" + i;
                TileFoods[i].Dock = DockStyle.Fill;
                //pnOrder.Controls.Add(TileFoods);

                this.tempFlickr.Elements.Add(imageElement8);
                this.tempFlickr.Elements.Add(pnFoodsName);
                this.tempFlickr.Elements.Add(pnFoodsPrice);
                this.tempFlickr.Name                 = "tempFlickr";
                TileFoods[i].ScrollOffset            = 0;
                TileFoods[i].SurfaceContentAlignment = System.Drawing.ContentAlignment.TopLeft;
                TileFoods[i].Padding                 = new System.Windows.Forms.Padding(0);
                TileFoods[i].GroupPadding            = new System.Windows.Forms.Padding(20);

                tabPage[i].Controls.Add(TileFoods[i]);
                //}
            }
        }