📄 setcellinputdlg.cpp
字号:
// SetCellInputDlg.cpp : implementation file
//
#include "stdafx.h"
#include "sreport.h"
#include "SetCellInputDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetCellInputDlg dialog
CSetCellInputDlg::CSetCellInputDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetCellInputDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetCellInputDlg)
m_col = 0;
m_row = 0;
m_strValue = _T("");
//}}AFX_DATA_INIT
}
void CSetCellInputDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetCellInputDlg)
DDX_Control(pDX, IDC_VALUE, m_editValue);
DDX_Text(pDX, IDC_COL, m_col);
DDX_Text(pDX, IDC_ROW, m_row);
DDX_Text(pDX, IDC_VALUE, m_strValue);
DDX_Control(pDX, IDC_VALUEPREVIEW, m_htmlValue);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetCellInputDlg, CDialog)
//{{AFX_MSG_MAP(CSetCellInputDlg)
ON_EN_CHANGE(IDC_VALUE, OnChangeValue)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetCellInputDlg message handlers
CString ResourceToURL(LPCTSTR lpszURL);
BOOL CSetCellInputDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_htmlValue.Navigate(ResourceToURL("previewframe.htm"),NULL,NULL,NULL,NULL);
LPDISPATCH lpDispatch;
lpDispatch=m_htmlValue.GetDocument();
ASSERT(lpDispatch);
//get html document from IDispatch
HRESULT hr=lpDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&m_pHtmlDoc2);
ASSERT(hr==S_OK) ;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSetCellInputDlg::OnChangeValue()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
IHTMLElement *body;
m_pHtmlDoc2->get_body(&body);
BSTR bsStr = m_strValue.AllocSysString();
body->put_innerHTML(bsStr);
SysFreeString(bsStr);
body->Release();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -