📄 htmltestdlg.cpp
字号:
// HtmlTestDlg.cpp : implementation file
//
#include "stdafx.h"
#include "HtmlTest.h"
#include "HtmlTestDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHtmlTestDlg dialog
CHtmlTestDlg::CHtmlTestDlg(CWnd* pParent /*=NULL*/)
: CSTHtmlDialog(CHtmlTestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CHtmlTestDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CHtmlTestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CHtmlTestDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CHtmlTestDlg, CSTHtmlDialog)
//{{AFX_MSG_MAP(CSTHtmlTestDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHtmlTestDlg message handlers
BOOL CHtmlTestDlg::OnInitDialog()
{
CSTHtmlDialog::OnInitDialog();
//Here we register image that will be accessible in HTML
RegisterHtmlImage(IDB_TEST1, _T("rose"));
//Here we set HTML text that will be shown
CString strHtml;
strHtml.LoadString(IDS_HTMLTEXT);
SetHtml(strHtml);
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
return TRUE; // return TRUE unless you set the focus to a control
}
//This method is called if a link is clicked
void CHtmlTestDlg::OnLink(const CString &strHref)
{
if (strHref==_T("testlink")) {
CString strHtml;
strHtml.LoadString(IDS_HTMLTEXT2);
SetHtml(strHtml);
} else {
CString strHtml;
strHtml.LoadString(IDS_HTMLTEXT);
SetHtml(strHtml);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -