📄 mieview.cpp
字号:
// MIEView.cpp : implementation of the CMIEView class
//
#include "stdafx.h"
#include "MIE.h"
#include "MainFrm.h"
#include "MIEDoc.h"
#include "MIEView.h"
#include "ViewManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMIEView
IMPLEMENT_DYNCREATE(CMIEView, CHtmlView)
BEGIN_MESSAGE_MAP(CMIEView, CHtmlView)
//{{AFX_MSG_MAP(CMIEView)
ON_COMMAND(ID_BACK, OnBack)
ON_COMMAND(ID_NEXT, OnNext)
ON_COMMAND(ID_HOME, OnHome)
ON_COMMAND(ID_REFESH, OnRefesh)
ON_COMMAND(ID_STOP, OnStop)
ON_COMMAND(ID_SEARCH, OnSearch)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMIEView construction/destruction
CMIEView::CMIEView()
{
theViewManager.AddView("", this); // TODO: add construction code here
}
CMIEView::~CMIEView()
{ theViewManager.RemoveView(this);
}
void CMIEView::OnTitleChange(LPCTSTR lpszText)
{
// this will change the main frame's title bar
if (m_pDocument != NULL)
m_pDocument->SetTitle(lpszText);
}
void CMIEView::OnDocumentComplete(LPCTSTR lpszUrl)
{
// make sure the main frame has the new URL. This call also stops the animation
((CMainFrame*)GetParentFrame())->SetAddress(lpszUrl);
}
BOOL CMIEView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszClass = AfxRegisterWndClass(0);
return CHtmlView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CMIEView drawing
void CMIEView::OnDraw(CDC* pDC)
{
CMIEDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
void CMIEView::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
// TODO: This code navigates to a popular spot on the web.
// change the code to go where you'd like.
CString address=((CMainFrame *)GetSafeOwner())->address;
Navigate2(_T(address),NULL,NULL);
theViewManager.SetViewName(address, this);
}
/////////////////////////////////////////////////////////////////////////////
// CMIEView printing
/////////////////////////////////////////////////////////////////////////////
// CMIEView diagnostics
#ifdef _DEBUG
void CMIEView::AssertValid() const
{
CHtmlView::AssertValid();
}
void CMIEView::Dump(CDumpContext& dc) const
{
CHtmlView::Dump(dc);
}
CMIEDoc* CMIEView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMIEDoc)));
return (CMIEDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMIEView message handlers
void CMIEView::OnBack()
{
// TODO: Add your command handler code here
GoBack();
}
void CMIEView::OnNext()
{
// TODO: Add your command handler code here
GoForward();
}
void CMIEView::OnHome()
{
// TODO: Add your command handler code here
GoHome();
}
void CMIEView::OnRefesh()
{
// TODO: Add your command handler code here
Refresh();
}
void CMIEView::OnStop()
{
// TODO: Add your command handler code here
Stop();
}
void CMIEView::OnSearch()
{
// TODO: Add your command handler code here
GoSearch();
}
void CMIEView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
theViewManager.OnActivateView(bActivate, this);
CHtmlView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -