ex127View.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:2k
源码类别:
书籍源码
开发平台:
Visual C++
- // ex127View.cpp : implementation of the CEx127View class
- //
- #include "stdafx.h"
- #include "ex127.h"
- #include "ex127Doc.h"
- #include "ex127View.h"
- #include "WebSetDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEx127View
- IMPLEMENT_DYNCREATE(CEx127View, CHtmlView)
- BEGIN_MESSAGE_MAP(CEx127View, CHtmlView)
- //{{AFX_MSG_MAP(CEx127View)
- ON_COMMAND(ID_FILE_NAVIGATE, OnFileNavigate)
- ON_COMMAND(ID_FILE_BACK, OnFileBack)
- ON_COMMAND(ID_FILE_FORWARD, OnFileForward)
- ON_COMMAND(ID_FILE_HOME, OnFileHome)
- ON_COMMAND(ID_FILE_STOP, OnFileStop)
- ON_COMMAND(ID_FILE_REFRESH, OnFileRefresh)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CEx127View construction/destruction
- CEx127View::CEx127View()
- {
- // TODO: add construction code here
- }
- CEx127View::~CEx127View()
- {
- }
- BOOL CEx127View::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CHtmlView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx127View drawing
- void CEx127View::OnDraw(CDC* pDC)
- {
- CEx127Doc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- void CEx127View::OnInitialUpdate()
- {
- CHtmlView::OnInitialUpdate();
- // TODO: This code navigates to a popular spot on the web.
- // change the code to go where you'd like.
- Navigate2(_T(""),NULL,NULL);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx127View diagnostics
- #ifdef _DEBUG
- void CEx127View::AssertValid() const
- {
- CHtmlView::AssertValid();
- }
- void CEx127View::Dump(CDumpContext& dc) const
- {
- CHtmlView::Dump(dc);
- }
- CEx127Doc* CEx127View::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx127Doc)));
- return (CEx127Doc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CEx127View message handlers
- void CEx127View::OnFileNavigate()
- {
- //弹出地址选择对话框
- CWebSetDlg dlg;
- if(dlg.DoModal()!=IDOK)
- return;
- Navigate2(dlg.m_strAddress);
- }
- void CEx127View::OnFileBack()
- {
- GoBack();
- }
- void CEx127View::OnFileForward()
- {
- GoForward();
- }
- void CEx127View::OnFileHome()
- {
- GoHome();
- }
- void CEx127View::OnFileStop()
- {
- Stop();
- }
- void CEx127View::OnFileRefresh()
- {
- Refresh();
- }