1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 
#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();
}