📄 browersview.cpp
字号:
// browersView.cpp : implementation of the CBrowersView class
//
#include "stdafx.h"
#include "browers.h"
#include "browersDoc.h"
#include "browersView.h"
#include "Web.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBrowersView
IMPLEMENT_DYNCREATE(CBrowersView, CHtmlView)
BEGIN_MESSAGE_MAP(CBrowersView, CHtmlView)
//{{AFX_MSG_MAP(CBrowersView)
ON_COMMAND(ID_FILE_WEB, OnFileWeb)
ON_COMMAND(ID_FILE_BACK, OnFileBack)
ON_COMMAND(ID_FILE_FRONT, OnFileFront)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CHtmlView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CHtmlView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBrowersView construction/destruction
CBrowersView::CBrowersView()
{
// TODO: add construction code here
}
CBrowersView::~CBrowersView()
{
}
BOOL CBrowersView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CBrowersView drawing
void CBrowersView::OnDraw(CDC* pDC)
{
CBrowersDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CBrowersView printing
BOOL CBrowersView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CBrowersView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CBrowersView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CBrowersView diagnostics
#ifdef _DEBUG
void CBrowersView::AssertValid() const
{
CView::AssertValid();
}
void CBrowersView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CBrowersDoc* CBrowersView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CBrowersDoc)));
return (CBrowersDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CBrowersView message handlers
void CBrowersView::OnInitialUpdate()
{
//TODO: This code navigates to a popular spot on the web.
//Change the code to go where you'd like.
Navigate2(_T("http://image.baidu.com/i?ct=503316480&z=5&tn=baiduimagedetail&word=%D7%D4%C8%BB%B7%E7%B9%E2&in=19638&cl=2&cm=1&sc=0&lm=-1&pn=0&rn=1&di=2182869492&ln=2000"),NULL,NULL);
}
void CBrowersView::OnFileWeb()
{
// TODO: Add your command handler code here
CWeb dlg;
dlg.DoModal();
Navigate2(dlg.m_website);
}
void CBrowersView::OnFileBack()
{
// TODO: Add your command handler code here
GoBack();
}
void CBrowersView::OnFileFront()
{
// TODO: Add your command handler code here
GoForward();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -