取消主界面自定义标题栏

master
lhiven 1 year ago
parent 1ac617dd81
commit b4362c1091

@ -26,14 +26,14 @@ using Rs.MotionPlat.Flow.SubFlow;
namespace Rs.MotionPlat namespace Rs.MotionPlat
{ {
public partial class Home : BaseFormHeader public partial class Home : Form
{ {
ButtonEx selectedButton; ButtonEx selectedButton;
public Home() public Home()
{ {
this.StartPosition = FormStartPosition.Manual; this.StartPosition = FormStartPosition.Manual;
InitializeComponent(); InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None; //this.FormBorderStyle = FormBorderStyle.None;
this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea; this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
MachineManage.Instance.OnMachineStatusChanged += Instance_OnMachineStatusChanged; MachineManage.Instance.OnMachineStatusChanged += Instance_OnMachineStatusChanged;
@ -210,15 +210,15 @@ namespace Rs.MotionPlat
} }
} }
else if (button == btnQuit) //else if (button == btnQuit)
{ //{
selectedButton = null; // selectedButton = null;
button.Selected = false; // button.Selected = false;
if(WindowsClose()) // //if(WindowsClose())
{ // //{
System.Environment.Exit(-1); // // System.Environment.Exit(-1);
} // //}
} //}
else if (button == btnRecipe) else if (button == btnRecipe)
{ {
selectedButton = btnRecipe; selectedButton = btnRecipe;
@ -333,7 +333,7 @@ namespace Rs.MotionPlat
btnAbout.Selected = false; btnAbout.Selected = false;
btnPermission.Selected = false; btnPermission.Selected = false;
btnLanguage.Selected = false; btnLanguage.Selected = false;
btnQuit.Selected = false; //btnQuit.Selected = false;
btnRunData.Selected = false; btnRunData.Selected = false;
} }
@ -352,7 +352,7 @@ namespace Rs.MotionPlat
string language = Properties.Settings.Default.DefaultLanguage; string language = Properties.Settings.Default.DefaultLanguage;
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language); Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language);
LanguageHelper.LoadLanguage(this, typeof(Home)); //LanguageHelper.LoadLanguage(this, typeof(Home));
if(language=="zh-CN") if(language=="zh-CN")
{ {
btnMain.ShowText = "主页"; btnMain.ShowText = "主页";
@ -362,7 +362,7 @@ namespace Rs.MotionPlat
btnData.ShowText = "English"; btnData.ShowText = "English";
btnLanguage.ShowText = "标定"; btnLanguage.ShowText = "标定";
btnPermission.ShowText = "用户"; btnPermission.ShowText = "用户";
btnQuit.ShowText = "退出"; //btnQuit.ShowText = "退出";
} }
else else
{ {
@ -372,7 +372,7 @@ namespace Rs.MotionPlat
btnAbout.ShowText = "Debuger"; btnAbout.ShowText = "Debuger";
btnLanguage.ShowText = "Calibration"; btnLanguage.ShowText = "Calibration";
btnPermission.ShowText = "User"; btnPermission.ShowText = "User";
btnQuit.ShowText = "Quit"; //btnQuit.ShowText = "Quit";
btnData.ShowText = "中文"; btnData.ShowText = "中文";
} }
timer1.Enabled = false; timer1.Enabled = false;
@ -499,8 +499,8 @@ namespace Rs.MotionPlat
btnLanguage.Invalidate(); btnLanguage.Invalidate();
btnPermission.ShowText = "用户"; btnPermission.ShowText = "用户";
btnPermission.Invalidate(); btnPermission.Invalidate();
btnQuit.ShowText = "退出"; //btnQuit.ShowText = "退出";
btnQuit.Invalidate(); //btnQuit.Invalidate();
} }
else else
{ {
@ -516,8 +516,8 @@ namespace Rs.MotionPlat
btnLanguage.Invalidate(); btnLanguage.Invalidate();
btnPermission.ShowText = "User"; btnPermission.ShowText = "User";
btnPermission.Invalidate(); btnPermission.Invalidate();
btnQuit.ShowText = "Quit"; //btnQuit.ShowText = "Quit";
btnQuit.Invalidate(); //btnQuit.Invalidate();
btnData.ShowText = "中文"; btnData.ShowText = "中文";
btnData.Invalidate(); btnData.Invalidate();
} }
@ -566,22 +566,22 @@ namespace Rs.MotionPlat
} }
} }
public override bool WindowsClose() //public override bool WindowsClose()
{ //{
//DialogResult dr = MessageBox.Show("Are you sure to exit?", "tip", MessageBoxButtons.OKCancel); // //DialogResult dr = MessageBox.Show("Are you sure to exit?", "tip", MessageBoxButtons.OKCancel);
EButtonType btnType = Msgbox.ShowTipDialog(EButtonType.Ok | EButtonType.Cancel, "Are you sure to exit?"); // EButtonType btnType = Msgbox.ShowTipDialog(EButtonType.Ok | EButtonType.Cancel, "Are you sure to exit?");
//if (dr == DialogResult.OK) // //if (dr == DialogResult.OK)
if(btnType== EButtonType.Ok) // if(btnType== EButtonType.Ok)
{ // {
LogHelper.Debug("手动退出软件"); // LogHelper.Debug("手动退出软件");
Ops.Quit(); // Ops.Quit();
return true; // return true;
} // }
else // else
{ // {
return false; // return false;
} // }
} //}
#region 内存回收 #region 内存回收
[DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")] [DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")]
@ -754,5 +754,19 @@ namespace Rs.MotionPlat
CopyDirectory(subdir.FullName, tempPath); CopyDirectory(subdir.FullName, tempPath);
} }
} }
private void Home_FormClosing(object sender, FormClosingEventArgs e)
{
EButtonType btnType = Msgbox.ShowTipDialog(EButtonType.Ok | EButtonType.Cancel, "Are you sure to exit?");
if (btnType == EButtonType.Ok)
{
LogHelper.Debug("手动退出软件");
Ops.Quit();
}
else
{
e.Cancel = true;
}
}
} }
} }

@ -47,8 +47,6 @@
this.btnLanguage = new Rs.Controls.ButtonEx(); this.btnLanguage = new Rs.Controls.ButtonEx();
this.panel14 = new System.Windows.Forms.Panel(); this.panel14 = new System.Windows.Forms.Panel();
this.btnPermission = new Rs.Controls.ButtonEx(); this.btnPermission = new Rs.Controls.ButtonEx();
this.panel15 = new System.Windows.Forms.Panel();
this.btnQuit = new Rs.Controls.ButtonEx();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.panel16 = new System.Windows.Forms.Panel(); this.panel16 = new System.Windows.Forms.Panel();
this.lblMonitorFlow = new System.Windows.Forms.Label(); this.lblMonitorFlow = new System.Windows.Forms.Label();
@ -81,7 +79,6 @@
this.panel12.SuspendLayout(); this.panel12.SuspendLayout();
this.panel13.SuspendLayout(); this.panel13.SuspendLayout();
this.panel14.SuspendLayout(); this.panel14.SuspendLayout();
this.panel15.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.panel16.SuspendLayout(); this.panel16.SuspendLayout();
this.panel7.SuspendLayout(); this.panel7.SuspendLayout();
@ -111,7 +108,6 @@
this.tableLayoutPanel2.Controls.Add(this.panel12, 5, 0); this.tableLayoutPanel2.Controls.Add(this.panel12, 5, 0);
this.tableLayoutPanel2.Controls.Add(this.panel13, 6, 0); this.tableLayoutPanel2.Controls.Add(this.panel13, 6, 0);
this.tableLayoutPanel2.Controls.Add(this.panel14, 7, 0); this.tableLayoutPanel2.Controls.Add(this.panel14, 7, 0);
this.tableLayoutPanel2.Controls.Add(this.panel15, 8, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; this.tableLayoutPanel2.Name = "tableLayoutPanel2";
// //
// btnRunData // btnRunData
@ -292,29 +288,6 @@
this.btnPermission.UseVisualStyleBackColor = false; this.btnPermission.UseVisualStyleBackColor = false;
this.btnPermission.Click += new System.EventHandler(this.Menu_Clicked); this.btnPermission.Click += new System.EventHandler(this.Menu_Clicked);
// //
// panel15
//
this.panel15.Controls.Add(this.btnQuit);
resources.ApplyResources(this.panel15, "panel15");
this.panel15.Name = "panel15";
//
// btnQuit
//
this.btnQuit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnQuit.ButtonType = Rs.Controls.EButtonType.Quit;
this.btnQuit.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnQuit, "btnQuit");
this.btnQuit.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnQuit.ForeColor = System.Drawing.Color.White;
this.btnQuit.Name = "btnQuit";
this.btnQuit.Selected = false;
this.btnQuit.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(57)))), ((int)(((byte)(136)))), ((int)(((byte)(203)))));
this.btnQuit.ShowIcon = null;
this.btnQuit.ShowText = "退出";
this.btnQuit.UnSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnQuit.UseVisualStyleBackColor = false;
this.btnQuit.Click += new System.EventHandler(this.Menu_Clicked);
//
// panel1 // panel1
// //
this.panel1.BackColor = System.Drawing.Color.Red; this.panel1.BackColor = System.Drawing.Color.Red;
@ -470,15 +443,13 @@
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36)))));
this.Controls.Add(this.panel_main); this.Controls.Add(this.panel_main);
this.Controls.Add(this.tableLayoutPanel2); this.Controls.Add(this.tableLayoutPanel2);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.HeadText = "Dewey tester";
this.Name = "Home"; this.Name = "Home";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Home_FormClosing);
this.Load += new System.EventHandler(this.Home2_Load); this.Load += new System.EventHandler(this.Home2_Load);
this.Controls.SetChildIndex(this.panel1, 0);
this.Controls.SetChildIndex(this.tableLayoutPanel2, 0);
this.Controls.SetChildIndex(this.panel_main, 0);
this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false);
this.panel8.ResumeLayout(false); this.panel8.ResumeLayout(false);
this.panel9.ResumeLayout(false); this.panel9.ResumeLayout(false);
@ -487,7 +458,6 @@
this.panel12.ResumeLayout(false); this.panel12.ResumeLayout(false);
this.panel13.ResumeLayout(false); this.panel13.ResumeLayout(false);
this.panel14.ResumeLayout(false); this.panel14.ResumeLayout(false);
this.panel15.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel16.ResumeLayout(false); this.panel16.ResumeLayout(false);
this.panel7.ResumeLayout(false); this.panel7.ResumeLayout(false);
@ -509,7 +479,6 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private Controls.ButtonEx btnPermission; private Controls.ButtonEx btnPermission;
private Controls.ButtonEx btnAbout; private Controls.ButtonEx btnAbout;
private Controls.ButtonEx btnQuit;
private Controls.ButtonEx btnLanguage; private Controls.ButtonEx btnLanguage;
private Controls.ButtonEx btnData; private Controls.ButtonEx btnData;
private Controls.ButtonEx btnMain; private Controls.ButtonEx btnMain;
@ -542,7 +511,6 @@
private System.Windows.Forms.Panel panel12; private System.Windows.Forms.Panel panel12;
private System.Windows.Forms.Panel panel13; private System.Windows.Forms.Panel panel13;
private System.Windows.Forms.Panel panel14; private System.Windows.Forms.Panel panel14;
private System.Windows.Forms.Panel panel15;
private System.Windows.Forms.Label lblStockPlaceFlow; private System.Windows.Forms.Label lblStockPlaceFlow;
private System.Windows.Forms.Label lblFixturePlaceFlow; private System.Windows.Forms.Label lblFixturePlaceFlow;
private System.Windows.Forms.Panel panel16; private System.Windows.Forms.Panel panel16;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save