diff --git a/CleanMachineHMI/FrmUserControl/Base/frmRole.cs b/CleanMachineHMI/FrmUserControl/Base/frmRole.cs index 20dfaa2..e9eee69 100644 --- a/CleanMachineHMI/FrmUserControl/Base/frmRole.cs +++ b/CleanMachineHMI/FrmUserControl/Base/frmRole.cs @@ -80,7 +80,7 @@ namespace CleanMachineHMI.FrmUserControl { kcmb_roleGrade.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) { kcmb_roleGrade.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/Base/frmUser.cs b/CleanMachineHMI/FrmUserControl/Base/frmUser.cs index 0ecb5d4..53c28ad 100644 --- a/CleanMachineHMI/FrmUserControl/Base/frmUser.cs +++ b/CleanMachineHMI/FrmUserControl/Base/frmUser.cs @@ -85,7 +85,7 @@ namespace CleanMachineHMI.FrmUserControl { kcmb_gender.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_gender.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_gender.Name)) { kcmb_gender.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs b/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs index d9b3eba..e3cb86c 100644 --- a/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs +++ b/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs @@ -92,7 +92,7 @@ namespace CleanMachineHMI.FrmUserControl { kcmb_WarningType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) { kcmb_WarningType.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs b/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs index 13248b7..8eef08a 100644 --- a/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs +++ b/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs @@ -64,12 +64,12 @@ namespace CleanMachineHMI.FrmUserControl this.SetFormControlText(); kcmb_plcAlarmStatus.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmStatus.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmStatus.Name)) { kcmb_plcAlarmStatus.Items.Add(item); } kcmb_plcAlarmHandleResult.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmHandleResult.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmHandleResult.Name)) { kcmb_plcAlarmHandleResult.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs b/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs index 1063aa3..185c07c 100644 --- a/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs +++ b/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs @@ -51,12 +51,12 @@ namespace CleanMachineHMI.FrmUserControl { kcmb_plcItemType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) { kcmb_plcItemType.Items.Add(item); } kcmb_plcItemDateType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDateType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDateType.Name)) { kcmb_plcItemDateType.Items.Add(item); } diff --git a/CleanMachineHMI/Lang/zh-CN.json b/CleanMachineHMI/Lang/zh-CN.json index e65fb43..3b7ce01 100644 --- a/CleanMachineHMI/Lang/zh-CN.json +++ b/CleanMachineHMI/Lang/zh-CN.json @@ -1828,5 +1828,45 @@ "formCode": "frmPrinterMain", "controlCode": "SelectWantToPrintRow", "controlName": "请勾选要打印的托盘数据行!" + }, + { + "formCode": "frmMainNew", + "controlCode": "MechineCheck", + "controlName": "机器检测" + }, + { + "formCode": "frmMainNew", + "controlCode": "MainDetail", + "controlName": "主界面" + }, + { + "formCode": "frmMainNew", + "controlCode": "Base", + "controlName": "基础配置" + }, + { + "formCode": "frmMainNew", + "controlCode": "Parameter", + "controlName": "参数配置" + }, + { + "formCode": "frmMainNew", + "controlCode": "PlcItemConfig", + "controlName": "PLC变量配置" + }, + { + "formCode": "frmMainNew", + "controlCode": "IoMonitor", + "controlName": "I/O点位" + }, + { + "formCode": "frmMainNew", + "controlCode": "PlcAlarmLog", + "controlName": "报警情况" + }, + { + "formCode": "frmMainNew", + "controlCode": "WorkingDataRecord", + "controlName": "作业数据记录" } ] \ No newline at end of file diff --git a/CleanMachineHMI/Utils/frmUtil.cs b/CleanMachineHMI/Utils/frmUtil.cs index 41aa6bb..16c1964 100644 --- a/CleanMachineHMI/Utils/frmUtil.cs +++ b/CleanMachineHMI/Utils/frmUtil.cs @@ -178,6 +178,26 @@ namespace CleanMachineHMI.Utils } } + public static void SetSingleControlText(this Control form, Control control) + { + try + { + var key = form.Name + "|" + control.Name; + if (!GlobalHelper.ThemeLanguage.ContainsKey(key)) + { + control.Text = control.Name; + } + AddzhCN(key, control.Text, ""); + + control.Text = GlobalHelper.ThemeLanguage[key]; + + } + catch (Exception ex) + { + LogHelper.WriteLog(ex.Message, LogTypeEum.Err); + } + } + /// /// 设定数据视图列文本 /// @@ -234,7 +254,7 @@ namespace CleanMachineHMI.Utils } } - public static List GetComBoboxItemArr(this Control form, string controlCode, string controlType) + public static List GetComBoboxItemArr(this Control form, string controlCode) { try { diff --git a/CleanMachineHMI/frmChild/frmAddPlcItem.cs b/CleanMachineHMI/frmChild/frmAddPlcItem.cs index 92cd0ed..9fa56ea 100644 --- a/CleanMachineHMI/frmChild/frmAddPlcItem.cs +++ b/CleanMachineHMI/frmChild/frmAddPlcItem.cs @@ -51,12 +51,12 @@ namespace CleanMachineHMI.frmChild { kcmb_plcItemType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) { kcmb_plcItemType.Items.Add(item); } kcmb_plcItemDataType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name)) { kcmb_plcItemDataType.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmAddRole.cs b/CleanMachineHMI/frmChild/frmAddRole.cs index c1f7932..00d00b3 100644 --- a/CleanMachineHMI/frmChild/frmAddRole.cs +++ b/CleanMachineHMI/frmChild/frmAddRole.cs @@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild { kcmb_roleGrade.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) { kcmb_roleGrade.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmAddUser.cs b/CleanMachineHMI/frmChild/frmAddUser.cs index ee70d63..d124304 100644 --- a/CleanMachineHMI/frmChild/frmAddUser.cs +++ b/CleanMachineHMI/frmChild/frmAddUser.cs @@ -53,7 +53,7 @@ namespace CleanMachineHMI.frmChild { cmbGender.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(cmbGender.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(cmbGender.Name)) { cmbGender.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmAddWaringMsg.cs b/CleanMachineHMI/frmChild/frmAddWaringMsg.cs index 14af83f..9935d38 100644 --- a/CleanMachineHMI/frmChild/frmAddWaringMsg.cs +++ b/CleanMachineHMI/frmChild/frmAddWaringMsg.cs @@ -51,7 +51,7 @@ namespace CleanMachineHMI.frmChild { kcmb_WarningType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) { kcmb_WarningType.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditPlcItem.cs b/CleanMachineHMI/frmChild/frmEditPlcItem.cs index 1a6a504..cd2f226 100644 --- a/CleanMachineHMI/frmChild/frmEditPlcItem.cs +++ b/CleanMachineHMI/frmChild/frmEditPlcItem.cs @@ -53,12 +53,12 @@ namespace CleanMachineHMI.frmChild { kcmb_plcItemType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) { kcmb_plcItemType.Items.Add(item); } kcmb_plcItemDataType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name)) { kcmb_plcItemDataType.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditRole.cs b/CleanMachineHMI/frmChild/frmEditRole.cs index 8ba628d..82ac749 100644 --- a/CleanMachineHMI/frmChild/frmEditRole.cs +++ b/CleanMachineHMI/frmChild/frmEditRole.cs @@ -47,7 +47,7 @@ namespace CleanMachineHMI.frmChild { kcmb_roleGrade.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) { kcmb_roleGrade.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditUser.cs b/CleanMachineHMI/frmChild/frmEditUser.cs index 09f056a..38bf60e 100644 --- a/CleanMachineHMI/frmChild/frmEditUser.cs +++ b/CleanMachineHMI/frmChild/frmEditUser.cs @@ -56,7 +56,7 @@ namespace CleanMachineHMI.frmChild { cmbGender.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(cmbGender.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(cmbGender.Name)) { cmbGender.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditWaringMsg.cs b/CleanMachineHMI/frmChild/frmEditWaringMsg.cs index 0b02697..95c0fbc 100644 --- a/CleanMachineHMI/frmChild/frmEditWaringMsg.cs +++ b/CleanMachineHMI/frmChild/frmEditWaringMsg.cs @@ -54,7 +54,7 @@ namespace CleanMachineHMI.frmChild { kcmb_WarningType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name, "KryptonComboBox")) + foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) { kcmb_WarningType.Items.Add(item); } diff --git a/CleanMachineHMI/frmMainNew.cs b/CleanMachineHMI/frmMainNew.cs index 46f8039..0021274 100644 --- a/CleanMachineHMI/frmMainNew.cs +++ b/CleanMachineHMI/frmMainNew.cs @@ -61,8 +61,9 @@ namespace CleanMachineHMI if (isDefaultPage) { kryptonNavigator1.Pages[0].Controls.Clear(); - kryptonNavigator1.Pages[0].Text = enumFormType.ToString(); + //kryptonNavigator1.Pages[0].Text = enumFormType.ToString(); kryptonNavigator1.Pages[0].Name = enumFormType.ToString(); + this.SetSingleControlText(kryptonNavigator1.Pages[0]); kryptonNavigator1.SelectedPage = kryptonNavigator1.Pages[0]; if (frmType.BaseType.Name == "UserControl") { @@ -92,6 +93,7 @@ namespace CleanMachineHMI else { KryptonPage tmpPage1 = new KryptonPage { Text = enumFormType.ToString(), Name = enumFormType.ToString() }; + this.SetSingleControlText(tmpPage1); ButtonSpecAny bsa = new ButtonSpecAny(); bsa.Style = PaletteButtonStyle.FormClose; bsa.Type = PaletteButtonSpecStyle.FormClose;