Пример #1
0
        private void LoadTitleBar(TileBarGroup group)
        {
            DataTable dt = new DataTable();

            try
            {
                String sSql;
                sSql = "SELECT T3.[ID_MENU],[KEY_MENU],CASE " + Commons.Modules.TypeLanguage.ToString() + " WHEN 0 THEN T3.[TEN_MENU] WHEN 1 THEN ISNULL(NULLIF(T3.[TEN_MENU_A],''),T3.[TEN_MENU]) ELSE ISNULL(NULLIF(T3.[TEN_MENU_H],''),T3.[TEN_MENU]) END AS NAME,[ROOT],[HIDE],[BACK_COLOR],[IMG],[STT_MENU],[CONTROLS],[DROPDOW] FROM NHOM_MENU T1 INNER JOIN dbo.USERS T2 ON T1.ID_NHOM = T2.ID_NHOM INNER JOIN dbo.MENU T3 ON T1.ID_MENU = T3.ID_MENU  WHERE T2.USER_NAME = '" + Commons.Modules.UserName + "' AND [ROOT] = 0 ORDER BY[STT_MENU],[NAME]";
                dt.Load(SqlHelper.ExecuteReader(Commons.IConnections.CNStr, CommandType.Text, sSql));
                foreach (DataRow item in dt.Rows)
                {
                    TileBarItem itembar = new TileBarItem();
                    itembar.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.TopLeft;
                    itembar.ItemSize       = TileBarItemSize.Wide;
                    itembar.Text           = item["NAME"].ToString();
                    itembar.AppearanceItem.Normal.BackColor = System.Drawing.ColorTranslator.FromHtml(item["BACK_COLOR"].ToString());
                    itembar.Image         = (Image)Properties.Resources.ResourceManager.GetObject(item["IMG"].ToString());
                    itembar.TextAlignment = TileItemContentAlignment.MiddleRight;
                    itembar.Tag           = item["ID_MENU"].ToString();
                    itembar.Name          = item["ID_MENU"].ToString();
                    titlegroup.Items.Add(itembar);
                }
            }

            catch (Exception EX)
            {
                XtraMessageBox.Show(EX.Message.ToString());
            }
        }
Пример #2
0
        private void Set_Form()
        {
            do_refresh();
            TileBarGroup group1 = new TileBarGroup();

            tileControl1.Groups.Add(group1);
            group1.Text = "ÜRüNLER";

            foreach (var item in speedSaleProducts)
            {
                TileBarItem item1 = new TileBarItem();
                item1.ItemSize = (TileBarItemSize)item.ButtonType;
                item1.Text     = products.Where(x => x.PID == item.ProductId).FirstOrDefault().PName;
                item1.Name     = Convert.ToString(products.Where(x => x.PID == item.ProductId).FirstOrDefault().PID);
                if (products.Where(x => x.PID == item.ProductId).FirstOrDefault().PImages.Length > 0)
                {
                    item1.BackgroundImage          = byteArrayToImage(products.Where(x => x.PID == item.ProductId).FirstOrDefault().PImages); // System.Text.Encoding.Default.GetString(products.Where(x => x.PID == item.ProductId).FirstOrDefault().PImages);
                    item1.BackgroundImageAlignment = TileItemContentAlignment.Default;
                    item1.BackgroundImageScaleMode = TileItemImageScaleMode.Stretch;
                }

                item1.ImageToTextAlignment              = TileControlImageToTextAlignment.Default;
                item1.BorderVisibility                  = TileItemBorderVisibility.Always;
                item1.AppearanceItem.Normal.ForeColor   = Color.Black;
                item1.AppearanceItem.Normal.BorderColor = Color.Black;
                item1.AppearanceItem.Normal.Font        = new System.Drawing.Font("Tahoma", 13F);
                group1.Items.Add(item1);
            }
        }
Пример #3
0
        private void MakeTileBar()
        {
            // https://documentation.devexpress.com/WPF/DevExpress.Xpf.Navigation.TileBar.Orientation.property
            tileBar1.Orientation = System.Windows.Forms.Orientation.Vertical;
            tileBar1.AppearanceItem.Normal.BackColor = Color.FromArgb(65, 168, 207);
            tileBar1.AppearanceItem.Normal.ForeColor = Color.White;
            TileBarGroup group1 = new TileBarGroup();

            tileBar1.Groups.Add(group1);


            TileBarItem tile1 = new TileBarItem();

            tile1.ItemSize = DevExpress.XtraBars.Navigation.TileBarItemSize.Wide;
            tile1.AppearanceItem.Normal.BackColor = arrColor[0];
            tile1.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True;
            tile1.Elements.Add(new TileItemElement()
            {
                Text = "", Image = DevExpress.Images.ImageResourceCache.Default.GetImage(arrImage[0]), ImageAlignment = TileItemContentAlignment.TopLeft
            });
            tile1.Elements.Add(new TileItemElement()
            {
                Text = "Main", TextAlignment = TileItemContentAlignment.BottomLeft
            });

            group1.Items.Add(tile1);
        }
Пример #4
0
        private void MakeTileBar()
        {
            // https://documentation.devexpress.com/WPF/DevExpress.Xpf.Navigation.TileBar.Orientation.property
            tileBar1.Orientation = System.Windows.Forms.Orientation.Vertical;
            tileBar1.AppearanceItem.Normal.BackColor = Color.FromArgb(65, 168, 207);
            tileBar1.AppearanceItem.Normal.ForeColor = Color.White;
            TileBarGroup group1 = new TileBarGroup();

            tileBar1.Groups.Add(group1);

            //TileBarItem tile1 = new TileBarItem();
            //tile1.ItemSize = DevExpress.XtraBars.Navigation.TileBarItemSize.Wide;
            //tile1.Elements.Add(new TileItemElement() { Text = "", Image = DevExpress.Images.ImageResourceCache.Default.GetImage("office2013/actions/add_16x16.png"), ImageAlignment = TileItemContentAlignment.TopLeft });
            //tile1.Elements.Add(new TileItemElement() { Text = "Sales", TextAlignment = TileItemContentAlignment.BottomLeft });

            for (int x = 0; x < 5; x++)
            {
                TileBarItem tile1 = new TileBarItem();
                tile1.ItemSize = DevExpress.XtraBars.Navigation.TileBarItemSize.Wide;
                tile1.AppearanceItem.Normal.BackColor = arrColor[x];
                tile1.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True;
                tile1.Elements.Add(new TileItemElement()
                {
                    Text = "", Image = DevExpress.Images.ImageResourceCache.Default.GetImage(arrImage[x]), ImageAlignment = TileItemContentAlignment.TopLeft
                });
                tile1.Elements.Add(new TileItemElement()
                {
                    Text = "Sales", TextAlignment = TileItemContentAlignment.BottomLeft
                });
                group1.Items.Add(tile1);
            }


            //tileItemElement1.Image = DevExpress.Images.ImageResourceCache.Default.GetImage("office2013/actions/add_16x16.png");
            //tileItemElement1.ImageAlignment = TileItemContentAlignment.TopLeft;
            //tileItemElement1.Text = "";
            //tileItemElement5.Text = "<size=+4>Export and Mail";
            //tileItemElement5.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.BottomRight;
        }
