home *** CD-ROM | disk | FTP | other *** search
- // speedvw.cpp : implementation of the CSpeedView class
- //
-
- #include "stdafx.h"
- #include "speed.h"
-
- #include "speeddoc.h"
- #include "speedvw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CSpeedView
-
- IMPLEMENT_DYNCREATE(CSpeedView, CView)
-
- BEGIN_MESSAGE_MAP(CSpeedView, CView)
- //{{AFX_MSG_MAP(CSpeedView)
- ON_COMMAND(ID_FILE_TRYIT, OnFileTryit)
- ON_COMMAND(ID_FILE_CURRENTSPEED, OnFileCurrentspeed)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CSpeedView construction/destruction
-
- CSpeedView::CSpeedView()
- {
- // TODO: add construction code here
- }
-
- CSpeedView::~CSpeedView()
- {
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CSpeedView drawing
-
- void CSpeedView::OnDraw(CDC* pDC)
- {
- CSpeedDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-
- // TODO: add draw code for native data here
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CSpeedView diagnostics
-
- #ifdef _DEBUG
- void CSpeedView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CSpeedView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CSpeedDoc* CSpeedView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSpeedDoc)));
- return (CSpeedDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CSpeedView message handlers
-
- void CSpeedView::OnFileTryit()
- {
- // TODO: Add your command handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Display the dialog box.
- // Note that DoModal() is a member function of the CWnd class.
- // dlg is an object of the CMyDlg class, and CMyDlg class
- // is derived from the CDialog class which is derived from
- // the CWnd class. Thus, you can execute DoModal() on the
- // dlg object.
- dlg.DoModal();
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CSpeedView::OnFileCurrentspeed()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Local variables
- CString Message;
- char Current[25];
-
- // Prepare the message
- itoa ( dlg.m_ScrollPosition, Current, 10 );
- Message = (CString) "Current Speed is: " + Current;
-
- // Display the message
- MessageBox ( Message, "Current Speed", MB_OK);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-