///////////////////////////////////////////////////////////////////// // MFCBrowserView.cpp - View Handling for DocView Architecture // // // // Jim Fawcett, CSE775 - Distributed Objects, Spring 2005 // ///////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "MFCBrowser.h" #include "MFCBrowserDoc.h" #include "MFCBrowserView.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMFCBrowserView IMPLEMENT_DYNCREATE(CMFCBrowserView, CHtmlView) BEGIN_MESSAGE_MAP(CMFCBrowserView, CHtmlView) // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint) END_MESSAGE_MAP() // CMFCBrowserView construction/destruction CMFCBrowserView::CMFCBrowserView() { // TODO: add construction code here } CMFCBrowserView::~CMFCBrowserView() { } BOOL CMFCBrowserView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CHtmlView::PreCreateWindow(cs); } void CMFCBrowserView::OnInitialUpdate() { CHtmlView::OnInitialUpdate(); } // CMFCBrowserView printing // CMFCBrowserView diagnostics #ifdef _DEBUG void CMFCBrowserView::AssertValid() const { CHtmlView::AssertValid(); } void CMFCBrowserView::Dump(CDumpContext& dc) const { CHtmlView::Dump(dc); } CMFCBrowserDoc* CMFCBrowserView::GetDocument() const // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCBrowserDoc))); return (CMFCBrowserDoc*)m_pDocument; } #endif //_DEBUG // CMFCBrowserView message handlers //----< called by CMFCDocument::UpdateAllViews >------------- void CMFCBrowserView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/) { // TODO: Add your specialized code here and/or call the base class CString temp; if(m_FilePath.GetLength() == 0) temp = "c:/su/webpages/cse775.xml"; else temp = m_FilePath; Navigate2(_T(temp),NULL,NULL); } //----< called by CMFCDocument to set navigation path >------ void CMFCBrowserView::SetFilePath(const CString& filePath) { m_FilePath = filePath; }