📄 setdlg.cpp
字号:
// TODO: Add your control notification handler code here
CDialog::OnCancel(); //按了取消按钮
}
void SETDLG::OnBtnEdit()
{
// TODO: Add your control notification handler code here
}
void SETDLG::OnSelchangeLanguageList()
{
// TODO: Add your control notification handler code here
DisplayLanguageInfo(m_ctl_list.GetCurSel()); //显示所选择的语言选项
UpdateData(false);
}
void SETDLG::OnChangeEditTitle()
{ //更改数据选项
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
int index=m_ctl_list.GetCurSel();
m_ctl_list.DeleteString(index);
m_ctl_list.InsertString(index, m_str_Title);
m_ctl_list.SetCurSel(index);
p_language[index]->Title=m_str_Title;
}
void SETDLG::OnBtnAdd()
{
// TODO: Add your control notification handler code here
int cursel=m_ctl_list.GetCount();
if(cursel<256)
{
m_ctl_list.AddString(""); //添加一个新的语言
m_ctl_list.SetCurSel(cursel);
p_language[cursel]=new LANGUAGE_STRUCT;
p_language[cursel]->DefaultRadix=0;
DisplayLanguageInfo(cursel);
UpdateData(false);
m_ctl_edit11.SetFocus();
}
else
{
AfxMessageBox(_T("最多只能添加256种语言"));
}
}
void SETDLG::OnBtnDelete()
{
// TODO: Add your control notification handler code here
int total=m_ctl_list.GetCount();
int index=m_ctl_list.GetCurSel();
if(total==0)
{
AfxMessageBox(_T("所有语言已经删除"));
return;
}
if(index==-1)
{
AfxMessageBox(_T("没有选择所要删除的目标"));
return;
}
if(index==total-1) //目标在最后
{
m_ctl_list.DeleteString(index);
delete p_language[index];
p_language[index]=NULL;
m_ctl_list.SetCurSel(index-1);
DisplayLanguageInfo(index-1);
UpdateData(false);
}
else
{
m_ctl_list.DeleteString(index);
delete p_language[index];
p_language[index]=NULL;
m_ctl_list.SetCurSel(index);
for(int i=index; i<total-1; i++)
{
p_language[i]=p_language[i+1];
}
p_language[total-1]=NULL;
DisplayLanguageInfo(index);
UpdateData(false);
}
}
void SETDLG::OnBtnUp()
{
// TODO: Add your control notification handler code here
int total=m_ctl_list.GetCount();
int index=m_ctl_list.GetCurSel();
if(total<1)
{
return;
}
if(index==0)
{
return;
}
m_ctl_list.DeleteString(index-1); //交换列表
m_ctl_list.InsertString(index-1, p_language[index]->Title);
m_ctl_list.DeleteString(index);
m_ctl_list.InsertString(index,p_language[index-1]->Title);
m_ctl_list.SetCurSel(index-1);
LANGUAGE_STRUCT *tmp; //交换指针
tmp=p_language[index];
p_language[index]=p_language[index-1];
p_language[index-1]=tmp;
}
void SETDLG::OnBtnDown()
{
// TODO: Add your control notification handler code here
// TODO: Add your control notification handler code here
int total=m_ctl_list.GetCount();
int index=m_ctl_list.GetCurSel();
if(total<1)
{
return;
}
if(index==total-1)
{
return;
}
m_ctl_list.DeleteString(index+1); //交换列表
m_ctl_list.InsertString(index+1, p_language[index]->Title);
m_ctl_list.DeleteString(index);
m_ctl_list.InsertString(index,p_language[index+1]->Title);
m_ctl_list.SetCurSel(index+1);
LANGUAGE_STRUCT *tmp; //交换指针
tmp=p_language[index];
p_language[index]=p_language[index+1];
p_language[index+1]=tmp;
}
void SETDLG::OnChangeStartCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->StartCharacter=m_str_StartCharacter;
}
void SETDLG::OnChangeSeparatorCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->SeparatorCharacter=m_str_SeparatorCharacter;
}
void SETDLG::OnChangeHexLeaderCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->HexLeaderCharacter=m_str_HexLeaderCharacter;
}
void SETDLG::OnChangeHexEndCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->HexEndCharacter=m_str_HexEndCharacter;
}
void SETDLG::OnChangeBinLeaderCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->BinLeaderCharacter=m_str_BinLeaderCharacter;
}
void SETDLG::OnChangeBinEndCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->BinEndCharacter=m_str_BinEndCharacter;
}
void SETDLG::OnChangeDecLeaderCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->DecLeaderCharacter=m_str_DecLeaderCharacter;
}
void SETDLG::OnChangeDecEndCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->DecEndCharacter=m_str_DecEndCharacter;
}
void SETDLG::OnChangeNoteLeaderCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->NoteLeaderCharacter=m_str_NoteLeaderCharacter;
}
void SETDLG::OnChangeNoteEndCharacter()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->NoteEndCharacter=m_str_NoteEndCharacter;
}
void SETDLG::OnRadixHex()
{
// TODO: Add your control notification handler code here
UpdateData(true); //更新数据
p_language[m_ctl_list.GetCurSel()]->DefaultRadix=m_opt_radix;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -