home *** CD-ROM | disk | FTP | other *** search
- // varview.cpp : implementation of the CVarView class
- //
-
- #include "stdafx.h"
- #include "var.h"
-
- #include "vardoc.h"
- #include "varview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CVarView
-
- IMPLEMENT_DYNCREATE(CVarView, CView)
-
- BEGIN_MESSAGE_MAP(CVarView, CView)
- //{{AFX_MSG_MAP(CVarView)
- ON_COMMAND(ID_FILE_CURRENTVALUE, OnFileCurrentvalue)
- ON_COMMAND(ID_FILE_TWO, OnFileTwo)
- ON_COMMAND(ID_FILE_ONE, OnFileOne)
- ON_COMMAND(ID_FILE_THREE, OnFileThree)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CVarView construction/destruction
-
- CVarView::CVarView()
- {
- // TODO: add construction code here
- }
-
- CVarView::~CVarView()
- {
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CVarView drawing
-
- void CVarView::OnDraw(CDC* pDC)
- {
- CVarDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-
- // TODO: add draw code for native data here
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CVarView diagnostics
-
- #ifdef _DEBUG
- void CVarView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CVarView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CVarDoc* CVarView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVarDoc)));
- return (CVarDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CVarView message handlers
-
- void CVarView::OnFileCurrentvalue()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Get a pointer to the document class.
- CVarDoc* pDoc = GetDocument();
-
- // Display the current value of m_MyVar
- MessageBox("Current value of m_MyVar is: "
- + pDoc->m_MyVar);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CVarView::OnFileTwo()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Get a pointer to the document class.
- CVarDoc* pDoc = GetDocument();
-
- // Change the value of m_MyVar to "Two".
- pDoc->m_MyVar = "Two";
-
- // Tell the user that m_MyVar was changed to "One".
- MessageBox("m_MyVar is now: " + pDoc->m_MyVar);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CVarView::OnFileOne()
- {
- // TODO: Add your command handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Get a pointer to the document class.
- CVarDoc* pDoc = GetDocument();
-
- // Change the value of m_MyVar to "One".
- pDoc->m_MyVar = "One";
-
- // Tell the user that m_MyVar was changed to "One".
- MessageBox("m_MyVar is now: " + pDoc->m_MyVar);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CVarView::OnFileThree()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Get a pointer to the document class.
- CVarDoc* pDoc = GetDocument();
-
- // Change the value of m_MyVar to "Three".
- pDoc->m_MyVar = "Three";
-
- // Tell the user that m_MyVar was changed to "Three".
- MessageBox("m_MyVar is now: " + pDoc->m_MyVar);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-