### 2021-06-13更新

------
#### ryControls    V2.1.2106.1301
- *.[改进]点击窗口标题栏最大化时, 不覆盖桌面任务栏。
This commit is contained in:
紫林软件 2021-06-15 09:41:34 +08:00
parent a3f978b187
commit 870234f406
23 changed files with 356 additions and 318 deletions

View File

@ -1,2 +1,2 @@
[Money_Op] [Money_Op]
hwnd=1118096 hwnd=263848

View File

@ -1,4 +1,4 @@
<root> <root>
<list id="LastUpdateTime" Value="2021/6/12 16:48:22" /> <list id="LastUpdateTime" Value="2021/6/13 23:15:28" />
<list id="UpdateAfterTime" Value="0" /> <list id="UpdateAfterTime" Value="0" />
</root> </root>

View File

@ -1,4 +1,10 @@
### 2021-06-12更新 ### 2021-06-13更新
------
#### ryControls V2.1.2106.1301
- *.[改进]点击窗口标题栏最大化时, 不覆盖桌面任务栏。
### 2021-06-12更新
------ ------
#### Itrycn_Project2 V1.0.2106.1201 #### Itrycn_Project2 V1.0.2106.1201
- *.[新增]新增加入皮肤功能。 - *.[新增]新增加入皮肤功能。

View File

@ -1,26 +1,26 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace Itrycn_Project namespace Itrycn_Project
{ {
/// <summary> /// <summary>
/// 配置类,保存在文件中的配置信息(本系统基于乘黄V2架构) /// 配置类,保存在文件中的配置信息(本系统基于乘黄V2架构)
/// </summary> /// </summary>
public static class Public_Config public static class Public_Config
{ {
/// <summary> /// <summary>
/// 在点击主窗口关闭按钮时,隐藏窗体(只有开启了托盘图标,本功能才能生效,此时需要通过托盘图标进行关闭)。 /// 在点击主窗口关闭按钮时,隐藏窗体(只有开启了托盘图标,本功能才能生效,此时需要通过托盘图标进行关闭)。
/// </summary> /// </summary>
public static bool HideByCloseBtn = false; public static bool HideByCloseBtn = false;
public static void LoadSetting() public static void LoadSetting()
{ {
ryCommon.Storage Stor = new ryCommon.Storage(); ryCommon.Storage Stor = new ryCommon.Storage();
Stor.LoadFromFile(Soft_ConstInfo.UserDataFolder+"\\Setting.dat"); Stor.LoadFromFile(Soft_ConstInfo.UserDataFolder+"\\Setting.dat");
Stor.SelectNodeBySet(); Stor.SelectNodeBySet();
HideByCloseBtn = Stor.GetAttrValue("HideByCloseBtn", false); HideByCloseBtn = Stor.GetAttrValue("HideByCloseBtn", false);
//low_count = Stor.GetAttrValue("LowCount", 10); //low_count = Stor.GetAttrValue("LowCount", 10);
} }
} }
} }

View File

