📄 opendlg.cpp
字号:
/**************************************************************************
THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Author: Barretto VN 7/2001
**************************************************************************/
// OpenDLg.cpp : implementation file
//
#include "stdafx.h"
#include "FavsMV.h"
#include "OpenDLg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COpenDLg dialog
COpenDLg::COpenDLg(CWnd* pParent /*=NULL*/)
: CDialog(COpenDLg::IDD, pParent)
{
//{{AFX_DATA_INIT(COpenDLg)
m_URL = _T("");
//}}AFX_DATA_INIT
}
void COpenDLg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COpenDLg)
DDX_Text(pDX, IDC_EDIT_URL, m_URL);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COpenDLg, CDialog)
//{{AFX_MSG_MAP(COpenDLg)
ON_EN_CHANGE(IDC_EDIT_URL, OnChangeEditUrl)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COpenDLg message handlers
void COpenDLg::OnChangeEditUrl()
{
// 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
GetDlgItem(IDOK)->EnableWindow();
}
void COpenDLg::OnBrowse()
{
// TODO: Add your control notification handler code here
BOOL bOpen = TRUE;
char bigBuff[2048] = ""; // maximum common dialog buffer size
char szFilter[] =
"HTML Files (*.HTML)|*.html|*.HTM|All Files (*.*)|*.*|||";
CFileDialog dlg(bOpen, NULL, NULL,
OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, szFilter);
// Modify OPENFILENAME members directly to point to bigBuff
dlg.m_ofn.lpstrFile = bigBuff;
dlg.m_ofn.nMaxFile = sizeof(bigBuff);
dlg.DoModal();
if(dlg.m_ofn.lpstrFile != "")
{
GetDlgItem(IDC_EDIT_URL)->SetWindowText(dlg.m_ofn.lpstrFile);
GetDlgItem(IDOK)->EnableWindow();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -