标签页 标题汉化

This commit is contained in:
dev
2022-03-19 16:14:32 +08:00
parent a070a6aa0e
commit 9d000b8407
16 changed files with 81 additions and 19 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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": "作业数据记录"
}
]

View File

@@ -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);
}
}
/// <summary>
/// 设定数据视图列文本
/// </summary>
@@ -234,7 +254,7 @@ namespace CleanMachineHMI.Utils
}
}
public static List<string> GetComBoboxItemArr(this Control form, string controlCode, string controlType)
public static List<string> GetComBoboxItemArr(this Control form, string controlCode)
{
try
{

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;