@ -1,74 +1,74 @@
using ryCommon; using ryCommon;
using ryCommonDb; using ryCommonDb;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
namespace Itrycn_Project namespace Itrycn_Project
{ {
/// <summary> /// <summary>
/// 运行期间存储的变量,不会存储在文件中,只存储内存中.每次启动软件会初始化变量。 /// 运行期间存储的变量,不会存储在文件中,只存储内存中.每次启动软件会初始化变量。
/// </summary> /// </summary>
public static class Soft_MemInfo public static class Soft_MemInfo
{ {
/// <summary> /// <summary>
/// 是否能关闭窗体。 /// 是否能关闭窗体。
/// 设置本值为false,可以阻止窗口被手动关闭。 /// 设置本值为false,可以阻止窗口被手动关闭。
/// </summary> /// </summary>
public static bool IsCanCloseForm { get; set; } = true; public static bool IsCanCloseForm { get; set; } = true;
} }
/// <summary> /// <summary>
/// 配置类,保存在运行期间不会被改变的配置信息(本系统基于乘黄V2架构) /// 配置类,保存在运行期间不会被改变的配置信息(本系统基于乘黄V2架构)
/// 在运行期间请勿改动本类中的变量值。 /// 在运行期间请勿改动本类中的变量值。
/// </summary> /// </summary>
public static class Soft_ConstInfo public static class Soft_ConstInfo
{ {
/// <summary> /// <summary>
/// 在线升级配置文件的url /// 在线升级配置文件的url
/// </summary> /// </summary>
public const string Update_Url = "http://www.itrycn.com/update/ryWebMon4.xml"; public const string Update_Url = "http://www.itrycn.com/update/ryWebMon4.xml";
/// <summary> /// <summary>
/// 软件标题 /// 软件标题
/// </summary> /// </summary>
public const string Soft_Title = "睿元管理系统"; public const string Soft_Title = "睿元管理系统";
/// <summary> /// <summary>
/// 软件ID /// 软件ID
/// </summary> /// </summary>
public const string Soft_Id = "Money_Op"; public const string Soft_Id = "Money_Op";
/// <summary> /// <summary>
/// 开机启动的参数 /// 开机启动的参数
/// </summary> /// </summary>
public const string Soft_Pram = "q"; public const string Soft_Pram = "q";
/// <summary> /// <summary>
/// 官网地址 /// 官网地址
/// </summary> /// </summary>
public const string Soft_Url = "http://www.itrycn.com"; public const string Soft_Url = "http://www.itrycn.com";
/// <summary> /// <summary>
/// 售后QQ群 /// 售后QQ群
/// </summary> /// </summary>
public const string QQ_Qun = "183161992"; public const string QQ_Qun = "183161992";
/// <summary> /// <summary>
/// 关于界面内容.支持以下变量 /// 关于界面内容.支持以下变量
/// #softname#:软件名称 /// <para>#softname#:软件名称</para>
/// #ver#:版本号 /// <para>#ver#:版本号</para>
/// </summary> /// </summary>
public const string AboutText = "#softname# #ver#"; public const string AboutText = "#softname# #ver#";
/// <summary> /// <summary>
/// 用户文件夹,该相对路径设置,将在程序启动后转换 /// 用户文件夹,该相对路径设置,将在程序启动后转换
/// </summary> /// </summary>
public static string UserDataFolder = @"<app>\UserDb"; public static string UserDataFolder = @"<app>\UserDb";
/// <summary> /// <summary>
/// 自带配置文件夹,该相对路径设置,将在程序启动后转换 /// 自带配置文件夹,该相对路径设置,将在程序启动后转换
/// </summary> /// </summary>
public static string SysDataFolder = @"<app>\SysDb"; public static string SysDataFolder = @"<app>\SysDb";
/// <summary> /// <summary>
/// 是否允许显示托盘图标 /// 是否允许显示托盘图标
/// </summary> /// </summary>
public const bool ShowTray = false; public const bool ShowTray = false;
/// <summary> /// <summary>
/// 是否显示捐赠方式 /// 是否显示捐赠方式
/// </summary> /// </summary>
public static bool DonateVisabled = false; public static bool DonateVisabled = true;
} }
} }

View File

