📄 htmlviewexampleview.cpp
字号:
// HtmlViewExampleView.cpp : implementation of the CHtmlViewExampleView class
//
#include "stdafx.h"
#include "HtmlViewExample.h"
#include "MainFrm.h"
#include "HtmlViewExampleDoc.h"
#include "HtmlViewExampleView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHtmlViewExampleView
IMPLEMENT_DYNCREATE(CHtmlViewExampleView, CHtmlView)
BEGIN_MESSAGE_MAP(CHtmlViewExampleView, CHtmlView)
//{{AFX_MSG_MAP(CHtmlViewExampleView)
ON_BN_CLICKED(IDC_RUN, OnRun)
ON_EN_CHANGE(IDC_EDADDRESS, OnChangeEdaddress)
ON_BN_CLICKED(IDC_BTSTOP, OnBtstop)
ON_BN_CLICKED(IDC_BTREFRESH, OnBtrefresh)
ON_BN_CLICKED(IDC_BTFORWARD, OnBtforward)
ON_BN_CLICKED(IDC_BTBACK, OnBtback)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHtmlViewExampleView construction/destruction
CHtmlViewExampleView::CHtmlViewExampleView()
{
// TODO: add construction code here
}
CHtmlViewExampleView::~CHtmlViewExampleView()
{
}
BOOL CHtmlViewExampleView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CHtmlView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CHtmlViewExampleView drawing
void CHtmlViewExampleView::OnDraw(CDC* pDC)
{
CHtmlViewExampleDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
void CHtmlViewExampleView::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("http://www.microsoft.com/visualc/"),NULL,NULL);
}
/////////////////////////////////////////////////////////////////////////////
// CHtmlViewExampleView printing
/////////////////////////////////////////////////////////////////////////////
// CHtmlViewExampleView diagnostics
#ifdef _DEBUG
void CHtmlViewExampleView::AssertValid() const
{
CHtmlView::AssertValid();
}
void CHtmlViewExampleView::Dump(CDumpContext& dc) const
{
CHtmlView::Dump(dc);
}
CHtmlViewExampleDoc* CHtmlViewExampleView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHtmlViewExampleDoc)));
return (CHtmlViewExampleDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CHtmlViewExampleView message handlers
void CHtmlViewExampleView::OnRun()
{
CClientDC dc(this);
Navigate2(strsite,NULL,NULL);
Invalidate(FALSE);
}
void CHtmlViewExampleView::OnChangeEdaddress()
{
CMainFrame *pw=(CMainFrame *)AfxGetMainWnd();
CDialogBar *pb=&(pw->m_DlgToolBar);
pb->GetDlgItemText(IDC_EDADDRESS,strsite);
}
void CHtmlViewExampleView::OnBtstop()
{
Stop();
}
void CHtmlViewExampleView::OnBtrefresh()
{
this->Refresh();
}
void CHtmlViewExampleView::OnBtforward()
{
GoForward();
}
void CHtmlViewExampleView::OnBtback()
{
GoBack();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -