From 9b28c425ceda12766ac65a7d9faa08717d9f9db2 Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期五, 21 二月 2025 10:05:53 +0800 Subject: [PATCH] pbs --- Desktop/PBS.Desktop.Core/MainForm.cs | 60 +++++++++++++++++++++++------ Desktop/PBS.Desktop.Core/MainForm.Designer.cs | 1 Desktop/PBS.Desktop.Core/PBS.Desktop.Core.csproj | 2 BLL/PBS.BLL.WE.Core/PBS.BLL.WE.Core.csproj | 1 WinFrmUI/HStation.WinFrmUI.Common.Core/HStation.WinFrmUI.Common.Core.csproj.user | 8 +++ BLL/PBS.BLL.Core/PBS.BLL.Core.csproj | 2 + Desktop/PBS.Desktop.Core/Program.cs | 2 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/BLL/PBS.BLL.Core/PBS.BLL.Core.csproj b/BLL/PBS.BLL.Core/PBS.BLL.Core.csproj index 2ab5023..a825f19 100644 --- a/BLL/PBS.BLL.Core/PBS.BLL.Core.csproj +++ b/BLL/PBS.BLL.Core/PBS.BLL.Core.csproj @@ -37,6 +37,8 @@ </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Vmo\HStation.Vmo.Core\HStation.Vmo.Core.csproj" /> + <ProjectReference Include="..\..\Vmo\PBS.Vmo.Core\PBS.Vmo.Core.csproj" /> <ProjectReference Include="..\HStation.BLL.Core\HStation.BLL.Core.csproj" /> </ItemGroup> diff --git a/BLL/PBS.BLL.WE.Core/PBS.BLL.WE.Core.csproj b/BLL/PBS.BLL.WE.Core/PBS.BLL.WE.Core.csproj index a870a31..12d91d4 100644 --- a/BLL/PBS.BLL.WE.Core/PBS.BLL.WE.Core.csproj +++ b/BLL/PBS.BLL.WE.Core/PBS.BLL.WE.Core.csproj @@ -37,6 +37,7 @@ </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Vmo\PBS.Vmo.WE.Core\PBS.Vmo.WE.Core.csproj" /> <ProjectReference Include="..\HStation.BLL.Core\HStation.BLL.Core.csproj" /> </ItemGroup> diff --git a/Desktop/PBS.Desktop.Core/MainForm.Designer.cs b/Desktop/PBS.Desktop.Core/MainForm.Designer.cs index 978870d..50e2c94 100644 --- a/Desktop/PBS.Desktop.Core/MainForm.Designer.cs +++ b/Desktop/PBS.Desktop.Core/MainForm.Designer.cs @@ -279,6 +279,7 @@ tabbedView1.DocumentGroupProperties.ClosePageButtonShowMode = DevExpress.XtraTab.ClosePageButtonShowMode.InActiveTabPageHeader; tabbedView1.DocumentGroupProperties.PinPageButtonShowMode = DevExpress.XtraTab.PinPageButtonShowMode.InActiveTabPageHeader; tabbedView1.DocumentProperties.AllowPin = true; + tabbedView1.EnableFreeLayoutMode = DevExpress.Utils.DefaultBoolean.True; tabbedView1.Style = DevExpress.XtraBars.Docking2010.Views.DockingViewStyle.Light; tabbedView1.DocumentSelected += tabbedView1_DocumentSelected; tabbedView1.DocumentAdded += tabbedView1_DocumentAdded; diff --git a/Desktop/PBS.Desktop.Core/MainForm.cs b/Desktop/PBS.Desktop.Core/MainForm.cs index fab8ab7..9780d9e 100644 --- a/Desktop/PBS.Desktop.Core/MainForm.cs +++ b/Desktop/PBS.Desktop.Core/MainForm.cs @@ -1,12 +1,12 @@ using DevExpress.Utils.Svg; using DevExpress.XtraBars.Docking; using DevExpress.XtraBars.Docking2010.Views; +using DevExpress.XtraBars.Docking2010.Views.Tabbed; using DevExpress.XtraBars.Navigation; using DevExpress.XtraBars.Ribbon; using DevExpress.XtraEditors; +using DevExpress.XtraTab; using HStation.WinFrmUI.Xhs.PumpProduct; -using PBS.Desktop; -using System.Drawing.Drawing2D; using System.IO; using Yw.WinFrmUI; using Yw.WinFrmUI.Page; @@ -37,20 +37,54 @@ //this.tabbedView1.AppearancePage.Header.BackColor = Color.White; this.tabbedView1.AppearancePage.HeaderSelected.Font = new Font("微软雅黑", 10f, FontStyle.Bold); - // this.tabbedView1.CustomDrawTabHeader += TabbedView1_CustomDrawTabHeader; + // this.tabbedView1.CustomDrawTabHeader += OnCustomDrawTabHeader; + + } - - } - - HatchBrush myHatchBrush1 = new HatchBrush(HatchStyle.BackwardDiagonal, Color.LightGray, Color.AliceBlue); - private void TabbedView1_CustomDrawTabHeader(object sender, DevExpress.XtraTab.TabHeaderCustomDrawEventArgs e) + private void OnCustomDrawTabHeader(object sender, TabHeaderCustomDrawEventArgs e) { - e.Cache.FillRectangle(myHatchBrush1, e.Bounds); - e.DefaultDrawText(); - e.DefaultDrawImage(); - e.DefaultDrawButtons(); + // 获取 TabbedView 实例 + var tabbedView = sender as TabbedView; + + bool isSelected = false; + + // 设置抗锯齿模式以确保绘制质量 + e.Cache.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; + + // 计算圆的位置和大小,这里我们简单地用高度作为直径 + int diameter = Math.Min(e.Bounds.Width, e.Bounds.Height); + Rectangle circleRect = new Rectangle(e.Bounds.X + (e.Bounds.Width - diameter) / 2, e.Bounds.Y, diameter, diameter); + + // 设置画刷颜色,可以根据选中状态改变颜色 + Brush brush = isSelected ? Brushes.LightSkyBlue : Brushes.Gray; // 示例颜色 + + // 绘制圆形背景 + e.Cache.Graphics.FillEllipse(brush, circleRect); // 注意这里使用的是 e.Cache.Graphics 而不是 e.Cache.Paint + + // 如果需要,可以在这里绘制文本或其他图形 + StringFormat stringFormat = new StringFormat + { + Alignment = StringAlignment.Center, + LineAlignment = StringAlignment.Center + }; + e.Cache.Graphics.DrawString(e.TabHeaderInfo.ViewInfo.GetSelectablePage().Text , this.Font, Brushes.Black, e.Bounds, stringFormat); + + // 表示已自行处理绘制 e.Handled = true; } + + + //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); + // e.DefaultDrawText(); + // e.DefaultDrawImage(); + // e.DefaultDrawButtons(); + // e.Handled = true; + //} + + #region TileNavPane 相关处理 @@ -412,7 +446,7 @@ { this.tabbedView1.BeginUpdate(); var doc = this.tabbedView1.AddDocument(page); - doc.Footer = Directory.GetCurrentDirectory(); + doc.Footer = Directory.GetCurrentDirectory(); if (page.PageTitle != null) { doc.Caption = page.PageTitle.Caption; diff --git a/Desktop/PBS.Desktop.Core/PBS.Desktop.Core.csproj b/Desktop/PBS.Desktop.Core/PBS.Desktop.Core.csproj index 019d91e..223a225 100644 --- a/Desktop/PBS.Desktop.Core/PBS.Desktop.Core.csproj +++ b/Desktop/PBS.Desktop.Core/PBS.Desktop.Core.csproj @@ -32,7 +32,7 @@ <ItemGroup> <PackageReference Include="DevExpress.Win.Design" Version="23.2.4" /> - <PackageReference Include="Yw.BLL.Auth.Core" Version="3.6.3" /> + <PackageReference Include="Yw.BLL.Auth.Core" Version="3.7.5" /> </ItemGroup> <ItemGroup> diff --git a/Desktop/PBS.Desktop.Core/Program.cs b/Desktop/PBS.Desktop.Core/Program.cs index 66ec923..528826b 100644 --- a/Desktop/PBS.Desktop.Core/Program.cs +++ b/Desktop/PBS.Desktop.Core/Program.cs @@ -50,7 +50,7 @@ System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans"); //皮肤 - DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(SkinStyle.WXICompact); + DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(SkinStyle.WXICompact); // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. diff --git a/WinFrmUI/HStation.WinFrmUI.Common.Core/HStation.WinFrmUI.Common.Core.csproj.user b/WinFrmUI/HStation.WinFrmUI.Common.Core/HStation.WinFrmUI.Common.Core.csproj.user index 317a8c7..81dca9d 100644 --- a/WinFrmUI/HStation.WinFrmUI.Common.Core/HStation.WinFrmUI.Common.Core.csproj.user +++ b/WinFrmUI/HStation.WinFrmUI.Common.Core/HStation.WinFrmUI.Common.Core.csproj.user @@ -1,2 +1,8 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" /> \ No newline at end of file +<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Compile Update="UserControl1.cs"> + <SubType>UserControl</SubType> + </Compile> + </ItemGroup> +</Project> \ No newline at end of file -- Gitblit v1.9.3