@ -53,7 +53,7 @@
this.pnlTopLogo.Dock = System.Windows.Forms.DockStyle.Top; this.pnlTopLogo.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlTopLogo.Location = new System.Drawing.Point(1, 27); this.pnlTopLogo.Location = new System.Drawing.Point(1, 27);
this.pnlTopLogo.Name = "pnlTopLogo"; this.pnlTopLogo.Name = "pnlTopLogo";
this.pnlTopLogo.Size = new System.Drawing.Size(507, 59); this.pnlTopLogo.Size = new System.Drawing.Size(523, 59);
this.pnlTopLogo.TabIndex = 8; this.pnlTopLogo.TabIndex = 8;
// //
// lblTitle // lblTitle
@ -71,7 +71,7 @@
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(12, 67); this.label1.Location = new System.Drawing.Point(13, 99);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 12); this.label1.Size = new System.Drawing.Size(35, 12);
this.label1.TabIndex = 9; this.label1.TabIndex = 9;
@ -92,7 +92,7 @@
this.lblVisitUrl.Cursor = System.Windows.Forms.Cursors.Hand; this.lblVisitUrl.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblVisitUrl.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblVisitUrl.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblVisitUrl.ForeColor = System.Drawing.Color.Blue; this.lblVisitUrl.ForeColor = System.Drawing.Color.Blue;
this.lblVisitUrl.Location = new System.Drawing.Point(53, 67); this.lblVisitUrl.Location = new System.Drawing.Point(54, 99);
this.lblVisitUrl.Name = "lblVisitUrl"; this.lblVisitUrl.Name = "lblVisitUrl";
this.lblVisitUrl.Size = new System.Drawing.Size(77, 12); this.lblVisitUrl.Size = new System.Drawing.Size(77, 12);
this.lblVisitUrl.TabIndex = 11; this.lblVisitUrl.TabIndex = 11;
@ -106,7 +106,7 @@
this.LblQQ_Qun.Cursor = System.Windows.Forms.Cursors.Hand; this.LblQQ_Qun.Cursor = System.Windows.Forms.Cursors.Hand;
this.LblQQ_Qun.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.LblQQ_Qun.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LblQQ_Qun.ForeColor = System.Drawing.Color.Blue; this.LblQQ_Qun.ForeColor = System.Drawing.Color.Blue;
this.LblQQ_Qun.Location = new System.Drawing.Point(234, 67); this.LblQQ_Qun.Location = new System.Drawing.Point(235, 99);
this.LblQQ_Qun.Name = "LblQQ_Qun"; this.LblQQ_Qun.Name = "LblQQ_Qun";
this.LblQQ_Qun.Size = new System.Drawing.Size(59, 12); this.LblQQ_Qun.Size = new System.Drawing.Size(59, 12);
this.LblQQ_Qun.TabIndex = 14; this.LblQQ_Qun.TabIndex = 14;
@ -126,7 +126,7 @@
// //
this.label5.AutoSize = true; this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Location = new System.Drawing.Point(193, 67); this.label5.Location = new System.Drawing.Point(194, 99);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 12); this.label5.Size = new System.Drawing.Size(35, 12);
this.label5.TabIndex = 12; this.label5.TabIndex = 12;
@ -135,7 +135,7 @@
// pictureBox1 // pictureBox1
// //
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(85, 105); this.pictureBox1.Location = new System.Drawing.Point(85, 145);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(319, 174); this.pictureBox1.Size = new System.Drawing.Size(319, 174);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@ -147,7 +147,7 @@
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.label3.Location = new System.Drawing.Point(13, 297); this.label3.Location = new System.Drawing.Point(13, 337);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(365, 12); this.label3.Size = new System.Drawing.Size(365, 12);
this.label3.TabIndex = 18; this.label3.TabIndex = 18;
@ -158,7 +158,7 @@
this.label6.AutoSize = true; this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent; this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(100, 90); this.label6.Location = new System.Drawing.Point(100, 130);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(285, 12); this.label6.Size = new System.Drawing.Size(285, 12);
this.label6.TabIndex = 19; this.label6.TabIndex = 19;
@ -169,18 +169,17 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(509, 336); this.ClientSize = new System.Drawing.Size(525, 360);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.label3);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.LblQQ_Qun);
this.Controls.Add(this.label4);
this.Controls.Add(this.label5);
this.Controls.Add(this.lblVisitUrl);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.lblVisitUrl);
this.Controls.Add(this.label3);
this.Controls.Add(this.LblQQ_Qun);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label2);
this.Controls.Add(this.pnlTopLogo); this.Controls.Add(this.pnlTopLogo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false; this.MaximizeBox = false;
this.Name = "FrmAbout"; this.Name = "FrmAbout";

View File

@ -41,6 +41,8 @@
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.chromeTabControl1 = new ryControls.ChromeTabControl(); this.chromeTabControl1 = new ryControls.ChromeTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MenuTray.SuspendLayout(); this.MenuTray.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.chromeTabControl1.SuspendLayout(); this.chromeTabControl1.SuspendLayout();
@ -77,6 +79,7 @@
// menuStrip1 // menuStrip1
// //
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(1, 27); this.menuStrip1.Location = new System.Drawing.Point(1, 27);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
@ -96,14 +99,14 @@
// 打开官网ToolStripMenuItem // 打开官网ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "打开官网ToolStripMenuItem"; this.ToolStripMenuItem.Name = "打开官网ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(136, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "打开官网"; this.ToolStripMenuItem.Text = "打开官网";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 捐助ToolStripMenuItem // 捐助ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "捐助ToolStripMenuItem"; this.ToolStripMenuItem.Name = "捐助ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(136, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "关于和捐助"; this.ToolStripMenuItem.Text = "关于和捐助";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -138,6 +141,21 @@
this.tabPage1.Text = "首页"; this.tabPage1.Text = "首页";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// 工具ToolStripMenuItem
//
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "工具ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
this.ToolStripMenuItem.Text = "工具";
//
// 选项ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "选项ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "选项";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// FrmStart // FrmStart
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -172,5 +190,7 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
} }
} }

