| | |
| | | using DevExpress.Utils.Svg; |
| | | using DevExpress.XtraBars.Docking; |
| | | using DevExpress.XtraBars.Docking2010.Views; |
| | | using DevExpress.XtraBars.Navigation; |
| | | using DevExpress.XtraBars.Ribbon; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraTab; |
| | | using DevExpress.XtraTab.ViewInfo; |
| | | using HStation.WinFrmUI; |
| | | using HStation.WinFrmUI.Assets; |
| | | using HStation.WinFrmUI.Xhs.PumpProduct; |
| | | using PBS.WinFrmUI.WE; |
| | | using PBS.Desktop; |
| | | using System.Drawing.Drawing2D; |
| | | using System.IO; |
| | | using Yw.WinFrmUI; |
| | |
| | | |
| | | this.accordionControlFunction.Appearance.AccordionControl.BackColor = Color.White; |
| | | this.accordionControlFunction.Appearance.AccordionControl.BorderColor = Color.White; |
| | | //this.accordionControlFunction.ResizeMode = AccordionControlResizeMode.None; |
| | | this.accordionControlFunction.AllowHtmlText = true; |
| | | this.accordionControlFunction.HtmlTemplates.HamburgerHeaderPanel.Template = @"<div class='hamburger-header-background'></div>"; |
| | | this.accordionControlFunction.HtmlTemplates.HamburgerHeaderPanel.Styles = @".hamburger-header-background {background-color: #ffffff; height: 100%;width: 100%;}"; |
| | | |
| | | this.xtraTabContrl.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | } |
| | | this.tabbedView1.Style = DockingViewStyle.Classic; |
| | | this.tabbedView1.Appearance.BackColor = Color.White; |
| | | //this.tabbedView1.AppearancePage.Header.BackColor = Color.White; |
| | | this.tabbedView1.AppearancePage.HeaderSelected.Font = new Font("微软雅黑", 10f, FontStyle.Bold); |
| | | |
| | | private HatchBrush myHatchBrush1 = new HatchBrush(HatchStyle.BackwardDiagonal, Color.LightGray, Color.AliceBlue); |
| | | // this.tabbedView1.CustomDrawTabHeader += TabbedView1_CustomDrawTabHeader; |
| | | |
| | | |
| | | } |
| | | |
| | | HatchBrush myHatchBrush1 = new HatchBrush(HatchStyle.BackwardDiagonal, Color.LightGray, Color.AliceBlue); |
| | | private void TabbedView1_CustomDrawTabHeader(object sender, DevExpress.XtraTab.TabHeaderCustomDrawEventArgs e) |
| | | { |
| | | e.Cache.FillRectangle(myHatchBrush1, e.Bounds); |
| | |
| | | if (btn.Tag is not string tag) |
| | | return; |
| | | PageGuid pguid = null; |
| | | if (this.xtraTabContrl.SelectedTabPage != null) |
| | | if (this.tabbedView1.ActiveDocument != null) |
| | | { |
| | | pguid = this.xtraTabContrl.SelectedTabPage.Tag as PageGuid; |
| | | pguid = this.tabbedView1.ActiveDocument.Tag as PageGuid; |
| | | } |
| | | SelectModular(tag, pguid); |
| | | } |
| | |
| | | #region TabbedView 相关事件处理程序 |
| | | |
| | | //选中 |
| | | private void xtraTabContrl_SelectedPageChanged(object sender, TabPageChangedEventArgs e) |
| | | private void tabbedView1_DocumentSelected(object sender, DocumentEventArgs e) |
| | | { |
| | | if (e.Page == null) |
| | | if (e.Document == null) |
| | | return; |
| | | var pguid = e.Page.Tag as PageGuid; |
| | | var pguid = e.Document.Tag as PageGuid; |
| | | if (pguid == null) |
| | | return; |
| | | SelectModular(pguid.Modular, pguid); |
| | | } |
| | | |
| | | //关闭 |
| | | private void xtraTabContrl_CloseButtonClick(object sender, EventArgs e) |
| | | //添加 |
| | | private void tabbedView1_DocumentAdded(object sender, DocumentEventArgs e) |
| | | { |
| | | var arg = e as ClosePageButtonEventArgs; |
| | | var last_index = this.xtraTabContrl.SelectedTabPageIndex - 1; |
| | | this.xtraTabContrl.TabPages.Remove(arg.Page as XtraTabPage); |
| | | if (last_index > 0) |
| | | if (this.tabbedView1.Documents.Count > 1) |
| | | { |
| | | this.xtraTabContrl.SelectedTabPageIndex = last_index; |
| | | if (!this.tabbedView1.DocumentGroupProperties.ShowTabHeader) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | | //激活 |
| | | private void tabbedView1_DocumentActivated(object sender, DocumentEventArgs e) |
| | | { |
| | | var page = e.Document.Control as DocumentPage; |
| | | if (page == null) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //关闭 此时控件已经为空 |
| | | private void tabbedView1_DocumentClosed(object sender, DocumentEventArgs e) |
| | | { |
| | | } |
| | | |
| | | #endregion TabbedView 相关事件处理程序 |
| | |
| | | } |
| | | } |
| | | |
| | | if (this.xtraTabContrl.TabPages != null && this.xtraTabContrl.TabPages.Count > 0) |
| | | if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0) |
| | | { |
| | | foreach (XtraTabPage doc in this.xtraTabContrl.TabPages) |
| | | foreach (BaseDocument doc in this.tabbedView1.Documents) |
| | | { |
| | | if (doc.Tag != null) |
| | | { |
| | |
| | | { |
| | | if (isActivePage) |
| | | { |
| | | this.xtraTabContrl.SelectedTabPage = doc; |
| | | this.tabbedView1.Controller.Activate(doc); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (this.xtraTabContrl.TabPages != null && this.xtraTabContrl.TabPages.Count > 0) |
| | | if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0) |
| | | { |
| | | var doc = this.xtraTabContrl.TabPages.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == pguid.ToString()); |
| | | var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == pguid.ToString()); |
| | | if (doc != null) |
| | | { |
| | | var page = doc.Controls[0] as DocumentPage; |
| | | var page = doc.Control as DocumentPage; |
| | | if (page != null) |
| | | { |
| | | page.RefreshData(); |
| | |
| | | } |
| | | } |
| | | |
| | | if (this.xtraTabContrl.TabPages != null && this.xtraTabContrl.TabPages.Count > 0) |
| | | if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0) |
| | | { |
| | | var doc = this.xtraTabContrl.TabPages.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == pguid.ToString()); |
| | | var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == pguid.ToString()); |
| | | if (doc != null) |
| | | { |
| | | doc.Text = title.Caption; |
| | | doc.Caption = title.Caption; |
| | | doc.ImageOptions.Image = title.HeaderImage; |
| | | doc.ImageOptions.SvgImage = title.HeaderSvgImage; |
| | | doc.ImageOptions.SvgImageSize = title.SvgImageSize; |
| | | var page = doc.Controls[0] as DocumentPage; |
| | | var page = doc.Control as DocumentPage; |
| | | if (page != null) |
| | | { |
| | | page.PageTitle = title; |
| | |
| | | |
| | | case eMoudingType.Tab: |
| | | { |
| | | var sel_page = new XtraTabPage(); |
| | | page.Dock = DockStyle.Fill; |
| | | sel_page.Controls.Add(page); |
| | | this.xtraTabContrl.TabPages.Add(sel_page); |
| | | this.tabbedView1.BeginUpdate(); |
| | | var doc = this.tabbedView1.AddDocument(page); |
| | | doc.Footer = Directory.GetCurrentDirectory(); |
| | | if (page.PageTitle != null) |
| | | { |
| | | sel_page.Text = page.PageTitle.Caption; |
| | | sel_page.ImageOptions.Image = page.PageTitle.HeaderImage; |
| | | sel_page.ImageOptions.SvgImage = page.PageTitle.HeaderSvgImage; |
| | | sel_page.ImageOptions.SvgImageSize = page.PageTitle.SvgImageSize; |
| | | //doc.Properties.AllowClose = page.PageTitle.AllowClose ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; |
| | | doc.Caption = page.PageTitle.Caption; |
| | | doc.ImageOptions.Image = page.PageTitle.HeaderImage; |
| | | doc.ImageOptions.SvgImage = page.PageTitle.HeaderSvgImage; |
| | | doc.ImageOptions.SvgImageSize = page.PageTitle.SvgImageSize; |
| | | doc.Properties.AllowClose = page.PageTitle.AllowClose ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; |
| | | } |
| | | sel_page.Tag = pguid; |
| | | this.xtraTabContrl.SelectedTabPage = sel_page; |
| | | doc.Tag = pguid; |
| | | this.tabbedView1.EndUpdate(); |
| | | this.tabbedView1.Controller.Activate(doc); |
| | | } |
| | | break; |
| | | |
| | |
| | | |
| | | case eMoudingType.Tab: |
| | | { |
| | | if (this.xtraTabContrl.TabPages != null && this.xtraTabContrl.TabPages.Count > 0) |
| | | if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0) |
| | | { |
| | | var doc = this.xtraTabContrl.TabPages.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == pguid.ToString()); |
| | | var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == pguid.ToString()); |
| | | if (doc != null) |
| | | { |
| | | this.xtraTabContrl.TabPages.Remove(doc); |
| | | this.tabbedView1.Controller.Close(doc);//会触发正在关闭和关闭事件 |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | //获取 |
| | | private List<AccordionElement> GetAccordionElementList(string modular) |
| | |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page=new WaterUtensilMainPage(); |
| | | CreatePage(page, guid); |
| | | } |
| | | }), |
| | | Get("用水当量",new PageGuid() |
| | |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page=new WaterWEMgr(); |
| | | CreatePage(page, guid); |
| | | } |
| | | }) |
| | | } |
| | |
| | | }, svgImgItem32[6], new Size(18, 18), (caption,guid,svg,size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page=new AssetsManufacturerMainPage(); |
| | | { |
| | | var page = new DocumentPage(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page,guid); |
| | | CreatePage(page, guid); |
| | | } |
| | | }), |
| | | Get("水泵管理",new PageGuid() |
| | |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page=new PackageManageMainPage(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page,guid); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }; |