⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yszmxgdlg.cpp

📁 这是一套学校设备管理系统的源码 里面有树形结构使用的很棒的方法
💻 CPP
📖 第 1 页 / 共 3 页
字号:
	}
/*
	    strcpy(buff,buf);
	    if (g_lock_count_flag == 0){
	      g_lock_count_flag = 1;
	      GetDlgItemText(IDC_wpsl,buf,40);
	      sl = atof(buf);
	      GetDlgItemText(IDC_zje,buf,40);
	      zje = atof(buf);
	      if (fabs(sl) > 0.001){
	        dj = zje/sl;
	        sprintf(buf,"%#.2lf",dj);
			if (strlen(buf) > 8){
			  buff[l-1] = 0;
              p_mod_zje = 1;
	          SetDlgItemText(IDC_zje,buff);             
			  Set_to_item_end(this,IDC_zje);
            }
			else{
				if (fabs(dj) > 0.001){
                  p_mod_wpdj = 1;
	              SetDlgItemText(IDC_wpdj,buf);
				}
			}
		  }
	      g_lock_count_flag = 0;
		}
    }
a:
	GetDlgItemText(IDC_zje,buf,12);
    zje = atof(buf);
	GetDlgItemText(IDC_jfxs,buf,12);
	jfxs = atof(buf);
	GetDlgItemText(IDC_yzf,buf,12);
	yzf = atof(buf);
    sjhf = zje*jfxs/100.;
	xxhf = zje*(100-jfxs)/100.+yzf;
	sprintf(buf,"%.2lf",sjhf);
	SetDlgItemText(IDC_sjhf,buf);
	sprintf(buf,"%.2lf",xxhf);
	SetDlgItemText(IDC_xxhf,buf);
*/
}

void Cyszmxgdlg::OnSetfocussbmc() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_sbmc);
    switch_to_english_mode(wn);
    cur_focus = 1;
	
}

void Cyszmxgdlg::OnSetfocusrkfs() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_rkfs);
    switch_to_english_mode(wn);
    cur_focus = 2;
	
}

void Cyszmxgdlg::OnSetfocusrkn() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_wpdj);
    switch_to_english_mode(wn);
    cur_focus = 14;
	
}

void Cyszmxgdlg::OnSetfocusrkr() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_rkr);
    switch_to_english_mode(wn);
    cur_focus = 16;
	
}

void Cyszmxgdlg::OnSetfocusjbr() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_jbr);
    switch_to_english_mode(wn);
    cur_focus = 10;
	
}

void Cyszmxgdlg::OnSetfocusghdw() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_wpdj);
    switch_to_english_mode(wn);
    cur_focus = 11;
	
}

void Cyszmxgdlg::OnSetfocuscjpp() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_cjpp);
    switch_to_english_mode(wn);
    cur_focus = 4;
	
}

void Cyszmxgdlg::OnSetfocusssbm() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_ssbm);
    switch_to_english_mode(wn);
    cur_focus = 9;
	
}

void Cyszmxgdlg::OnSetfocusxhgg() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_xhgg);
    switch_to_english_mode(wn);
    cur_focus = 5;
	
}

void Cyszmxgdlg::OnSetfocusrky() 
{
	// TODO: Add your control notification handler code here
	CWnd *wn;

	wn = GetDlgItem(IDC_rky);
    switch_to_english_mode(wn);
    cur_focus = 15;
	
}

void Cyszmxgdlg::OnChangesbmc() 
{
	// 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
	char buf[50];

	GetDlgItemText(IDC_sbmc,buf,50);
	if (strlen(buf) > 40){
		buf[40] = 0;
		SetDlgItemText(IDC_sbmc,buf);
		Set_to_item_end(this,IDC_sbmc);
    }
	
}

