home *** CD-ROM | disk | FTP | other *** search
- // padview.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "pad.h"
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- #include "paddoc.h"
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- #include "padview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CPadView
-
- IMPLEMENT_DYNCREATE(CPadView, CFormView)
-
- CPadView::CPadView()
- : CFormView(CPadView::IDD)
- {
- //{{AFX_DATA_INIT(CPadView)
- m_Subject = "";
- m_Notes = "";
- //}}AFX_DATA_INIT
- }
-
- CPadView::~CPadView()
- {
- }
-
- void CPadView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPadView)
- DDX_Text(pDX, IDC_SUBJECT, m_Subject);
- DDX_Text(pDX, IDC_NOTES, m_Notes);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CPadView, CFormView)
- //{{AFX_MSG_MAP(CPadView)
- ON_EN_CHANGE(IDC_SUBJECT, OnChangeSubject)
- ON_EN_CHANGE(IDC_NOTES, OnChangeNotes)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CPadView message handlers
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- void CPadView::OnInitialUpdate()
- {
-
- // Get a pointer to the document.
- CPadDoc* pDoc = (CPadDoc*) GetDocument();
-
- // Update the data members of the view class with the
- // current values of the document class data members.
- m_Subject = pDoc->m_Subject;
- m_Notes = pDoc->m_Notes;
-
- // Update the screen with the new values.
- UpdateData(FALSE);
-
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- void CPadView::OnChangeSubject()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Update the variables of the controls with the
- // current values inside the controls.
- UpdateData(TRUE);
-
- // Get a pointer to the document.
- CPadDoc* pDoc = (CPadDoc*) GetDocument();
-
- // Update the m_Subject data member of the document class.
- pDoc->m_Subject = m_Subject;
-
- // Set the Modified flag of the document class to TRUE.
- pDoc->SetModifiedFlag();
-
- // Update all the other views of the same document.
- pDoc->UpdateAllViews(this);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CPadView::OnChangeNotes()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Update the variables of the controls with the
- // current values inside the controls.
- UpdateData(TRUE);
-
- // Get a pointer to the document.
- CPadDoc* pDoc = (CPadDoc*) GetDocument();
-
- // Update the m_Notes data member of the document class.
- pDoc->m_Notes = m_Notes;
-
- // Set the Modified flag of the document class to TRUE.
- pDoc->SetModifiedFlag();
-
- // Update all the other views of the same document.
- pDoc->UpdateAllViews(this);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- void CPadView::OnUpdate(CView* pSender,
- LPARAM lHint,
- CObject* pHint)
- {
-
- // Get a pointer to the document.
- CPadDoc* pDoc = (CPadDoc*) GetDocument();
-
- // Update the view with the current document values.
- m_Subject = pDoc->m_Subject;
- m_Notes = pDoc->m_Notes;
-
- // Update the screen with the new variables values.
- UpdateData(FALSE);
-
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-