예제 #1
0
        //加载功能
        private void LoadModule(ModuleModel m, out NavBarGroup CurrentGroup, out BarSubItem CurrentBarItem)
        {
            var ModuleImage = LoadUIImage.LoadNavBarImage_Group(ConvertLib.ToString(m.ModuleImg));

            //添加模块到navBarControl1

            //m.ModuleName = "(新)" + m.ModuleName;
            //LoadModule(hp, dtModulesFun, m);
            //hp.CurrentGroup.Appearance.ForeColor = Color.FromArgb(0x99, 0x00, 0x33);
            //hp.CurrentGroup.Appearance.Font = new Font(hp.CurrentGroup.Appearance.Font, FontStyle.Bold);

            CurrentGroup = new NavBarGroup()
            {
                Caption    = m.Caption,
                SmallImage = ModuleImage,
                Tag        = m
            };
            navBarControl1.Groups.Add(CurrentGroup);


            //添加模块到bbi_Module
            CurrentBarItem = new BarSubItem()
            {
                Caption = m.Caption,
                Glyph   = ModuleImage
            };
            if (m.IsNew)
            {
                CurrentGroup.Appearance.ForeColor = Color.FromArgb(0x99, 0x00, 0x33);
                CurrentGroup.Appearance.Font      = new Font(CurrentGroup.Appearance.Font, FontStyle.Bold);
            }

            ribbonControl1.Items.Add(CurrentBarItem);
            bsi_Modules.AddItem(CurrentBarItem);
        }
        private NavBarGroup LoadModule(Module v)
        {
            var group = navBarControl1.Groups.Add();

            group.Caption    = v.ModuleName;
            group.SmallImage = LoadUIImage.LoadNavBarImage_Group(v.ModuleImg);
            group.Tag        = v.Tag;

            LoadFunction(group, v);
            return(group);
        }
예제 #3
0
        public void SetViewPopMenu(GridView gv)
        {
            if (CheckDesingModel.IsDesingMode)
            {
                return;
            }

            var AutoWidth = new GridViewAddPopupMenuBase(gv, "自动调整列宽", LoadUIImage.LoadImage("View_16x16.png"));

            AutoWidth.DoEvent += AutoWidth_DoEvent;
            new ViewLayout(gv);
        }
        //恢复模块默认设置
        private void btn_ModuleRecover_Click(object sender, EventArgs e)
        {
            DataRow dr = navBarControl1.ActiveGroup.Tag as DataRow;

            dr[sys_Modules.ModuleName] = dr[sys_Modules.ModuleNameRef];
            dr[sys_Modules.Img]        = dr[sys_Modules.ImgRef];
            txt_ModuleName.EditValue   = dr[sys_Modules.ModuleName];
            txt_ModuleImage.EditValue  = dr[sys_Modules.Img];

            navBarControl1.ActiveGroup.Caption    = dr[sys_Modules.ModuleName].ToString();
            navBarControl1.ActiveGroup.SmallImage = LoadUIImage.LoadNavBarImage_Group(dr[sys_Modules.Img].ToString());
        }
        //设置功能小图标
        private void txt_FunImgSmall_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (FocusButton == null)
            {
                return;
            }
            var img = GetImage();

            if (!String.IsNullOrEmpty(img))
            {
                ((FocusButton.Tag as NavBarItem).Tag as DataRow)[sys_ModulesFunction.ImgSmall] = img;
                (FocusButton.Tag as NavBarItem).SmallImage = LoadUIImage.LoadNavBarImage_Item(img);
            }
        }
