샌드위치 가게


void CShopDlg::OnRadio1()
{
 // TODO: Add your control notification handler code here
 m_nBread = -1;
 if(m_nBread == -1)
 {
  UpdateData(TRUE);
  m_nList.AddString("일반빵");
  sum += 500;
 }
}

void CShopDlg::OnRadio2()
{
 // TODO: Add your control notification handler code here
 m_nBread = 0;
 if(m_nBread == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("호밀빵");
  sum += 600;
 }
}

void CShopDlg::OnRadio3()
{
 // TODO: Add your control notification handler code here
 m_nBread = 1;
 if(m_nBread == 1)
 {
  UpdateData(TRUE);
  m_nList.AddString("치즈빵");
  sum += 700;
 }
}

void CShopDlg::OnCheck1()
{
 // TODO: Add your control notification handler code here
 if(m_nCt == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("캐첩");
  sum += 50;
 }
}

void CShopDlg::OnCheck2()
{
 // TODO: Add your control notification handler code here
 if(m_nMustard == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("머스타드");
  sum += 50;
 }
}

void CShopDlg::OnCheck3()
{
 // TODO: Add your control notification handler code here
 if(m_nMaounez == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("마요네즈");
  sum += 50;
 }
}

void CShopDlg::OnRadio4()
{
 // TODO: Add your control notification handler code here
 m_nPotato = -1;
 if(m_nPotato == -1)
 {
  UpdateData(TRUE);
  m_nList.AddString("감자");
  sum += 500;
 }
}

void CShopDlg::OnRadio5()
{
 // TODO: Add your control notification handler code here
 m_nPotato = 0;
 if(m_nPotato == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("고구마");
  sum += 500;
 }
}

void CShopDlg::OnRadio6()
{
 // TODO: Add your control notification handler code here
 m_nPotato = 1;
 if(m_nPotato == 1)
 {
  UpdateData(TRUE);
  m_nList.AddString("햄");
  sum += 400;
 }
}

void CShopDlg::OnCheck4()
{
 // TODO: Add your control notification handler code here
 if(m_nOliv == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("올리브");
  sum += 200;
 }
}

void CShopDlg::OnCheck5()
{
 // TODO: Add your control notification handler code here
 if(m_nYang == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("양상치");
  sum += 100;
 }
}

void CShopDlg::OnCheck6()
{
 // TODO: Add your control notification handler code here
 if(m_nEgg == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("달걀");
  sum += 300;
 }
}

void CShopDlg::OnCheck7()
{
 // TODO: Add your control notification handler code here
 if(m_nChiz == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("치즈");
  sum += 100;
 }
}

void CShopDlg::OnCheck8()
{
 // TODO: Add your control notification handler code here
 if(m_nTomato == 0)
 {
  UpdateData(TRUE);
  m_nList.AddString("토마토");
  sum += 100;
 }
}

void CShopDlg::OnOK()
{
 // TODO: Add extra validation here
 CString str;

 str.Format("가격 : %d", sum);
 AfxMessageBox(str);

 CDialog::OnOK();
}

void CShopDlg::OnButton1()
{
 // TODO: Add your control notification handler code here
 sum = 0;

 // 체크, 라디오 버튼 초기화
 m_ctrlCt.SetCheck(0);
 m_ctrlTomato.SetCheck(0);
 m_ctrlChiz.SetCheck(0);
 m_ctrlEgg.SetCheck(0);
 m_ctrlYang.SetCheck(0);
 m_ctrlOliv.SetCheck(0);
 m_ctrlPotato.SetCheck(0);
 m_ctrlbread.SetCheck(0);
 m_ctrlMaonez.SetCheck(0);
 m_ctrlMustard.SetCheck(0);

 m_nList.ResetContent();  // 리스트박스 초기화
}

by 유니콘 | 2009/01/23 14:32 | MFC 자료 | 트랙백

※ 로그인 사용자만 덧글을 남길 수 있습니다.

◀ 이전 페이지          다음 페이지 ▶