using _GZFramework.Demo.Common;using _GZFramework.Demo.Library;using _GZFramework.Demo.Library.MyClass;using _GZFramework.Demo.Models;using DevExpress.Utils;using DevExpress.XtraBars;using DevExpress.XtraNavBar;using DevExpress.XtraTab;using GZFramework.UI.Dev;using System;using System.ComponentModel;using System.Data;using System.Windows.Forms;namespace _GZFramework.Demo.Main{ public partial class frmMain : DevExpress.XtraBars.Ribbon.RibbonForm, IMain { ModuleObserver Modules; public frmMain() { InitializeComponent(); if (INISystemConfig.GetWindowState() == "Y") this.WindowState = FormWindowState.Maximized; new GZFramework.UI.Dev.RibbonButton.RibbonLoad(ribbonPage1, rpg_Function, rpg_DataNav); SkinTools.InitSkinGallery(ribbonGalleryBarItem1); this.FormClosing = frmMain_FormClosing; RefreshModule(); } void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (this.WindowState == FormWindowState.Maximized) INISystemConfig.SetWindowState("Y"); else INISystemConfig.SetWindowState(""); } private void frmMain_Load(object sender, EventArgs e) { WaiteServer.CloseWaite(); Modules = new ModuleObserver(this, navBarControl1); if (navBarControl1.ActiveGroup != null) Modules.SowModule(navBarControl1.ActiveGroup); } public void ShowChildForm(ModuleFunction fun) { WaiteServer.ShowWaite(this); Form frm = fun.LoadForm(this); frm.Text = fun.FunctionName; frm.Icon = LoadUIImage.LoadFormIcon(fun.FunctionPng); frm.Show(); frm.Activate(); // 设置当前 tab页的 图标,我这里也默认取navBar中的Item中的图标 xtraTabbedMdiManager1.Pages[frm].Image = LoadUIImage.LoadMDIImg_TabPag(fun.FunctionPng); WaiteServer.CloseWaite(); } public void RefreshModule() { navBarControl1.Items.Clear(); navBarControl1.Groups.Clear(); bsi_Modules.LinksPersistInfo.Clear(); ModuleFunctionsPool LocalFunction = new LoadModuleFunctions().GetLocalAllModules(AppDomain.CurrentDomain.BaseDirectory); navBarControl1.BeginInit(); NavBarGroup group; string ModuleID; foreach (var v in LocalFunction.Modules) { //添加模块到navBarControl1 group = navBarControl1.Groups.Add(); group.Caption = v.ModuleName; group.SmallImage = LoadUIImage.LoadNavBarImage_Group(ConvertEx.ToString(v.ImgPath)); group.Tag = v.ModuleID; //添加模块到bbi_Module BarSubItem BSI = new BarSubItem() { Caption = v.ModuleName, Glyph = LoadUIImage.LoadNavBarImage_Group(ConvertEx.ToString(v.ImgPath)) }; this.ribbonControl1.Items.Add(BSI); bsi_Modules.AddItem(BSI); ModuleID = v.ModuleID; foreach (var fun in v.Functions) { if (fun == null) continue; fun.UserAuthority = 1073741823; //添加功能到navBarControl1 NavBarItem item = navBarControl1.Items.Add(); item.Caption = fun.FunctionName; item.Tag = fun; item.SmallImage = LoadUIImage.LoadNavBarImage_Item(fun.FunctionPng); item.LinkClicked = item_LinkClicked; group.ItemLinks.Add(item); //添加功能到bbi_Module var bbif = new DevExpress.XtraBars.BarButtonItem() { Caption = fun.FunctionName, Tag = fun, Glyph = LoadUIImage.LoadNavBarImage_Item(fun.FunctionPng) }; bbif.ItemClick = bbi_ItemClick; this.ribbonControl1.Items.Add(bbif); BSI.AddItem(bbif); } if (group.ItemLinks.Count == 0) navBarControl1.Groups.Remove(group); } navBarControl1.EndInit(); } private void bbi_ItemClick(object sender, ItemClickEventArgs e) { ModuleFunction fun = e.Item.Tag as ModuleFunction; ShowChildForm(fun); } private void item_LinkClicked(object sender, NavBarLinkEventArgs e) { ModuleFunction fun = (sender as NavBarItem).Tag as ModuleFunction; ShowChildForm(fun); } //全屏 private void bci_FullScreen_CheckedChanged(object sender, ItemClickEventArgs e) { if (bci_FullScreen.Checked) { this.groupControl1.Hide(); navBarControl1.OptionsNavPane.NavPaneState = DevExpress.XtraNavBar.NavPaneState.Collapsed; } else { this.groupControl1.Show(); navBarControl1.OptionsNavPane.NavPaneState = DevExpress.XtraNavBar.NavPaneState.Expanded; } } //关闭窗体 private void bbi_Close_ItemClick(object sender, ItemClickEventArgs e) { Form frm = xtraTabbedMdiManager1.SelectedPage.MdiChild; if (frm is frmModuleView) return; else frm.Close(); } private void xtraTabbedMdiManager1_BeginFloating(object sender, DevExpress.XtraTabbedMdi.FloatingCancelEventArgs e) { e.ChildForm.StartPosition = FormStartPosition.CenterParent; } private void barButtonItem5_ItemClick(object sender, ItemClickEventArgs e) { AboutBox1 about = new AboutBox1(); about.ShowInTaskbar = false; about.ShowIcon = false; about.ShowDialog(); } }}
下载开发框架之单据窗体生成(主从表,流水单号)用户还喜欢
- 18480 文章数
- 500万+ 热度
作者专栏
编辑推荐
- 淡抹u2引擎,修复内容较多,物有所值
- 界域传说·经典巨作=传世单机(一键安装)
- 丸子版本(175个传世版本大集合)
- GS版本:神话公益服务端+客户端
- 图片放大工具(放大图片不模糊)
- 剪映无限制VIP版
- 传奇世界客户端下载器,史上最全传世客户端
- 传世GS20220920商业引擎注册+登录配置器 解压密码是1
- U2官方排行榜游戏网关 支持元神,支持传家宝
- GS开战传世客户端+服务端
- (淡漠夕阳)u2引擎合区工具
- 传世GS引擎消除“你的游戏客户端版本号过旧,请及时更新”提示
- 传世一机多区双线路配置器--免密码版本
- 传世凤凰登陆器劫持修复软件
- SQLite3 for Navicat
- 传奇世界npc对话框编辑工具
- 传世GS落霞铭文服务器端
- gs_20210409引擎包+注册机(无限制)
- 传奇世界NPC对话封包查看器[支持时长版和极速版]
- 彩虹引擎传世脚本编辑工具1.7版来了,支持函数脚本翻译
评论