예제 #6
0
        public ViewLayout(GridView gv)
        {
            View = gv;
            Form frm = gv.GridControl.FindForm();

            ViewCode  = string.Format("{0}.{1}", frm.GetType().FullName, gv.Name);
            bll       = new bllGridViewLayout();
            frm.Load += frm_Load;

            var Layout        = new GridViewAddPopupMenuBase(gv, "布局管理", LoadUIImage.LoadImage("LayoutOptions_16x16.png"));
            var LayoutRefresh = new GridViewAddPopupMenuBase(gv, "刷新布局", LoadUIImage.LoadImage("Refresh_16x16.png"));

            Layout.DoEvent        += Layout_DoEvent;
            LayoutRefresh.DoEvent += LayoutRefresh_DoEvent;
        }
        //设置模块图标
        private void txt_ModuleImage_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (navBarControl1.ActiveGroup == null)
            {
                return;
            }
            var img = GetImage();

            if (!String.IsNullOrEmpty(img))
            {
                txt_ModuleImage.EditValue = img;
                (navBarControl1.ActiveGroup.Tag as DataRow)[sys_Modules.Img] = img;
                navBarControl1.ActiveGroup.SmallImage = LoadUIImage.LoadNavBarImage_Group(img);
            }
        }
        private void LoadFunction(NavBarGroup group, Module v)
        {
            DataRow drFunction;

            foreach (ModuleFunction f in v.FunctionCollection)
            {
                var  SlectFunctions = dtModulesFunction.Select(String.Format("{0}='{1}'", sys_ModulesFunction.FunctionID, f.FunctionID));
                bool IsNew          = SlectFunctions.Length == 0;
                if (!IsNew)
                {
                    drFunction        = SlectFunctions[0];
                    drFunction["Tag"] = "Y";
                    drFunction.AcceptChanges();
                }
                else
                {
                    drFunction        = dtModulesFunction.Rows.Add();
                    drFunction["Tag"] = "Y";
                    drFunction[sys_ModulesFunction.FunctionID]   = f.FunctionID;
                    drFunction[sys_ModulesFunction.FunctionName] = f.FunctionName;
                    drFunction[sys_ModulesFunction.ModuleID]     = f.ModuleID;
                    drFunction[sys_ModulesFunction.ImgLarge]     = f.FunctionPngLarge;
                    drFunction[sys_ModulesFunction.ImgSmall]     = f.FunctionPngSmall;
                    drFunction[sys_ModulesFunction.GroupIndex]   = -1;
                    drFunction[sys_ModulesFunction.ItemIndex]    = -1;
                }
                drFunction[sys_ModulesFunction.FunctionNameRef] = f.FunctionName;
                drFunction[sys_ModulesFunction.ImgLargeRef]     = f.FunctionPngLarge;
                drFunction[sys_ModulesFunction.ImgSmallRef]     = f.FunctionPngSmall;


                //添加功能到navBarControl1
                NavBarItem item = navBarControl1.Items.Add();
                item.Caption = drFunction[sys_ModulesFunction.FunctionName].ToString();
                if (IsNew == true)
                {
                    item.Appearance.ForeColor = Color.FromArgb(0x99, 0x00, 0x33);
                    item.Appearance.Font      = new Font(group.Appearance.Font, FontStyle.Bold);
                }
                item.SmallImage = LoadUIImage.LoadNavBarImage_Item(drFunction[sys_ModulesFunction.ImgSmall].ToString());
                item.Tag        = drFunction;
                group.ItemLinks.Add(item);

                LoadFunctionAuthority(f);
            }
        }
        private void btn_FunctionRecover_Click(object sender, EventArgs e)
        {
            if (FocusButton == null)
            {
                return;
            }
            DataRow dr = (FocusButton.Tag as NavBarItem).Tag as DataRow;

            dr[sys_ModulesFunction.FunctionName] = dr[sys_ModulesFunction.FunctionNameRef];
            dr[sys_ModulesFunction.ImgLarge]     = dr[sys_ModulesFunction.ImgLargeRef];
            dr[sys_ModulesFunction.ImgSmall]     = dr[sys_ModulesFunction.ImgSmallRef];

            txt_FunName.EditValue       = dr[sys_ModulesFunction.FunctionName];
            txt_FunImageLarge.EditValue = dr[sys_ModulesFunction.ImgLarge];
            txt_FunImgSmall.EditValue   = dr[sys_ModulesFunction.ImgSmall];


            FocusButton.Text  = dr[sys_ModulesFunction.FunctionName].ToString();
            FocusButton.Image = LoadUIImage.LoadFunctionButtonImg(dr[sys_ModulesFunction.ImgLarge].ToString());
            (FocusButton.Tag as NavBarItem).SmallImage = LoadUIImage.LoadNavBarImage_Item(dr[sys_ModulesFunction.ImgSmall].ToString());
        }