View File

@ -129,6 +129,7 @@ namespace Itrycn_Project2
private void FrmStart_Load(object sender, EventArgs e) private void FrmStart_Load(object sender, EventArgs e)
{ {
Public_Config.LoadSetting();
RyFiles.AddDropDrag(tabPage1.Handle); RyFiles.AddDropDrag(tabPage1.Handle);
//Itrycn_Project.Itrycn_Db.CreateTable(); //Itrycn_Project.Itrycn_Db.CreateTable();
//var dbver = Itrycn_Db.GetDbVer(); //var dbver = Itrycn_Db.GetDbVer();
@ -150,5 +151,15 @@ namespace Itrycn_Project2
LiveUpdate.RyUpdate update = new LiveUpdate.RyUpdate(Soft_ConstInfo.Update_Url); LiveUpdate.RyUpdate update = new LiveUpdate.RyUpdate(Soft_ConstInfo.Update_Url);
update.CheckUpdate(); update.CheckUpdate();
} }
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmSetting frm = new FrmSetting();
if(frm.ShowDialog()==DialogResult.OK)
{
Public_Config.LoadSetting();
}
frm.Dispose();
}
} }
} }

View File

@ -22,8 +22,8 @@ namespace Itrycn_Project
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Soft_ConstInfo.UserDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.UserDataFolder);
Soft_ConstInfo.SysDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.SysDataFolder); Soft_ConstInfo.SysDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.SysDataFolder);
Soft_ConstInfo.UserDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.UserDataFolder);
run = new System.Threading.Mutex(true, Soft_ConstInfo.Soft_Id, out bool runone); run = new System.Threading.Mutex(true, Soft_ConstInfo.Soft_Id, out bool runone);
if (!runone) //已经运行了 if (!runone) //已经运行了
{ {

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2106.1201")] [assembly: AssemblyVersion("1.0.2106.1301")]
[assembly: AssemblyFileVersion("1.0.2106.1201")] [assembly: AssemblyFileVersion("1.0.2106.1301")]

View File

@ -1,199 +1,201 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Windows.Forms; using System.Windows.Forms;
using MGdu.WinFormUI.MyGraphics; using MGdu.WinFormUI.MyGraphics;
//忽略没有注释警告 //忽略没有注释警告
#pragma warning disable 1591 #pragma warning disable 1591
namespace MGdu.WinFormUI namespace MGdu.WinFormUI
{ {
public class ControlBoxManager public class ControlBoxManager
{ {
private GMForm _owner; private GMForm _owner;
private WLButton closeBtn; private WLButton closeBtn;
private WLButton maxBtn; private WLButton maxBtn;
private WLButton resBtn; private WLButton resBtn;
private WLButton minBtn; private WLButton minBtn;
#region event handler #region event handler
private void CloseBtnClick(object sender, EventArgs e) private void CloseBtnClick(object sender, EventArgs e)
{ {
_owner.Close(); _owner.Close();
} }
private void MaxBtnClick(object sender, EventArgs e) private void MaxBtnClick(object sender, EventArgs e)
{ {
var MaximumSize = _owner.MaximumSize; var MaximumSize = _owner.MaximumSize;
var curScreen = Screen.FromControl(_owner); var curScreen = Screen.FromControl(_owner);
_owner.MaximumSize = new Size(curScreen.WorkingArea.Width, curScreen.WorkingArea.Height); _owner.MaximumSize = new Size(curScreen.WorkingArea.Width, curScreen.WorkingArea.Height);
_owner.WindowState = FormWindowState.Maximized; _owner.WindowState = FormWindowState.Maximized;
_owner.MaximumSize = MaximumSize; _owner.MaximumSize = MaximumSize;
} }
private void ResBtnClick(object sender, EventArgs e) private void ResBtnClick(object sender, EventArgs e)
{ {
_owner.WindowState = FormWindowState.Normal; _owner.WindowState = FormWindowState.Normal;
} }
private void MinBtnClick(object sender, EventArgs e) private void MinBtnClick(object sender, EventArgs e)
{ {
_owner.WindowState = FormWindowState.Minimized; _owner.WindowState = FormWindowState.Minimized;
} }
#endregion #endregion
private void SetControlBoxColor() private void SetControlBoxColor()
{ {
closeBtn.ColorTable = _owner.XTheme.CloseBoxColor; closeBtn.ColorTable = _owner.XTheme.CloseBoxColor;
closeBtn.BackImageNormal = _owner.XTheme.CloseBoxBackImageNormal; closeBtn.BackImageNormal = _owner.XTheme.CloseBoxBackImageNormal;
closeBtn.BackImageHover = _owner.XTheme.CloseBoxBackImageHover; closeBtn.BackImageHover = _owner.XTheme.CloseBoxBackImageHover;
closeBtn.BackImagePressed = _owner.XTheme.CloseBoxBackImagePressed; closeBtn.BackImagePressed = _owner.XTheme.CloseBoxBackImagePressed;
// max res box // max res box
if (_owner.MaximizeBox) if (_owner.MaximizeBox)
{ {
maxBtn.ColorTable = _owner.XTheme.MaxBoxColor; maxBtn.ColorTable = _owner.XTheme.MaxBoxColor;
maxBtn.BackImageNormal = _owner.XTheme.MaxBoxBackImageNormal; maxBtn.BackImageNormal = _owner.XTheme.MaxBoxBackImageNormal;
maxBtn.BackImageHover = _owner.XTheme.MaxBoxBackImageHover; maxBtn.BackImageHover = _owner.XTheme.MaxBoxBackImageHover;
maxBtn.BackImagePressed = _owner.XTheme.MaxBoxBackImagePressed; maxBtn.BackImagePressed = _owner.XTheme.MaxBoxBackImagePressed;
resBtn.ColorTable = _owner.XTheme.MaxBoxColor; resBtn.ColorTable = _owner.XTheme.MaxBoxColor;
resBtn.BackImageNormal = _owner.XTheme.ResBoxBackImageNormal; resBtn.BackImageNormal = _owner.XTheme.ResBoxBackImageNormal;
resBtn.BackImageHover = _owner.XTheme.ResBoxBackImageHover; resBtn.BackImageHover = _owner.XTheme.ResBoxBackImageHover;
resBtn.BackImagePressed = _owner.XTheme.ResBoxBackImagePressed; resBtn.BackImagePressed = _owner.XTheme.ResBoxBackImagePressed;
} }
// min box // min box
if (_owner.MinimizeBox) if (_owner.MinimizeBox)
{ {
minBtn.ColorTable = _owner.XTheme.MinBoxColor; minBtn.ColorTable = _owner.XTheme.MinBoxColor;
minBtn.BackImageNormal = _owner.XTheme.MinBoxBackImageNormal; minBtn.BackImageNormal = _owner.XTheme.MinBoxBackImageNormal;
minBtn.BackImageHover = _owner.XTheme.MinBoxBackImageHover; minBtn.BackImageHover = _owner.XTheme.MinBoxBackImageHover;
minBtn.BackImagePressed = _owner.XTheme.MinBoxBackImagePressed; minBtn.BackImagePressed = _owner.XTheme.MinBoxBackImagePressed;
} }
} }
private void BtnIni() private void BtnIni()
{ {
// close box // close box
closeBtn = new WLButton(_owner); closeBtn = new WLButton(_owner);
closeBtn.Visible = true; closeBtn.Visible = true;
closeBtn.Bounds = _owner.CloseBoxRect; closeBtn.Bounds = _owner.CloseBoxRect;
closeBtn.Click += new EventHandler(CloseBtnClick); closeBtn.Click += new EventHandler(CloseBtnClick);
closeBtn.ForePathGetter = new ButtonForePathGetter( closeBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateCloseFlagPath); GraphicsPathHelper.CreateCloseFlagPath);
// max res box // max res box
if (_owner.MaximizeBox) if (_owner.MaximizeBox)
{ {
maxBtn = new WLButton(_owner); var curScreen = Screen.FromControl(_owner);
resBtn = new WLButton(_owner); _owner.MaximumSize = new Size(curScreen.WorkingArea.Width, curScreen.WorkingArea.Height);
maxBtn = new WLButton(_owner);
if (_owner.WindowState == FormWindowState.Normal) resBtn = new WLButton(_owner);
{
maxBtn.Visible = true; if (_owner.WindowState == FormWindowState.Normal)
resBtn.Visible = false; {
} maxBtn.Visible = true;
else resBtn.Visible = false;
{ }
maxBtn.Visible = false; else
resBtn.Visible = true; {
} maxBtn.Visible = false;
resBtn.Visible = true;
maxBtn.Bounds = _owner.MaxBoxRect; }
resBtn.Bounds = _owner.MaxBoxRect;
maxBtn.Bounds = _owner.MaxBoxRect;
maxBtn.Click += new EventHandler(MaxBtnClick); resBtn.Bounds = _owner.MaxBoxRect;
maxBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMaximizeFlagPath); maxBtn.Click += new EventHandler(MaxBtnClick);
maxBtn.ForePathGetter = new ButtonForePathGetter(
resBtn.Click += new EventHandler(ResBtnClick); GraphicsPathHelper.CreateMaximizeFlagPath);
resBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateRestoreFlagPath); resBtn.Click += new EventHandler(ResBtnClick);
} resBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateRestoreFlagPath);
// min box }
if (_owner.MinimizeBox)
{ // min box
minBtn = new WLButton(_owner); if (_owner.MinimizeBox)
{
minBtn.Visible = true; minBtn = new WLButton(_owner);
minBtn.Bounds = _owner.MinBoxRect;
minBtn.Visible = true;
minBtn.Click += new EventHandler(MinBtnClick); minBtn.Bounds = _owner.MinBoxRect;
minBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMinimizeFlagPath); minBtn.Click += new EventHandler(MinBtnClick);
} minBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMinimizeFlagPath);
SetControlBoxColor(); }
}
SetControlBoxColor();
public ControlBoxManager(GMForm owner) }
{
_owner = owner; public ControlBoxManager(GMForm owner)
BtnIni(); {
} _owner = owner;
BtnIni();
public void FormResize() }
{
if(maxBtn != null) public void FormResize()
{ {
if (_owner.WindowState == FormWindowState.Normal) if(maxBtn != null)
{ {
maxBtn.Visible = true; if (_owner.WindowState == FormWindowState.Normal)
resBtn.Visible = false; {
resBtn.State = GMButtonState.Normal; maxBtn.Visible = true;
} resBtn.Visible = false;
else resBtn.State = GMButtonState.Normal;
{ }
resBtn.Visible = true; else
maxBtn.Visible = false; {
maxBtn.State = GMButtonState.Normal; resBtn.Visible = true;
} maxBtn.Visible = false;
resBtn.Bounds = maxBtn.Bounds = _owner.MaxBoxRect; maxBtn.State = GMButtonState.Normal;
} }
if (minBtn != null) resBtn.Bounds = maxBtn.Bounds = _owner.MaxBoxRect;
minBtn.Bounds = _owner.MinBoxRect; }
closeBtn.Bounds = _owner.CloseBoxRect; if (minBtn != null)
} minBtn.Bounds = _owner.MinBoxRect;
closeBtn.Bounds = _owner.CloseBoxRect;
public void MouseOperation(Point location, MouseOperationType type) }
{
closeBtn.MouseOperation(location, type); public void MouseOperation(Point location, MouseOperationType type)
if (maxBtn != null && maxBtn.Visible) {
maxBtn.MouseOperation(location, type); closeBtn.MouseOperation(location, type);
if(resBtn!=null && resBtn.Visible) if (maxBtn != null && maxBtn.Visible)
resBtn.MouseOperation(location, type); maxBtn.MouseOperation(location, type);
if(minBtn!=null) if(resBtn!=null && resBtn.Visible)
minBtn.MouseOperation(location, type); resBtn.MouseOperation(location, type);
} if(minBtn!=null)
minBtn.MouseOperation(location, type);
public void DrawBoxes(Graphics g) }
{
if (_owner.ControlBox) public void DrawBoxes(Graphics g)
{ {
closeBtn.DrawButton(g); if (_owner.ControlBox)
if (_owner.MinimizeBox && minBtn != null) {
minBtn.DrawButton(g); closeBtn.DrawButton(g);
if (_owner.MaximizeBox) if (_owner.MinimizeBox && minBtn != null)
{ minBtn.DrawButton(g);
if (maxBtn != null & maxBtn.Visible) if (_owner.MaximizeBox)
maxBtn.DrawButton(g); {
if (resBtn != null && resBtn.Visible) if (maxBtn != null & maxBtn.Visible)
resBtn.DrawButton(g); maxBtn.DrawButton(g);
} if (resBtn != null && resBtn.Visible)
} resBtn.DrawButton(g);
} }
}
public void ResetBoxColor() }
{
SetControlBoxColor(); public void ResetBoxColor()
} {
} SetControlBoxColor();
} }
}
}

View File

@ -969,7 +969,7 @@ namespace MGdu.WinFormUI
if (base.WindowState == FormWindowState.Normal) if (base.WindowState == FormWindowState.Normal)
{ {
var size = base.Size; var size = base.Size;
if (!this.DesignMode) //if (!this.DesignMode)
{ {
size.Width += XTheme.ShadowWidth * 2; size.Width += XTheme.ShadowWidth * 2;
size.Height += XTheme.ShadowWidth * 2; size.Height += XTheme.ShadowWidth * 2;

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.2105.2201")] [assembly: AssemblyVersion("3.0.2106.1301")]
[assembly: AssemblyFileVersion("3.0.2105.2201")] [assembly: AssemblyFileVersion("3.0.2106.1301")]