Esempio n. 1
0
        protected Janus.Windows.GridEX.GridEX GetFolderGrid(XMenuFolder folder)
        {
            Janus.Windows.GridEX.GridEX grid = new Janus.Windows.GridEX.GridEX();
            grid.BorderStyle      = Janus.Windows.GridEX.BorderStyle.None;
            grid.ColumnAutoResize = true;
            grid.ColumnHeaders    = Janus.Windows.GridEX.InheritableBoolean.False;
            grid.Dock             = DockStyle.Fill;
            grid.Font             = new Font("微软雅黑", 10);
            grid.GridLines        = Janus.Windows.GridEX.GridLines.None;
            grid.GroupByBoxFormatStyle.BackColor = Color.White;
            grid.GroupByBoxVisible = false;
            grid.GroupRowFormatStyle.BackColorGradient = System.Drawing.Color.White;
            grid.GroupRowFormatStyle.ForeColor         = System.Drawing.Color.Black;
            grid.GroupRowVisualStyle = Janus.Windows.GridEX.GroupRowVisualStyle.UseRowStyle;
            grid.BorderStyle         = Janus.Windows.GridEX.BorderStyle.None;

            grid.HideSelection = Janus.Windows.GridEX.HideSelection.Highlight;
            grid.Location      = new System.Drawing.Point(0, 0);
            grid.Name          = folder.FolderName;
            grid.VisualStyle   = Janus.Windows.GridEX.VisualStyle.Office2007;

            grid.RootTable = new Janus.Windows.GridEX.GridEXTable();

            grid.RootTable.HideColumnsWhenGrouped = Janus.Windows.GridEX.InheritableBoolean.True;

            AddGridColumns(grid);

            grid.RootTable.Groups.Add("FolderGroup");
            grid.RootTable.Groups[0].GroupPrefix = "";

            grid.DataSource = folder;

            return(grid);
        }
Esempio n. 2
0
        protected Janus.Windows.UI.Dock.UIPanelGroup GetFolderPanelGroup(XMenuFolder folder)
        {
            Janus.Windows.UI.Dock.UIPanelGroup group = new Janus.Windows.UI.Dock.UIPanelGroup();

            group.ActiveCaptionMode           = Janus.Windows.UI.Dock.ActiveCaptionMode.Never;
            group.CaptionFormatStyle.FontBold = Janus.Windows.UI.TriState.True;
            group.CaptionFormatStyle.FontSize = 12;
            if (ValidateImage(folder.Image))
            {
                group.Image = Image.FromFile(folder.Image);
            }
            if (ValidateImage(folder.LargeImage))
            {
                group.Image = Image.FromFile(folder.LargeImage);
            }

            group.Location           = new System.Drawing.Point(0, 0);
            group.Name               = folder.FolderName;
            group.Size               = new System.Drawing.Size(230, 276);
            group.Text               = folder.Title;
            group.StaticGroup        = true;
            group.Id                 = Guid.NewGuid();
            group.CloseButtonVisible = Janus.Windows.UI.InheritableBoolean.False;

            return(group);
        }
Esempio n. 3
0
        protected Janus.Windows.UI.Dock.UIPanelInnerContainer GetFolderContainer(XMenuFolder folder)
        {
            Janus.Windows.UI.Dock.UIPanelInnerContainer inner = new Janus.Windows.UI.Dock.UIPanelInnerContainer();
            inner.Location = new System.Drawing.Point(1, 1);
            inner.Name     = folder.FolderName + "Container";
            inner.Dock     = DockStyle.Fill;
            inner.TabIndex = 0;

            return(inner);
        }
Esempio n. 4
0
        public DataSet GetFolderDataSet()
        {
            DataSet folderSet = new DataSet();

            foreach (XMenuFolderInfo folderInfo in this.m_MenuFolderInfos)
            {
                XMenuFolder menuFolder = this.MenuInfo2MenuFolder(folderInfo);
                folderSet.Tables.Add(menuFolder);
            }

            return(folderSet);
        }
Esempio n. 5
0
 protected Janus.Windows.UI.Dock.UIPanel GetFolderPanel(XMenuFolder folder)
 {
     Janus.Windows.UI.Dock.UIPanel panel = new Janus.Windows.UI.Dock.UIPanel();
     panel.ActiveCaptionMode           = Janus.Windows.UI.Dock.ActiveCaptionMode.Never;
     panel.CaptionFormatStyle.FontSize = 10;
     panel.CaptionStyle   = Janus.Windows.UI.Dock.PanelCaptionStyle.Light;
     panel.CaptionVisible = Janus.Windows.UI.InheritableBoolean.False;
     panel.ImageIndex     = 7;
     panel.Location       = new System.Drawing.Point(0, 27);
     panel.Name           = folder.FolderName + "Panel";
     panel.Size           = new System.Drawing.Size(230, 249);
     panel.Id             = Guid.NewGuid();
     return(panel);
 }
Esempio n. 6
0
        public void InitFolder(XMenuFolder folder)
        {
            if (folder.Rows.Count > 0)
            {
                Janus.Windows.GridEX.GridEX grid;
                Janus.Windows.UI.Dock.UIPanelInnerContainer container = GetFolderContainer(folder);
                Janus.Windows.UI.Dock.UIPanel      panel = GetFolderPanel(folder);
                Janus.Windows.UI.Dock.UIPanelGroup group = GetFolderPanelGroup(folder);
                grid = GetFolderGrid(folder);

                container.Dock = DockStyle.Fill;
                panel.Controls.Add(container);
                panel.DockStyle = Janus.Windows.UI.Dock.PanelDockStyle.Fill;
                group.Panels.Add(panel);
                m_MenuPanel.Panels.Add(group);
                group.Tag = grid;
                grid.Font = new Font("微软雅黑", 10);
                grid.Dock = DockStyle.Fill;
                container.Controls.Add(grid);
                grid.Click += new EventHandler(grid_Click);
            }
        }
Esempio n. 7
0
        public XMenuFolder MenuInfo2MenuFolder(XMenuFolderInfo folderInfo)
        {
            XMenuFolder menuTable = new XMenuFolder();

            menuTable.FolderName = folderInfo.FolderName;
            menuTable.Image      = folderInfo.ImageFile;
            menuTable.LargeImage = folderInfo.LargeImageFile;
            menuTable.Title      = folderInfo.Title;

            foreach (XMenuGroupInfo groupInfo in folderInfo.MenuGroupInfos)
            {
                foreach (XMenuInfo menuInfo in groupInfo.Menus)
                {
                    DataRow menuRow = menuTable.NewRow();

                    XMenuInfoTool.MenuInfo2MenuRow(menuInfo, menuRow);

                    menuTable.Rows.Add(menuRow);
                }
            }

            return(menuTable);
        }