root/trunk/ElephantMessageBoxYesNo.cpp

Revision 5, 1.8 kB (checked in by qbert, 6 years ago)

Initial ( and last :( ) commit

Line 
1 // ElephantMessageBoxYesNo.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Elephant.h"
6 #include "ElephantMessageBoxYesNo.h"
7
8 #ifdef _DEBUG
9 #define new DEBUG_NEW
10 #undef THIS_FILE
11 static char THIS_FILE[] = __FILE__;
12 #endif
13
14 /////////////////////////////////////////////////////////////////////////////
15 // CElephantMessageBoxYesNo dialog
16
17
18 CElephantMessageBoxYesNo::CElephantMessageBoxYesNo(CWnd* pParent /*=NULL*/)
19     : CDialog(CElephantMessageBoxYesNo::IDD, pParent)
20 {
21     //{{AFX_DATA_INIT(CElephantMessageBoxYesNo)
22     m_text = _T("");
23     //}}AFX_DATA_INIT
24 }
25
26
27 void CElephantMessageBoxYesNo::DoDataExchange(CDataExchange* pDX)
28 {
29     CDialog::DoDataExchange(pDX);
30     //{{AFX_DATA_MAP(CElephantMessageBoxYesNo)
31     DDX_Control(pDX, IDC_BUTTON2, m_no);
32     DDX_Control(pDX, IDC_BUTTON1, m_yes);
33     DDX_Text(pDX, IDC_STATIC1, m_text);
34     //}}AFX_DATA_MAP
35 }
36
37
38 BEGIN_MESSAGE_MAP(CElephantMessageBoxYesNo, CDialog)
39     //{{AFX_MSG_MAP(CElephantMessageBoxYesNo)
40     ON_BN_CLICKED(IDC_BUTTON1, OnYes)
41     ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
42     //}}AFX_MSG_MAP
43 END_MESSAGE_MAP()
44
45 /////////////////////////////////////////////////////////////////////////////
46 // CElephantMessageBoxYesNo message handlers
47
48 BOOL CElephantMessageBoxYesNo::OnInitDialog()
49 {
50     CDialog::OnInitDialog();
51
52     SetupButton(&m_yes);
53     SetupButton(&m_no);
54    
55     SetIcon(AfxGetApp()->LoadIcon(IDR_ELEPHANT) ,true);
56    
57     return TRUE;  // return TRUE unless you set the focus to a control
58                               // EXCEPTION: OCX Property Pages should return FALSE
59 }
60 void CElephantMessageBoxYesNo::SetMsg(const string& text)
61 {
62     m_text = text.c_str();
63     //UpdateData(FALSE);
64
65 }
66
67 void CElephantMessageBoxYesNo::OnYes()
68 {
69     EndDialog( IDYES);
70     // TODO: Add your control notification handler code here
71    
72 }
73
74 void CElephantMessageBoxYesNo::OnButton2()
75 {
76     EndDialog( IDNO);
77    
78 }
Note: See TracBrowser for help on using the browser.