Пример #5
0
        public MyUserControl01(string eqp, Color eqlColor, string la1, string la2, string la3, int chartSize)
        {
            InitializeComponent();
            string eqpName = eqp;

            labelControl1.Text = la1;
            labelControl2.Text = la2;
            labelControl3.Text = la3;


            tileBar1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            tileBar1.AppearanceItem.Normal.BackColor = Color.FromArgb(65, 168, 207);
            tileBar1.AppearanceItem.Normal.ForeColor = Color.White;
            TileBarGroup group1 = new TileBarGroup();

            tileBar1.Groups.Add(group1);
            tileBar1.WideTileWidth = 120;
            tileBar1.ItemSize      = 65;
            tileBar1.Padding       = new Padding()
            {
                All = 0, Left = 10
            };
            tileBar1.HorizontalContentAlignment = DevExpress.Utils.HorzAlignment.Near;
            tileBar1.VerticalContentAlignment   = DevExpress.Utils.VertAlignment.Top;
            TileBarItem tile1 = new TileBarItem();

            tile1.ItemSize = DevExpress.XtraBars.Navigation.TileBarItemSize.Wide;
            tile1.AppearanceItem.Normal.BackColor = eqlColor;
            tile1.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True;
            tile1.Elements.Add(new TileItemElement()
            {
                Text = "", Image = DevExpress.Images.ImageResourceCache.Default.GetImage("office2013/gauges/gaugestylethreeforthcircular_32x32.png"), ImageAlignment = TileItemContentAlignment.BottomRight
            });
            tile1.Elements.Add(new TileItemElement()
            {
                Text = string.Format("<size=8>{0}</size>", eqpName), TextAlignment = TileItemContentAlignment.TopLeft
            });
            //tile1.Elements.Add(new TileItemElement() { Text = string.Format("<size=8>{0}</size><br><size=8>Equipment<br>running rate</size>", eqpName), TextAlignment = TileItemContentAlignment.TopLeft });
            group1.Items.Add(tile1);

            tile1.ItemClick += Tile1_ItemClick;

            var series = new Series(" ", ViewType.FullStackedArea);

            series.ArgumentScaleType = ScaleType.Auto;
            series.LabelsVisibility  = DefaultBoolean.True;
            chartControl1.Series.Add(series);
            this.chartControl1.Legend.TextVisible = false;
            this.chartControl1.Legend.Visibility  = DevExpress.Utils.DefaultBoolean.False;

            Random r = new Random();

            for (int x = 0; x < chartSize; x++)
            {
                if (x % 4 == 1)
                {
                    CreateSeries(x + r.Next(0, 100), Color.LightGreen);
                }
                else if (x % 4 == 2)
                {
                    CreateSeries(x + r.Next(0, 10), Color.PaleGoldenrod);
                }
                else if (x % 4 == 3)
                {
                    CreateSeries(x + r.Next(0, 5), Color.Gainsboro);
                }
                else if (x % 4 == 0)
                {
                    CreateSeries(x + r.Next(0, 20), Color.LightPink);
                }
            }
            SecondaryAxisY secondaryAxisY1 = new SecondaryAxisY();

            secondaryAxisY1.VisibleInPanesSerializable      = "-1";
            secondaryAxisY1.WholeRange.Auto                 = false;
            secondaryAxisY1.WholeRange.MaxValueSerializable = "24";
            secondaryAxisY1.WholeRange.MinValueSerializable = "1";



            //((XYDiagram)chartControl1.Diagram).AxisX.Range.SideMarginsEnabled = false;
            ((XYDiagram)chartControl1.Diagram).Rotated          = true;
            ((XYDiagram)chartControl1.Diagram).AxisX.Visibility = DevExpress.Utils.DefaultBoolean.True;
            ((XYDiagram)chartControl1.Diagram).AxisX.VisibleInPanesSerializable       = "-1";
            ((XYDiagram)chartControl1.Diagram).AxisX.VisualRange.Auto                 = false;
            ((XYDiagram)chartControl1.Diagram).AxisX.VisualRange.MaxValueSerializable = "200";
            ((XYDiagram)chartControl1.Diagram).AxisX.VisualRange.MinValueSerializable = "1";
            ((XYDiagram)chartControl1.Diagram).AxisX.WholeRange.Auto = false;
            ((XYDiagram)chartControl1.Diagram).AxisX.WholeRange.MaxValueSerializable = "200";
            ((XYDiagram)chartControl1.Diagram).AxisX.WholeRange.MinValueSerializable = "1";
            ((XYDiagram)chartControl1.Diagram).AxisY.Visibility = DevExpress.Utils.DefaultBoolean.True;
            ((XYDiagram)chartControl1.Diagram).AxisY.VisibleInPanesSerializable = "-1";
            ((XYDiagram)chartControl1.Diagram).SecondaryAxesY.AddRange(new SecondaryAxisY[] { secondaryAxisY1 });

            //XYDiagram xyDiagram1 = new XYDiagram();
            //xyDiagram1.Rotated = true;
            //chartControl1.Diagram = xyDiagram1;
            MakePointChart();
        }
        private TileBarItem CreateBarItem(IContentContainer container)
        {
            var view = container.Manager.View as WindowsUIView;
            if (view == null)
            {
                return null;
            }
            var tileBarItem = new TileBarItem()
            {
                Text = String.IsNullOrEmpty(container.Caption) ? container.Subtitle : container.Caption,
                TextAlignment = TileItemContentAlignment.MiddleLeft,
                ItemSize = TileBarItemSize.Wide,
                SuperTip = new SuperToolTip()
            };
            tileBarItem.SuperTip.Items.Add(tileBarItem.Text);
            tileBarItem.ItemClick += (s, e) => view.ActivateContainer(container);
            tileBarItem.DropDownOptions.AutoHeight = DefaultBoolean.True;

            var tileContainer = container as TileContainer;

            if (tileContainer != null && tileContainer.Items.Count > 0)
            {
                var ddContainer = new TileBarDropDownContainer
                {
                    Height = (int) (view.Manager.ContainerControl.Height*0.33f),
                    BorderStyle = BorderStyles.Flat
                };
                ddContainer.Appearance.BorderColor = Color.FromArgb(160,160,160);
                
                var ddTileBar = new TileBar
                {
                    ItemSize = 25,
                    Dock = DockStyle.Fill,
                    Orientation = Orientation.Horizontal,
                    BackColor = this.tileBarNavigation.BackColor
                };
                //ddTileBar.AppearanceItem.Normal.BackColor = Color.FromArgb(37, 116, 169);
                ddTileBar.AppearanceItem.Normal.BackColor = Color.Transparent;
                ddTileBar.AppearanceItem.Normal.ForeColor = Color.FromArgb(59, 59, 59);
                ddTileBar.AppearanceItem.Normal.TextOptions.HAlignment = HorzAlignment.Near;
                ddTileBar.AppearanceItem.Normal.TextOptions.VAlignment = VertAlignment.Center;
                ddTileBar.AppearanceItem.Normal.TextOptions.Trimming = Trimming.EllipsisCharacter;
                ddTileBar.AppearanceItem.Normal.TextOptions.WordWrap = WordWrap.NoWrap;
                ddTileBar.ScrollMode = TileControlScrollMode.ScrollButtons;

                var ddTileGroup = new TileBarGroup();
                ddTileBar.Groups.Add(ddTileGroup);
                foreach (var item in tileContainer.Items)
                {
                    if (item == null)
                    {
                        continue;
                    }
                    var tile = (Tile)item;
                    var childContainer = tile.ActivationTarget;
                    var childDocument = tile.Document;
                    var menuItem = new TileBarItem() { ItemSize = TileBarItemSize.Wide };

                    if (childContainer != null)
                    {
                        menuItem.Text = String.IsNullOrEmpty(childContainer.Subtitle) ? childContainer.Caption : childContainer.Subtitle;
                        menuItem.ItemClick += (s, e) => view.ActivateContainer(childContainer);
                    }
                    else if (childDocument != null)
                    {
                        menuItem.Text = childDocument.Caption;
                        menuItem.ItemClick += (s, e) => view.ActivateDocument(childDocument);
                    }
                    else
                    {
                        continue;
                    }
                    ddTileGroup.Items.Add(menuItem);
                }
                ddContainer.Controls.Add(ddTileBar);
                tileBarItem.DropDownControl = ddContainer;
            }
            return tileBarItem;
        }