home *** CD-ROM | disk | FTP | other *** search
- // testview.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "test.h"
- #include "testview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CTestView
-
- IMPLEMENT_DYNCREATE(CTestView, CFormView)
-
- CTestView::CTestView()
- : CFormView(CTestView::IDD)
- {
- //{{AFX_DATA_INIT(CTestView)
- m_MyEditBox = "";
- //}}AFX_DATA_INIT
- }
-
- CTestView::~CTestView()
- {
- }
-
- void CTestView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTestView)
- DDX_Text(pDX, IDC_EDIT1, m_MyEditBox);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CTestView, CFormView)
- //{{AFX_MSG_MAP(CTestView)
- ON_BN_CLICKED(IDC_TEST_BUTTON, OnTestButton)
- ON_BN_CLICKED(IDC_CLEAR_BUTTON, OnClearButton)
- ON_COMMAND(ID_FILE_TEST, OnFileTest)
- ON_COMMAND(ID_FILE_CLEAR, OnFileClear)
- ON_COMMAND(ID_FILE_CURRENTVALUE, OnFileCurrentvalue)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CTestView message handlers
-
-
- void CTestView::OnTestButton()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Fill the edit box with text.
- m_MyEditBox = "THIS IS A TEST";
- UpdateData(FALSE);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CTestView::OnClearButton()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Fill the edit box with null.
- m_MyEditBox = "";
- UpdateData(FALSE);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
- }
-
- void CTestView::OnFileTest()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- OnTestButton();
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CTestView::OnFileClear()
- {
- // TODO: Add your command handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- OnClearButton();
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CTestView::OnFileCurrentvalue()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Display the current contents of the edit box.
- UpdateData(TRUE);
- MessageBox("Current value of m_MyEditBox = "
- + m_MyEditBox);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-