#include "stdafx.h" #include "ViewPPIDNew.h" // CViewPPIDNew ´ëÈ­ »óÀÚÀÔ´Ï´Ù. IMPLEMENT_DYNAMIC(CViewPPIDNew, CDialog) CViewPPIDNew::CViewPPIDNew(CWnd* pParent /*=NULL*/) : CDialog(CViewPPIDNew::IDD, pParent) { } CViewPPIDNew::~CViewPPIDNew() { } void CViewPPIDNew::DoDataExchange(CDataExchange* pDX) { DDX_Text(pDX,IDC_EDIT_PPIDNEW_NAME,m_strNewRecipeName); CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CViewPPIDNew, CDialog) ON_WM_PAINT() ON_WM_SHOWWINDOW() END_MESSAGE_MAP() BEGIN_EVENTSINK_MAP(CViewPPIDNew, CDialog) ON_EVENT(CViewPPIDNew, IDC_BTN_PPIDNEW_OK, DISPID_CLICK, CViewPPIDNew::ClickBtnPpidnewOk, VTS_NONE) ON_EVENT(CViewPPIDNew, IDC_BTN_PPIDNEW_CANCEL, DISPID_CLICK, CViewPPIDNew::ClickBtnPpidnewCancel, VTS_NONE) END_EVENTSINK_MAP() // CViewPPIDNew ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. BOOL CViewPPIDNew::OnInitDialog() { m_FontControl.SetFont(this,IDC_EDIT_PPIDNEW_NAME,CFontControl::EN_BUTTONFONT); return TRUE; } void CViewPPIDNew::OnPaint() { CPaintDC dc(this); // device context for painting CGeneralDraw pDraw; CUIPictureControl uiTitleRecipeName; uiTitleRecipeName.SetItemDefault(this,IDC_NEWPPID_NAME_TITLE); uiTitleRecipeName.m_nFontsize = 24; uiTitleRecipeName.m_strData.Format(_T("%s"),_T("New PPID Name")); pDraw.DrawPitureControl(uiTitleRecipeName); } void CViewPPIDNew::OnShowWindow(BOOL bShow, UINT nStatus) { CDialog::OnShowWindow(bShow, nStatus); if(bShow == TRUE) { ((CWnd*)GetDlgItem(IDC_EDIT_PPIDNEW_NAME))->SetFocus(); } } void CViewPPIDNew::ClickBtnPpidnewOk() { UpdateData(TRUE); if(m_strNewRecipeName.IsEmpty() == TRUE) { AfxMessageBox(_T("Input Recipe Name")); ((CWnd*)GetDlgItem(IDC_EDIT_PPIDNEW_NAME))->SetFocus(); return; } OnOK(); } void CViewPPIDNew::ClickBtnPpidnewCancel() { OnCancel(); }