From 2066a7e10e20433f7445431d6d34a9026c29f663 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 23 十二月 2024 08:43:43 +0800
Subject: [PATCH] 细节
---
DevApp/Gs.DevApp/DevFrm/FrmMain.cs | 65 +++++++++++++++++++++++++-------
1 files changed, 51 insertions(+), 14 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/FrmMain.cs b/DevApp/Gs.DevApp/DevFrm/FrmMain.cs
index 7c67fdc..42fd504 100644
--- a/DevApp/Gs.DevApp/DevFrm/FrmMain.cs
+++ b/DevApp/Gs.DevApp/DevFrm/FrmMain.cs
@@ -15,7 +15,6 @@
using Gs.DevApp.DevFrm.User;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
-using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -37,6 +36,44 @@
FormClosing += FrmMain_FormClosing;
barEasy.ItemClick += BarEasy_ItemClick;
getTree();
+ tab.MouseDown += Tab_MouseDown;
+ tabCloseCurrent.Click += (s, e) =>
+ {
+ string name = tab.SelectedTabPage.Tooltip;
+ RemoveTabPage(tab, name);
+ };
+ tabCloseAll.Click += (s, e) =>
+ {
+ string _name = tab.SelectedTabPage.Tooltip;
+ int _tabCount = tab.TabPages.Count;
+ for (int i = _tabCount; i >= 0; i--)
+ {
+ try
+ {
+ string name = tab.TabPages[i].Tooltip;
+ if (name != _name)
+ {
+ RemoveTabPage(tab, name);
+ }
+ }
+ catch (Exception)
+ {
+ }
+ }
+ };
+ }
+
+ private void Tab_MouseDown(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Right)
+ {
+ tab.ContextMenuStrip = null;
+ //TreeListHitInfo hInfo = treeList1.CalcHitInfo(new Point(e.X, e.Y));
+ //TreeListNode node = hInfo.Node;
+ //treeList1.FocusedNode = node;
+ tab.ContextMenuStrip = cms1;
+
+ }
}
private void BarEasy_ItemClick(object sender, ItemClickEventArgs e)
@@ -102,16 +139,12 @@
/// <param name="e"></param>
private void TooLoading_Click(object sender, EventArgs e)
{
- var i = 100;
- var sdf = new ShowDialogForm("鎻愮ず", "", "璇疯�愬績绛夊�欙紝姝e湪鎿嶄綔涓紒");
- for (var j = 0; j < i; j++)
- sdf.SetCaption("鎵ц杩涘害锛�" + j + "/" + i + "锛�");
- sdf.Close();
getTree();
}
- private void getTree()
+ private void getTree()
{
+
toolTime.Text = "鐧诲綍鏃堕棿" + LoginInfoModel.CurrentUser.LoginTime;
var _obj = new
{
@@ -122,6 +155,7 @@
{
var strJson = UtilityHelper.HttpPost("",
"User/GetUserLoginInfo", JsonConvert.SerializeObject(_obj));
+ DevExpress.Utils.WaitDialogForm wdf = new DevExpress.Utils.WaitDialogForm("鎷煎懡鍔犺浇涓紝璇风◢鍚�......", "鍙嬫儏鎻愮ず");
var _job = JObject.Parse(strJson);
var rtnCode = _job["rtnCode"].ToString();
if (int.Parse(rtnCode) > 0)
@@ -140,6 +174,7 @@
int gdx = 0, idx = 0;
foreach (var _dy in drGrp)
{
+ wdf.SetCaption("鍔犺浇杩涘害:" + _dy["name"].ToString());
var _grp = acrd.AddGroup();
_grp.ImageOptions.Image =
UtilityHelper.GetImgFromResource(
@@ -161,6 +196,7 @@
_itm.Name = _dy2["guid"].ToString();
_itm.Style = ElementStyle.Item;
_itm.Text = _dy2["name"].ToString();
+ wdf.SetCaption("鍔犺浇杩涘害:" + _dy2["name"].ToString());
_itm.Appearance.Normal.Font =
new Font("Tahoma", 10F);
_itm.Tag = _dy2["formPath"].ToString(); //瀛樿矾寰勶紝绫诲悕
@@ -175,10 +211,8 @@
AddTabpage(tab, tabPageName, tabText,
newFormName, imgIcon);
}
-
idx++;
}
-
;
gdx++;
}
@@ -187,11 +221,15 @@
{
MsgHelper.ShowError("鎻愮ず锛氬垵濮嬪寲澶辫触锛岃鑱旂郴绠$悊鍛橈紒");
}
+ wdf.SetCaption("鍔犺浇杩涘害锛�90/100锛�");
+ wdf.Close();
}
catch (Exception ex)
{
+
MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
+
}
/// <summary>
@@ -217,7 +255,9 @@
/// <param name="e"></param>
private void Tab_CloseButtonClick(object sender, EventArgs e)
{
- RemoveTabPage(tab, e);
+ var args = (ClosePageButtonEventArgs)e;
+ var name = args.Page.Tooltip;
+ RemoveTabPage(tab, name);
}
/// <summary>
@@ -253,16 +293,13 @@
/// <param name="tabControl"></param>
/// <param name="tabPageName"></param>
/// <param name="e"></param>
- public void RemoveTabPage(XtraTabControl tabControl, EventArgs e)
+ public void RemoveTabPage(XtraTabControl tabControl, string name)
{
if (TabPageDic.Count <= 1)
{
MsgHelper.Warning("璇疯嚦灏戜繚鐣欎竴涓姛鑳斤紒");
return;
}
-
- var args = (ClosePageButtonEventArgs)e;
- var name = args.Page.Tooltip;
foreach (XtraTabPage item in tabControl.TabPages)
if (item.Name == name)
{
--
Gitblit v1.9.3