📄 ex_calculator04dlg.cpp
字号:
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::On4Button()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
switch (char_radio) {
case 'O':
value=value*8+4;
str.Format("%o",value);
if(i_InputCheck==1) str=str+"Q";
break;
case 'D':
value=value*10+4;
str.Format("%d",value);
if(i_InputCheck==1) str=str+"D";
break;
case 'H':
value=value*16+4;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::On5Button()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
switch (char_radio) {
case 'O':
value=value*8+5;
str.Format("%o",value);
if(i_InputCheck==1) str=str+"Q";
break;
case 'D':
value=value*10+5;
str.Format("%d",value);
if(i_InputCheck==1) str=str+"D";
break;
case 'H':
value=value*16+5;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::On6Button()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
switch (char_radio) {
case 'O':
value=value*8+6;
str.Format("%o",value);
if(i_InputCheck==1) str=str+"Q";
break;
case 'D':
value=value*10+6;
str.Format("%d",value);
if(i_InputCheck==1) str=str+"D";
break;
case 'H':
value=value*16+6;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::On7Button()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
switch (char_radio) {
case 'O':
value=value*8+7;
str.Format("%o",value);
if(i_InputCheck==1) str=str+"Q";
break;
case 'D':
value=value*10+7;
str.Format("%d",value);
if(i_InputCheck==1) str=str+"D";
break;
case 'H':
value=value*16+7;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::On8Button()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
switch(char_radio){
case 'D':
value=value*10+8;
str.Format("%d",value);
if(i_InputCheck==1) str=str+"D";
break;
case 'H':
value=value*16+8;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::On9Button()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
switch(char_radio){
case 'D':
value=value*10+9;
str.Format("%d",value);
if(i_InputCheck==1) str=str+"D";
break;
case 'H':
value=value*16+9;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
break;
}
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnAButton()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
value=value*16+10;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnBButton()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
value=value*16+11;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnCButton()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
value=value*16+12;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnDButton()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
value=value*16+13;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnEButton()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
value=value*16+14;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnFButton()
{
// TODO: Add your control notification handler code here
int i_InputCheck=m_InputCheck.GetState();
value=value*16+15;
str.Format("%x",value);
if(i_InputCheck==1) str=str+"H";
m_InputEdit=str; //将输入数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnToDButton()
{
// TODO: Add your control notification handler code here
int i_OutputCheck=m_OutputCheck.GetState();
str.Format("%d",value); //将数据转换为对应进制下的字符串
if (i_OutputCheck==1) str=str+"D";
value=0;
m_OutputEdit=str; //将转换后的数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnToHButton()
{
// TODO: Add your control notification handler code here
int i_OutputCheck=m_OutputCheck.GetState();
str.Format("%x",value); //将数据转换为对应进制下的字符串
if (i_OutputCheck==1) str=str+"H";
value=0;
m_OutputEdit=str; //将转换后的数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnToOButton()
{
// TODO: Add your control notification handler code here
int i_OutputCheck=m_OutputCheck.GetState();
str.Format("%o",value); //将数据转换为对应进制下的字符串
if (i_OutputCheck==1) str=str+"Q";
value=0;
m_OutputEdit=str; //将转换后的数据显示在编辑框中
UpdateData(FALSE);
}
void CEX_Calculator04Dlg::OnORadio()
{
// TODO: Add your control notification handler code here
char_radio='O';
value=0;
m_8Button.EnableWindow(FALSE);
m_9Button.EnableWindow(FALSE);
m_AButton.EnableWindow(FALSE);
m_BButton.EnableWindow(FALSE);
m_CButton.EnableWindow(FALSE);
m_DButton.EnableWindow(FALSE);
m_EButton.EnableWindow(FALSE);
m_FButton.EnableWindow(FALSE);
}
void CEX_Calculator04Dlg::OnHRadio()
{
// TODO: Add your control notification handler code here
char_radio='H';
value=0;
m_8Button.EnableWindow(TRUE);
m_9Button.EnableWindow(TRUE);
m_AButton.EnableWindow(TRUE);
m_BButton.EnableWindow(TRUE);
m_CButton.EnableWindow(TRUE);
m_DButton.EnableWindow(TRUE);
m_EButton.EnableWindow(TRUE);
m_FButton.EnableWindow(TRUE);
}
void CEX_Calculator04Dlg::OnDRadio()
{
// TODO: Add your control notification handler code here
char_radio='D';
value=0;
m_8Button.EnableWindow(TRUE);
m_9Button.EnableWindow(TRUE);
m_AButton.EnableWindow(FALSE);
m_BButton.EnableWindow(FALSE);
m_CButton.EnableWindow(FALSE);
m_DButton.EnableWindow(FALSE);
m_EButton.EnableWindow(FALSE);
m_FButton.EnableWindow(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -