SVN-Revision: r865
This commit is contained in:
tdx
2025-07-17 08:06:35 +00:00
parent 1e81d565c6
commit 5f5353c013
8 changed files with 430 additions and 192 deletions
+1 -28
View File
@@ -39,7 +39,6 @@
this.cb_mark.Dock = System.Windows.Forms.DockStyle.Fill;
this.cb_mark.FlatAppearance.BorderSize = 0;
this.cb_mark.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cb_mark.ImageEnter = null;
this.cb_mark.ImageNormal = null;
this.cb_mark.Location = new System.Drawing.Point(0, 0);
this.cb_mark.Name = "cb_mark";
@@ -54,30 +53,4 @@
this.lbl_mark_num.AutoSize = true;
this.lbl_mark_num.BackColor = System.Drawing.Color.Red;
this.lbl_mark_num.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_mark_num.ForeColor = System.Drawing.Color.White;
this.lbl_mark_num.Location = new System.Drawing.Point(3, 6);
this.lbl_mark_num.Name = "lbl_mark_num";
this.lbl_mark_num.Size = new System.Drawing.Size(19, 12);
this.lbl_mark_num.TabIndex = 6;
this.lbl_mark_num.Text = "99";
this.lbl_mark_num.Visible = false;
//
// CornerLab
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.lbl_mark_num);
this.Controls.Add(this.cb_mark);
this.Name = "CornerLab";
this.Size = new System.Drawing.Size(24, 24);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.MenuItem_Paint);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Lskj.Control.CircleButton cb_mark;
private System.Windows.Forms.Label lbl_mark_num;
}
}
this.lbl_mark_num.Fore
+38 -53
View File
@@ -48,7 +48,6 @@
this.FirstMain = new System.Windows.Forms.Panel();
this.pl_center_main = new System.Windows.Forms.Panel();
this.splitMainControl = new System.Windows.Forms.SplitContainer();
this.pl_center_main_middle_FlowLayout = new System.Windows.Forms.FlowLayoutPanel();
this.pl_center_main_middle = new System.Windows.Forms.Panel();
this.panel5 = new System.Windows.Forms.Panel();
this.pl_center_main_right_container = new System.Windows.Forms.Panel();
@@ -61,6 +60,8 @@
this.pl_center_main_bottom_right_main = new System.Windows.Forms.Panel();
this.panel6 = new System.Windows.Forms.Panel();
this.lblShortcutset = new System.Windows.Forms.Label();
this.pl_center_left = new System.Windows.Forms.Panel();
this.tv_left = new Lskj.Main.Control.TreeViewCustom();
this.xtpWorktop = new DevExpress.XtraTab.XtraTabPage();
this.workSplitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
this.workTopPanel = new System.Windows.Forms.Panel();
@@ -100,8 +101,7 @@
this.mark_timer = new System.Windows.Forms.Timer();
this.autoGridLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
this.awaitScreenControl = new Lskj.Main.Control.AwaitScreenControl();
this.pl_center_left = new System.Windows.Forms.Panel();
this.tv_left = new Lskj.Main.Control.TreeViewCustom();
this.pl_center_main_middle_FlowLayout = new System.Windows.Forms.FlowLayoutPanel();
this.toolStrip1.SuspendLayout();
this.pl_center.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tabMain)).BeginInit();
@@ -119,6 +119,7 @@
this.pl_center_main_bottom_right.SuspendLayout();
this.pl_center_main_bottom_left.SuspendLayout();
this.panel6.SuspendLayout();
this.pl_center_left.SuspendLayout();
this.xtpWorktop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.workSplitMainControl)).BeginInit();
this.workSplitMainControl.SuspendLayout();
@@ -134,7 +135,6 @@
((System.ComponentModel.ISupportInitialize)(this.pic_search)).BeginInit();
this.pl_top_left.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.autoGridLookUpEdit1View)).BeginInit();
this.pl_center_left.SuspendLayout();
this.SuspendLayout();
//
// tslCompany
@@ -321,19 +321,10 @@
this.splitMainControl.SplitterDistance = 896;
this.splitMainControl.TabIndex = 10;
//
// pl_center_main_middle_FlowLayout
//
this.pl_center_main_middle_FlowLayout.AutoScroll = true;
this.pl_center_main_middle_FlowLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.pl_center_main_middle_FlowLayout.Location = new System.Drawing.Point(0, 0);
this.pl_center_main_middle_FlowLayout.Name = "pl_center_main_middle_FlowLayout";
this.pl_center_main_middle_FlowLayout.Size = new System.Drawing.Size(896, 584);
this.pl_center_main_middle_FlowLayout.TabIndex = 2;
this.pl_center_main_middle_FlowLayout.Visible = false;
//
// pl_center_main_middle
//
this.pl_center_main_middle.AutoScroll = true;
this.pl_center_main_middle.BackColor = System.Drawing.Color.White;
this.pl_center_main_middle.Dock = System.Windows.Forms.DockStyle.Fill;
this.pl_center_main_middle.Location = new System.Drawing.Point(0, 0);
this.pl_center_main_middle.Name = "pl_center_main_middle";
@@ -454,6 +445,28 @@
this.lblShortcutset.Text = " 快捷操作通道";
this.lblShortcutset.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pl_center_left
//
this.pl_center_left.AutoScroll = true;
this.pl_center_left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(87)))), ((int)(((byte)(167)))));
this.pl_center_left.Controls.Add(this.tv_left);
this.pl_center_left.Dock = System.Windows.Forms.DockStyle.Left;
this.pl_center_left.Location = new System.Drawing.Point(0, 0);
this.pl_center_left.Name = "pl_center_left";
this.pl_center_left.Padding = new System.Windows.Forms.Padding(4);
this.pl_center_left.Size = new System.Drawing.Size(140, 584);
this.pl_center_left.TabIndex = 0;
//
// tv_left
//
this.tv_left.AutoScroll = true;
this.tv_left.BackColor = System.Drawing.Color.Transparent;
this.tv_left.Dock = System.Windows.Forms.DockStyle.Fill;
this.tv_left.Location = new System.Drawing.Point(4, 4);
this.tv_left.Name = "tv_left";
this.tv_left.Size = new System.Drawing.Size(132, 576);
this.tv_left.TabIndex = 1;
//
// xtpWorktop
//
this.xtpWorktop.Controls.Add(this.workSplitMainControl);
@@ -967,27 +980,16 @@
this.awaitScreenControl.TabIndex = 0;
this.awaitScreenControl.Visible = false;
//
// pl_center_left
// pl_center_main_middle_FlowLayout
//
this.pl_center_left.AutoScroll = true;
this.pl_center_left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(87)))), ((int)(((byte)(167)))));
this.pl_center_left.Controls.Add(this.tv_left);
this.pl_center_left.Dock = System.Windows.Forms.DockStyle.Left;
this.pl_center_left.Location = new System.Drawing.Point(0, 0);
this.pl_center_left.Name = "pl_center_left";
this.pl_center_left.Padding = new System.Windows.Forms.Padding(4);
this.pl_center_left.Size = new System.Drawing.Size(140, 584);
this.pl_center_left.TabIndex = 0;
//
// tv_left
//
this.tv_left.AutoScroll = true;
this.tv_left.BackColor = System.Drawing.Color.Transparent;
this.tv_left.Dock = System.Windows.Forms.DockStyle.Fill;
this.tv_left.Location = new System.Drawing.Point(4, 4);
this.tv_left.Name = "tv_left";
this.tv_left.Size = new System.Drawing.Size(132, 576);
this.tv_left.TabIndex = 1;
this.pl_center_main_middle_FlowLayout.AutoScroll = true;
this.pl_center_main_middle_FlowLayout.BackColor = System.Drawing.Color.Transparent;
this.pl_center_main_middle_FlowLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.pl_center_main_middle_FlowLayout.Location = new System.Drawing.Point(0, 0);
this.pl_center_main_middle_FlowLayout.Name = "pl_center_main_middle_FlowLayout";
this.pl_center_main_middle_FlowLayout.Size = new System.Drawing.Size(896, 584);
this.pl_center_main_middle_FlowLayout.TabIndex = 2;
this.pl_center_main_middle_FlowLayout.Visible = false;
//
// MainPanelControlEx
//
@@ -1014,6 +1016,7 @@
this.pl_center_main_bottom_right.ResumeLayout(false);
this.pl_center_main_bottom_left.ResumeLayout(false);
this.panel6.ResumeLayout(false);
this.pl_center_left.ResumeLayout(false);
this.xtpWorktop.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.workSplitMainControl)).EndInit();
this.workSplitMainControl.ResumeLayout(false);
@@ -1033,7 +1036,6 @@
this.pl_top_left.ResumeLayout(false);
this.pl_top_left.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.autoGridLookUpEdit1View)).EndInit();
this.pl_center_left.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -1096,21 +1098,4 @@
private System.Windows.Forms.Panel pl_center_main;
private System.Windows.Forms.SplitContainer splitMainControl;
private System.Windows.Forms.Panel pl_center_main_middle;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Panel pl_center_main_right_container;
private System.Windows.Forms.Panel plRightLine;
private System.Windows.Forms.Panel pl_center_main_right;
private System.Windows.Forms.Panel pl_center_main_bottom_right;
private System.Windows.Forms.Panel pl_center_main_bottom_left_main;
private System.Windows.Forms.Label lblReportcutset;
private System.Windows.Forms.Panel pl_center_main_bottom_left;
private System.Windows.Forms.Panel pl_center_main_bottom_right_main;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Label lblShortcutset;
private System.Windows.Forms.FlowLayoutPanel pl_center_main_middle_FlowLayout;
private System.Windows.Forms.Label lblMenuTitle2;
private AwaitScreenControl awaitScreenControl;
private System.Windows.Forms.Panel pl_center_left;
private TreeViewCustom tv_left;
}
}
privat
@@ -123,7 +123,7 @@ namespace Lskj.Main.Control
/// <summary>
/// 缓存菜单控件
/// </summary>
private Dictionary<string, List<Menu_Item>> _menus = new Dictionary<string, List<Menu_Item>>();
private Dictionary<string, List<Menu_ItemNew>> _menus = new Dictionary<string, List<Menu_ItemNew>>();
/// <summary>
/// 缓存分组控件
/// </summary>
@@ -139,7 +139,7 @@ namespace Lskj.Main.Control
/// <summary>
/// 缓存菜单
/// </summary>
private List<Menu_Item> _menuItemList = new List<Menu_Item>();
private List<Menu_ItemNew> _menuItemList = new List<Menu_ItemNew>();
/// <summary>
/// 第一个menuItem
/// </summary>
@@ -660,7 +660,7 @@ namespace Lskj.Main.Control
{
int buttonTop = Convert.ToInt32(0.05 * DpiY); // 按钮上边距
int menuLeft = Convert.ToInt32(0.05 * DpiY), menuTop = Convert.ToInt32(0.05 * DpiY); // 模块距离左边距,模块距离顶部边距
int menuWidth = Convert.ToInt32(1.14 * DpiX), menuHeight = Convert.ToInt32(1.32 * DpiY); // 模块宽度,模块高度
int menuWidth = Convert.ToInt32(2.92 * DpiX), menuHeight = Convert.ToInt32(0.73 * DpiY); // 模块宽度,模块高度
//int centerWidth = pl_center_main.Width - pl_center_main_right.Width; // 内容区域宽度-右侧快捷栏宽度
int centerWidth = pl_center_main_middle.Width; // 内容区域宽度
string defaultParentMenu = string.Empty;
@@ -723,7 +723,7 @@ namespace Lskj.Main.Control
// 缓存控件
if (!_menus.Keys.Contains(menuStruct))
{
_menus.Add(menuStruct, new List<Menu_Item>());
_menus.Add(menuStruct, new List<Menu_ItemNew>());
}
#region
if (this._allMenus.Columns.Contains("menuposition") && (SystemInfo.Instance.IsOpenWork || SystemInfo.Instance.ShowGallerysFromMenu) && !SystemInfo.Instance.HideGallerys)
@@ -881,7 +881,7 @@ namespace Lskj.Main.Control
{
groupIndex = groupByDataRows.Where(n => !n.Key.Equals(99)).Count() > 0 ? groupByDataRows.Where(n => !n.Key.Equals(99)).Max(n => n.Key) + 1 : 1;
}
Menu_Item menu = new Menu_Item();
Menu_ItemNew menu = new Menu_ItemNew();
menu.menuRow = dataRow.Table.Columns.Contains("menuRow") && !string.IsNullOrEmpty(dataRow["menuRow"] + "") ? Convert.ToInt32(dataRow["menuRow"] + "") : 1;
menu.menuGroup = groupIndex;
if ((menu.menuRow - minMenuRow + 1) > nowRowCount + 1)
@@ -899,9 +899,10 @@ namespace Lskj.Main.Control
menu.Size = new Size(menuWidth, menuHeight);
menu.menuNode = (dataRow["menustruct"] + "").Substring(0, 2);
menu.SetMenuCaption(dataRow["menucaption"] + "");
menu.SetSubCaption(dataRow["SearchMenuCaption"] + "");
menu.SetRoundRadius = 20;
menu.GetButton().Tag = menuTag;
menu.GetButton().Click += OnMenuItemClick;
menu.Tag = menuTag;
menu.Click += OnMenuItemClick;
menu.SetMenuImg(File.Exists(defaultImg) ? Image.FromFile(defaultImg) : Resources.default_icon);
menu.SetMenuHoverImg(File.Exists(hoverImg) ? Image.FromFile(hoverImg) : Resources.default_icon);
// 116
@@ -923,7 +924,7 @@ namespace Lskj.Main.Control
nowRowCount = (menu.menuRow - minMenuRow + 1);
}
menu.Location = new Point(menuGroupLeft, menuGroupTop);
menuGroupLeft += Convert.ToInt32(1.20 * DpiX);
menuGroupLeft += Convert.ToInt32(2.92 * DpiX);
//int count = _menuItemList.Where(o => o.menuGroup == menu.menuGroup && o.menuRow == menu.menuRow && o.menuNode == menu.menuNode).Count();
//menuGroupLeft = count == 0 ? 5 : count * Convert.ToInt32(1.20 * DpiX) + 5;
//menuGroupTop = menuHeight * (menu.menuRow - minMenuRow);
@@ -932,7 +933,7 @@ namespace Lskj.Main.Control
else
{
menu.Location = new Point(menuGroupLeft, menuGroupTop);
menuGroupLeft += Convert.ToInt32(1.20 * DpiX);
menuGroupLeft += Convert.ToInt32(2.92 * DpiX);
// 换行显示
if (menuGroupLeft + menuWidth > centerWidth)
{
@@ -941,7 +942,7 @@ namespace Lskj.Main.Control
}
}
groupControl.MenuPanel.Controls.Add(menu);
List<Menu_Item> controls = new List<Menu_Item>();
List<Menu_ItemNew> controls = new List<Menu_ItemNew>();
if (_menus.TryGetValue(menuStruct, out controls))
{
controls.Add(menu);
@@ -991,15 +992,16 @@ namespace Lskj.Main.Control
string defaultImg = PubUtil.MainMenuDefaultImage + item["MouseOutImg"] + "";
string hoverImg = PubUtil.MainMenuDefaultImage + item["MouseOverImg1"] + "";
string[] menuTag = new string[] { item["DllFileName"] + "", item["PurviewId"] + "", item["MenuId"] + "", item["UrlParams"] + "", item["SubSysId"] + "", item["menucaption"] + "" };
Menu_Item menu = new Menu_Item();
Menu_ItemNew menu = new Menu_ItemNew();
menu.menuRow = item.Table.Columns.Contains("menuRow") && !string.IsNullOrEmpty(item["menuRow"] + "") ? Convert.ToInt32(item["menuRow"] + "") : 0;
menu.Name = menuid;
menu.Size = new Size(menuWidth, menuHeight);
menu.menuNode = menuStruct.Substring(0, 2);
menu.SetMenuCaption(menuCaption);
menu.SetSubCaption(item["SearchMenuCaption"] + "");
menu.SetRoundRadius = 20;
menu.GetButton().Tag = menuTag;
menu.GetButton().Click += OnMenuItemClick;
menu.Tag = menuTag;
menu.Click += OnMenuItemClick;
menu.SetMenuImg(File.Exists(defaultImg) ? Image.FromFile(defaultImg) : Resources.default_icon);
menu.SetMenuHoverImg(File.Exists(hoverImg) ? Image.FromFile(hoverImg) : Resources.default_icon);
// 116
@@ -1008,14 +1010,14 @@ namespace Lskj.Main.Control
if (menu.menuRow > 0)
{
int count = _menuItemList.Where(o => o.menuRow == menu.menuRow && o.menuNode == menu.menuNode).Count();
menuLeft = count == 0 ? 5 : count * Convert.ToInt32(1.20 * DpiX) + 5;
menuLeft = count == 0 ? 5 : count * Convert.ToInt32(2.92 * DpiX) + 5;
menuTop = menuHeight * (menu.menuRow - 1);
menu.Location = new Point(menuLeft, menuTop);
}
else
{
menu.Location = new Point(menuLeft, menuTop);
menuLeft += Convert.ToInt32(1.20 * DpiX);
menuLeft += Convert.ToInt32(2.92 * DpiX);
// 换行显示
if (menuLeft + menuWidth > centerWidth)
{
@@ -1036,7 +1038,7 @@ namespace Lskj.Main.Control
{
pl_center_main_middle.Controls.Add(menu);
}
List<Menu_Item> controls = new List<Menu_Item>();
List<Menu_ItemNew> controls = new List<Menu_ItemNew>();
if (_menus.TryGetValue(menuStruct.Substring(0, 2), out controls))
{
controls.Add(menu);
@@ -1187,12 +1189,14 @@ namespace Lskj.Main.Control
string hoverImg = item.Table.Columns.Contains("MouseOverImg1") ? PubUtil.MainMenuDefaultImage + item["MouseOverImg1"] + "" : "";
string[] menuTag = new string[] { item["ObjDll"] + "", item["LinkModeTag"] + "", item["LMenuId"] + "", item["PurviewId"] + "", "", item["DllShowCaption"] + "" };
string menuCaption = item["DllShowCaption"] + "";
Menu_Item menu = new Menu_Item();
Menu_ItemNew menu = new Menu_ItemNew();
menu.Size = new Size(menuWidth, menuHeight);
menu.SetMenuCaption(menuCaption);
menu.SetSubCaption(item["SearchMenuCaption"] + "");
menu.SetRoundRadius = 20;
menu.GetButton().Tag = menuTag;
menu.GetButton().Click += OnMenuItemClick;
menu.Tag = menuTag;
menu.Click += OnMenuItemClick;
//menu.GetButton().Click += OnMenuItemClick;
menu.SetMenuImg(!string.IsNullOrEmpty(defaultImg) && File.Exists(defaultImg) ? Image.FromFile(defaultImg) : Resources.default_icon);
menu.SetMenuHoverImg(!string.IsNullOrEmpty(hoverImg) && File.Exists(hoverImg) ? Image.FromFile(hoverImg) : Resources.default_icon);
menu.Location = new Point(menuLeft, menuTop);
@@ -1220,12 +1224,13 @@ namespace Lskj.Main.Control
string hoverImg = item.Table.Columns.Contains("MouseOverImg1") ? PubUtil.MainMenuDefaultImage + item["MouseOverImg1"] + "" : "";
string[] menuTag = new string[] { item["ObjDll"] + "", item["LinkModeTag"] + "", item["LMenuId"] + "", item["PurviewId"] + "", "", item["DllShowCaption"] + "" };
string menuCaption = item["DllShowCaption"] + "";
Menu_Item menu = new Menu_Item();
Menu_ItemNew menu = new Menu_ItemNew();
menu.Size = new Size(menuWidth, menuHeight);
menu.SetMenuCaption(menuCaption);
menu.SetSubCaption(item["SearchMenuCaption"] + "");
menu.SetRoundRadius = 20;
menu.GetButton().Tag = menuTag;
menu.GetButton().Click += OnMenuItemClick;
menu.Tag = menuTag;
menu.Click += OnMenuItemClick;
menu.SetMenuImg(!string.IsNullOrEmpty(defaultImg) && File.Exists(defaultImg) ? Image.FromFile(defaultImg) : Resources.default_icon);
menu.SetMenuHoverImg(!string.IsNullOrEmpty(hoverImg) && File.Exists(hoverImg) ? Image.FromFile(hoverImg) : Resources.default_icon);
menu.Location = new Point(menuLeft, menuTop);
@@ -1238,7 +1243,7 @@ namespace Lskj.Main.Control
}
this.workBottomPanel.Controls.Add(menu);
}
Menu_Item addBotMenu = new Menu_Item();
Menu_ItemNew addBotMenu = new Menu_ItemNew();
addBotMenu.Size = new Size(menuWidth, menuHeight);
addBotMenu.SetMenuCaption("添加");
addBotMenu.SetRoundRadius = 20;
@@ -1626,9 +1631,9 @@ namespace Lskj.Main.Control
if (this._menuItemList == null || this._menuItemList.Count == 0) return;
DataTable notifys = MainImpl.GetNotifys(ERPInfo.Instance.SubSysId, ERPInfo.Instance.UserId);
DataTable ShortcutDt = MainImpl.GetGallerysByUserIdAndReviewAmount();
foreach (Menu_Item menu_Item in _menuItemList)
foreach (Menu_ItemNew Menu_ItemNew in _menuItemList)
{
menu_Item.SetMenuNum(0);
Menu_ItemNew.SetMenuNum(0);
}
//快捷栏
if (ShortcutDt != null)
@@ -1667,17 +1672,17 @@ namespace Lskj.Main.Control
if (string.IsNullOrWhiteSpace(menuId) && string.IsNullOrWhiteSpace(moduleId)) continue;
Menu_Item menuItem = null;
Menu_ItemNew menuItem = null;
// 存在menuid则按照menuid来匹配数据,否则按照moduleid来匹配数据
if (!string.IsNullOrWhiteSpace(menuId))
{
menuItem = this._menuItemList.Cast<Menu_Item>().FirstOrDefault(x => x.Name == menuId);
menuItem = this._menuItemList.Cast<Menu_ItemNew>().FirstOrDefault(x => x.Name == menuId);
}
else
{
try
{
menuItem = this._menuItemList.Cast<Menu_Item>().FirstOrDefault(x => (x.GetButton().Tag as string[])[1] == moduleId);
menuItem = this._menuItemList.Cast<Menu_ItemNew>().FirstOrDefault(x => (x.GetButton().Tag as string[])[1] == moduleId);
}
catch (Exception ex)
{
@@ -1691,7 +1696,7 @@ namespace Lskj.Main.Control
//设置了数量sql的模块
foreach (string key in countSqls.Keys)
{
Menu_Item menuItem = this._menuItemList.Cast<Menu_Item>().FirstOrDefault(x => x.Name == key);
Menu_ItemNew menuItem = this._menuItemList.Cast<Menu_ItemNew>().FirstOrDefault(x => x.Name == key);
//DataRow dr = MainImpl.GetModuleDisplayQuantity(ReplaceHelper.ReplaceUserInfo(countSqls[key]));
//string num = dr["value"] + "";
string num = SqlHelper.ExecuteScalar(ReplaceHelper.ReplaceUserInfo(countSqls[key])) + "";
@@ -2128,8 +2133,8 @@ namespace Lskj.Main.Control
DataRow item_after = after.Tag != null ? after.Tag as DataRow : null;
if (item_before != null)
{
List<Menu_Item> beforeButtons = new List<Menu_Item>();
List<Menu_Item> afterButtons = new List<Menu_Item>();
List<Menu_ItemNew> beforeButtons = new List<Menu_ItemNew>();
List<Menu_ItemNew> afterButtons = new List<Menu_ItemNew>();
if (isFlowLayout)
{
pl_center_main_middle_FlowLayout.Hide();
@@ -2151,7 +2156,7 @@ namespace Lskj.Main.Control
}
else
{
foreach (Menu_Item item in beforeButtons)
foreach (Menu_ItemNew item in beforeButtons)
{
item.Visible = false;
}
@@ -2179,7 +2184,7 @@ namespace Lskj.Main.Control
{
if (_menus.TryGetValue(item_after["menustruct"] + "", out afterButtons))
{
foreach (Menu_Item item in afterButtons)
foreach (Menu_ItemNew item in afterButtons)
{
item.Visible = true;
}
@@ -2239,19 +2244,22 @@ namespace Lskj.Main.Control
{
try
{
this.pic_search.Focus();
Button item = (Button)sender;
string[] arr = (string[])item.Tag;
Manager.TabMain = this.tabMain;
Manager.MinusTheHeight = this.pl_top_center.Height + this.toolStrip1.Height;
pic_search.Focus();
/* 取 Tag */
string[] arr = (string[])((System.Windows.Forms.Control)sender).Tag;
Manager.TabMain = tabMain;
Manager.MinusTheHeight = pl_top_center.Height + toolStrip1.Height;
Manager.OpenModule(arr[2], arr[5], arr[0], arr[1], arr[3]);
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
string msg = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(msg, ex.Message);
}
}
/// <summary>
/// 快捷图标点击
/// </summary>
@@ -2401,14 +2409,15 @@ namespace Lskj.Main.Control
string defaultImg = PubUtil.MainMenuDefaultImage + item["MouseOutImg"] + "";
string hoverImg = PubUtil.MainMenuDefaultImage + item["MouseOverImg1"] + "";
Menu_Item menu = new Menu_Item();
Menu_ItemNew menu = new Menu_ItemNew();
menu.Name = item["menuid"] + "";
menu.Size = new Size(menuWidth, menuHeight);
menu.Location = new Point(menuLeft, menuTop);
menu.SetMenuCaption(item["menuCaption"] + "");
menu.SetSubCaption(item["SearchMenuCaption"] + "");
menu.SetRoundRadius = 20;
menu.GetButton().Tag = new string[] { item["DllFileName"] + "", item["PurviewId"] + "", item["MenuId"] + "", item["UrlParams"] + "", item["SubSysId"] + "", item["menucaption"] + "" };
menu.GetButton().Click += OnMenuItemClick;
menu.Tag = new string[] { item["DllFileName"] + "", item["PurviewId"] + "", item["MenuId"] + "", item["UrlParams"] + "", item["SubSysId"] + "", item["menucaption"] + "" };
menu.Click += OnMenuItemClick;
try
{
menu.SetMenuImg(Image.FromFile(defaultImg));
@@ -2419,7 +2428,7 @@ namespace Lskj.Main.Control
}
// 116
menuLeft += Convert.ToInt32(1.20 * DpiX);
menuLeft += Convert.ToInt32(2.92 * DpiX);
// 换行显示
if (menuLeft + menuWidth > centerWidth)
{
@@ -2497,7 +2506,7 @@ namespace Lskj.Main.Control
// Control[] ctrs = pl_center_main.Controls.Find(menuid, true);
// if (ctrs != null && ctrs.Length > 0)
// {
// if (ctrs[0] is Menu_Item)
// if (ctrs[0] is Menu_ItemNew)
// {
// ctrs[0].Location = new Point(menuLeft, menuTop);
@@ -4246,41 +4255,4 @@ namespace Lskj.Main.Control
{
bottomLayoutPanel.RowStyles[i].Height = 25;
}
}
}
catch (Exception)
{
}
}
}
/// <summary>
/// 判断是不是数值
/// </summary>
/// <param name="oText"></param>
/// <returns></returns>
private bool IsNumberic(string oText)
{
try
{
int var1 = Convert.ToInt32(oText);
return true;
}
catch
{
return false;
}
}
#region
/// <summary>
/// 加密狗验证
/// </summary>
/// <returns></returns>
private void DogVerify()
{
int[] keyHandles = ERPInfo.Instance.keyHandles = new int[8];
int[] keyNumber = ERPInfo.Instance.keyNumber = new int[8];
int rtn = SmartX1Api.SmartX1Find("Ls_ERP", keyHandles, keyNumber);
}
#endregion
}
}
+1 -28
View File
@@ -82,37 +82,10 @@
this.cb_mark.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.cb_mark.FlatAppearance.BorderSize = 0;
this.cb_mark.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cb_mark.ImageEnter = null;
this.cb_mark.ImageNormal = null;
this.cb_mark.Location = new System.Drawing.Point(77, 0);
this.cb_mark.Name = "cb_mark";
this.cb_mark.Radius = 24;
this.cb_mark.Size = new System.Drawing.Size(24, 24);
this.cb_mark.TabIndex = 4;
this.cb_mark.UseVisualStyleBackColor = false;
this.cb_mark.Visible = false;
//
// Menu_Item
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.Controls.Add(this.lbl_mark_num);
this.Controls.Add(this.cb_mark);
this.Controls.Add(this.btn_item_img);
this.Controls.Add(this.btn_item_title);
this.Name = "Menu_Item";
this.Size = new System.Drawing.Size(110, 127);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btn_item_img;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Label btn_item_title;
private Lskj.Control.CircleButton cb_mark;
private System.Windows.Forms.Label lbl_mark_num;
}
}
this.cb_mark.UseVisualStyleBackColor =
+82
View File
@@ -0,0 +1,82 @@
namespace Lskj.Main.Control
{
partial class Menu_ItemNew
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{ if (disposing && components != null) components.Dispose(); base.Dispose(disposing); }
#region
private void InitializeComponent()
{
this.toolTip1 = new System.Windows.Forms.ToolTip();
this.btn_icon = new System.Windows.Forms.Button();
this.badgeNum = new System.Windows.Forms.Label();
this.lbl_title = new System.Windows.Forms.Label();
this.lbl_sub = new System.Windows.Forms.Label();
this.badgeDot = new Lskj.Control.CircleButton();
this.SuspendLayout();
//
// btn_icon
//
this.btn_icon.BackColor = System.Drawing.Color.Transparent;
this.btn_icon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.btn_icon.FlatAppearance.BorderSize = 0;
this.btn_icon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_icon.Location = new System.Drawing.Point(12, 9);
this.btn_icon.Name = "btn_icon";
this.btn_icon.Size = new System.Drawing.Size(46, 46);
this.btn_icon.TabIndex = 0;
this.btn_icon.TabStop = false;
this.btn_icon.UseVisualStyleBackColor = false;
//
// badgeNum
//
this.badgeNum.AutoSize = true;
this.badgeNum.BackColor = System.Drawing.Color.Red;
this.badgeNum.Font = new System.Drawing.Font("Microsoft YaHei UI", 6.75F, System.Drawing.FontStyle.Bold);
this.badgeNum.ForeColor = System.Drawing.Color.White;
this.badgeNum.Location = new System.Drawing.Point(0, 0);
this.badgeNum.Name = "badgeNum";
this.badgeNum.Size = new System.Drawing.Size(0, 14);
this.badgeNum.TabIndex = 2;
this.badgeNum.Visible = false;
//
// lbl_title
//
this.lbl_title.AutoSize = true;
this.lbl_title.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Bold);
this.lbl_title.Location = new System.Drawing.Point(70, 12);
this.lbl_title.Name = "lbl_title";
this.lbl_title.Size = new System.Drawing.Size(65, 19);
this.lbl_title.TabIndex = 3;
this.lbl_title.Text = "默认标题";
//
// lbl_sub
//
this.lbl_sub.AutoSize = true;
this.lbl_sub.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F);
this.lbl_sub.ForeColor = System.Drawing.Color.DimGray;
this.lbl_sub.Location = new System.Drawing.Point(72, 36);
this.lbl_sub.Name = "lbl_sub";
this.lbl_sub.Size = new System.Drawing.Size(83, 16);
this.lbl_sub.TabIndex = 4;
this.lbl_sub.Text = "模块分类 · 说明";
//
// badgeDot
//
this.badgeDot.BackColor = System.Drawing.Color.Red;
this.badgeDot.BorderColor = System.Drawing.Color.Transparent;
this.badgeDot.BorderThickness = 1F;
this.badgeDot.FlatAppearance.BorderSize = 0;
this.badgeDot.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.badgeDot.ForeColor = System.Drawing.Color.White;
this.badgeDot.ImageHover = null;
this.badgeDot.ImageNormal = null;
this.badgeDot.Location = new System.Drawing.Point(47, 0);
this.badgeDot.Name = "badgeDot";
this.badgeDot.Number = 0;
this.badgeDot.Radius = 9;
this.badgeDot.TabIndex = 1;
this.badgeDot.UseVisualStyleBackColor = false;
this.badgeDot.Visible = f
+130
View File
@@ -0,0 +1,130 @@
/******************************
* Menu_ItemNew 1.2.2 - fixed badge & hover
******************************/
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using Lskj.Business;
using Lskj.Business.Impl;
namespace Lskj.Main.Control
{
public partial class Menu_ItemNew : UserControl
{
/* —— 样式 —— */
private readonly Color _hoverBorder = Color.FromArgb(211, 211, 211); // 淡灰色
private readonly Color _hoverBack = Color.White;
private readonly Color _normalBack = Color.FromArgb(240, 240, 240);
/* —— 状态 —— */
private bool _isHover;
private Image _imgDefault, _imgHover;
private int _radius = 10;
/* —— 外部信息 —— */
public int menuRow;
public int menuGroup;
public string menuNode;
public Menu_ItemNew()
{
InitializeComponent();
/* 统一绑定悬停事件 */
BindHover(this);
BindHover(btn_icon);
BindHover(lbl_title);
BindHover(lbl_sub);
BindHover(badgeDot);
BindHover(badgeNum);
/* 统一绑定 Click —— 1 行即可 */
BindClick(btn_icon);
BindClick(lbl_title);
BindClick(lbl_sub);
BindClick(badgeDot);
}
private void BindClick(System.Windows.Forms.Control ctl)
{
ctl.Click += (s, e) =>
{
// 直接把 Click 冒泡给 Menu_ItemNew 本身
this.OnClick(e); // this 就是 Menu_ItemNew
};
}
/* ===== 对外 API ===== */
public void SetMenuCaption(string text)
{ lbl_title.Text = text; toolTip1.SetToolTip(lbl_title, text); }
public void SetSubCaption(string text) => lbl_sub.Text = text;
public void SetMenuImg(Image img)
{ _imgDefault = img; btn_icon.BackgroundImage = img; }
public void SetMenuHoverImg(Image img) => _imgHover = img;
public void SetMenuNum(int num)
{
if (SystemInfo.Instance.DisableShowNotify || num < 1)
{
badgeDot.Visible = false;
return;
}
badgeDot.Number = num; // 一行搞定
badgeDot.Visible = true;
RepositionBadge();
}
/* ===== 圆角属性(如需保留) ===== */
[Browsable(true), Description("圆角半径(px)")]
public int CornerRadius
{
get => _radius;
set { _radius = Math.Max(0, value); Invalidate(); }
}
/* —— 兼容旧写法 —— */
public int SetRoundRadius
{
get => CornerRadius;
set => CornerRadius = value;
}
public Button GetButton() => btn_icon;
/* ===== 悬停逻辑 ===== */
private void HoverEnter(object s, EventArgs e)
{
if (_isHover) return;
_isHover = true;
//BackColor = _hoverBack;
btn_icon.BackgroundImage = _imgHover ?? _imgDefault;
Cursor = Cursors.Hand;
Invalidate();
}
private void HoverLeave(object s, EventArgs e)
{
if (ClientRectangle.Contains(PointToClient(System.Windows.Forms.Control.MousePosition))) return;
_isHover = false;
//BackColor = _normalBack;
btn_icon.BackgroundImage = _imgDefault;
Invalidate();
}
private void BindHover(System.Windows.Forms.Control ctl)
{
ctl.MouseEnter += HoverEnter;
ctl.MouseLeave += HoverLeave;
}
/* ===== 绘制高亮边框(无圆角) ===== */
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (!_isHover) return;
var rc = new Rectangle(0, 0, Width - 1, Height - 1);
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B