void Cyszmxgdlg::OnEditchangerkfs() 
{
	// TODO: Add your control notification handler code here
	char buf[20];

	GetDlgItemText(IDC_rkfs,buf,20);
	if (buf[0] != 0){
	  if (m_rkfs.SelectString(0,buf) == CB_ERR){
		SetDlgItemText(IDC_rkfs,"");
	  }
	}
}

void Cyszmxgdlg::OnChangecjpp() 
{
	// 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
	char buf[50];

	GetDlgItemText(IDC_cjpp,buf,50);
	if (strlen(buf) > 20){
		buf[20] = 0;
		SetDlgItemText(IDC_cjpp,buf);
		Set_to_item_end(this,IDC_cjpp);
    }
		
}

void Cyszmxgdlg::OnChangexhgg() 
{
	// 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
	char buf[50];

	GetDlgItemText(IDC_xhgg,buf,50);
	if (strlen(buf) > 20){
		buf[20] = 0;
		SetDlgItemText(IDC_xhgg,buf);
		Set_to_item_end(this,IDC_xhgg);
    }
	
}

void Cyszmxgdlg::OnEditchangessbm() 
{
	// TODO: Add your control notification handler code here
	char buf[20];

	GetDlgItemText(IDC_ssbm,buf,20);
	if (buf[0] != 0){
	  if (m_ssbm.SelectString(0,buf) == CB_ERR){
		SetDlgItemText(IDC_ssbm,"");
	  }
	}
	
}

void Cyszmxgdlg::OnEditchangejbr() 
{
	// TODO: Add your control notification handler code here
	char buf[20];

	GetDlgItemText(IDC_jbr,buf,20);
	if (strlen(buf) > 10){
		buf[10] = 0;
		SetDlgItemText(IDC_jbr,buf);
		Set_to_item_end(this,IDC_jbr);
    }	
		
}

void Cyszmxgdlg::OnChangeghdw() 
{
	// 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
	char buf[50];

	GetDlgItemText(IDC_ghdw,buf,50);
	if (strlen(buf) > 20){
		buf[20] = 0;
		SetDlgItemText(IDC_ghdw,buf);
		Set_to_item_end(this,IDC_ghdw);
    }
	
}

void Cyszmxgdlg::OnEditchangerkn() 
{
	// TODO: Add your control notification handler code here
	char buf[40];

	int l,i,flag,j;
	
	GetDlgItemText(IDC_rkn,buf,12);
    l = strlen(buf);
	if (l > 0){
		if (l > 4){
			buf[4] = 0;
	        SetDlgItemText(IDC_rkn,buf);
        }
		for (i=0;i<l;i++){
	      if ((buf[i] < '0')||(buf[i] > '9')){
			if (i == 0){
				strcpy(buf,"2000");
			}
			else
		      buf[i] = 0;
	        SetDlgItemText(IDC_rkn,buf);
			Set_to_item_end(this,IDC_rkn);
		  }
		}
	}
	
}

void Cyszmxgdlg::OnEditchangerky() 
{
	// TODO: Add your control notification handler code here
	char buf[40];

	int l,i,flag,j;
	
	GetDlgItemText(IDC_rky,buf,12);
    l = strlen(buf);
	if (l > 0){
		if (l > 2){
			buf[2] = 0;
	        SetDlgItemText(IDC_rky,buf);
			Set_to_item_end(this,IDC_rky);
        }
		for (i=0;i<l;i++){
	      if ((buf[i] < '0')||(buf[i] > '9')){
			if (i == 0){
				strcpy(buf,"6");
			}
			else
		      buf[i] = 0;
	        SetDlgItemText(IDC_rky,buf);
			Set_to_item_end(this,IDC_rky);
		  }
		}
	}
	
}

