home *** CD-ROM | disk | FTP | other *** search
- // mylisvw.cpp : implementation of the CMylistView class
- //
-
- #include "stdafx.h"
- #include "mylist.h"
-
- #include "mylisdoc.h"
- #include "mylisvw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMylistView
-
- IMPLEMENT_DYNCREATE(CMylistView, CView)
-
- BEGIN_MESSAGE_MAP(CMylistView, CView)
- //{{AFX_MSG_MAP(CMylistView)
- ON_COMMAND(ID_FILE_TRYIT, OnFileTryit)
- ON_COMMAND(ID_FILE_CURRENTITEM, OnFileCurrentitem)
- ON_COMMAND(ID_FILE_TOTALITEMS, OnFileTotalitems)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMylistView construction/destruction
-
- CMylistView::CMylistView()
- {
- // TODO: add construction code here
- }
-
- CMylistView::~CMylistView()
- {
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMylistView drawing
-
- void CMylistView::OnDraw(CDC* pDC)
- {
- CMylistDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-
- // TODO: add draw code for native data here
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMylistView diagnostics
-
- #ifdef _DEBUG
- void CMylistView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CMylistView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CMylistDoc* CMylistView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMylistDoc)));
- return (CMylistDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMylistView message handlers
-
- void CMylistView::OnFileTryit()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Display the dlg dialog box.
- dlg.DoModal();
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMylistView::OnFileCurrentitem()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- MessageBox ( "The current selected item is: " +
- dlg.m_SelectedItem );
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
- }
-
- void CMylistView::OnFileTotalitems()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- char sTotalItems[10];
-
- itoa ( dlg.m_TotalItems, sTotalItems, 10);
-
- CString Message;
-
- Message =
- "Total Number of items is: " + (CString)sTotalItems;
-
- MessageBox ( Message );
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-