void Cyszmxgdlg::OnEditchangerkr() 
{
	// TODO: Add your control notification handler code here
	char buf[40];

	int l,i,flag,j;
	
	GetDlgItemText(IDC_rkr,buf,12);
    l = strlen(buf);
	if (l > 0){
		if (l > 2){
			buf[2] = 0;
	        SetDlgItemText(IDC_rkr,buf);
			Set_to_item_end(this,IDC_rkr);
        }
		for (i=0;i<l;i++){
	      if ((buf[i] < '0')||(buf[i] > '9')){
			if (i == 0){
				strcpy(buf,"15");
			}
			else
		      buf[i] = 0;
	        SetDlgItemText(IDC_rkr,buf);
			Set_to_item_end(this,IDC_rkr);
		  }
		}
	}
	
}

void Cyszmxgdlg::OnSetfocusjfxs() 
{
	// TODO: Add your control notification handler code here
	CWnd *wnd;

	wnd = GetDlgItem(IDC_jfxs);
	switch_to_english_mode(wnd);	
	cur_focus = 12;
	
}

void Cyszmxgdlg::OnChangejfxs() 
{
	double zje,jfxs,yzf,sjhf,xxhf;
	char buf[40];

	int l,i,flag,j;
	
	GetDlgItemText(IDC_jfxs,buf,12);
    l = strlen(buf);
	if (l > 0){
		if (l > 2){
			if ((buf[0] == '1')&&(buf[1] == '0')&&(buf[2] == '0')){
            }
			else{
			  buf[2] = 0;
	          SetDlgItemText(IDC_rkn,buf);
			  Set_to_item_end(this,IDC_jfxs);
            }
        }
		for (i=0;i<l;i++){
	      if ((buf[i] < '0')||(buf[i] > '9')){
		    buf[i] = 0;
	        SetDlgItemText(IDC_jfxs,buf);
			Set_to_item_end(this,IDC_jfxs);
		  }
		}
	}
	GetDlgItemText(IDC_zje,buf,12);
    zje = atof(buf);
	GetDlgItemText(IDC_jfxs,buf,12);
	jfxs = atof(buf);
	GetDlgItemText(IDC_yzf,buf,12);
	yzf = atof(buf);
    sjhf = zje*jfxs/100.;
	xxhf = zje*(100-jfxs)/100.+yzf;
	sprintf(buf,"%.2lf",sjhf);
	SetDlgItemText(IDC_sjhf,buf);
	sprintf(buf,"%.2lf",xxhf);
	SetDlgItemText(IDC_xxhf,buf);
	
}

void Cyszmxgdlg::OnSetfocusyzf() 
{
	// TODO: Add your control notification handler code here
	CWnd *wnd;

	wnd = GetDlgItem(IDC_yzf);
	switch_to_english_mode(wnd);	
	cur_focus = 13;
	
}

void Cyszmxgdlg::OnChangeyzf() 
{
	double zje,jfxs,yzf,sjhf,xxhf;
	char buf[40];
	int l,i,flag,j;
	
	GetDlgItemText(IDC_yzf,buf,12);
    l = strlen(buf);
	if (l > 0){
		if (l > 8){
			buf[8] = 0;
	        SetDlgItemText(IDC_yzf,buf);
			Set_to_item_end(this,IDC_yzf);
        }
		for (i=0;i<l;i++){
	      if (((buf[i] < '0')||(buf[i] > '9'))&&(buf[i] != '.')){
		    buf[i] = 0;
	        SetDlgItemText(IDC_yzf,buf);
			Set_to_item_end(this,IDC_yzf);
		  }
		}
    }	
	GetDlgItemText(IDC_zje,buf,12);
    zje = atof(buf);
	GetDlgItemText(IDC_jfxs,buf,12);
	jfxs = atof(buf);
	GetDlgItemText(IDC_yzf,buf,12);
	yzf = atof(buf);
    sjhf = zje*jfxs/100.;
	xxhf = zje*(100-jfxs)/100.+yzf;
	sprintf(buf,"%.2lf",sjhf);
	SetDlgItemText(IDC_sjhf,buf);
	sprintf(buf,"%.2lf",xxhf);
	SetDlgItemText(IDC_xxhf,buf);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -