📄 settingsdlg.cpp
字号:
/********************************************************************/
/* */
/* SettingsDlg.cpp */
/* */
/* This class is a part of the Mini ASP Web Server */
/* */
/* Programmed by Pablo van der Meer */
/* http://www.pablovandermeer.nl */
/* */
/* Last updated: July 4, 2003 */
/* */
/********************************************************************/
#include "stdafx.h"
#include "server.h"
#include "SettingsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CSettingsDlg::CSettingsDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSettingsDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSettingsDlg)
m_strWebPages = _T("");
m_strDefaultPage = _T("");
m_bAutoStart = FALSE;
m_nPort = 80;
//}}AFX_DATA_INIT
}
void CSettingsDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSettingsDlg)
DDX_Text(pDX, IDC_WEBPAGES, m_strWebPages);
DDX_Text(pDX, IDC_DEFAULTPAGE, m_strDefaultPage);
DDX_Check(pDX, IDC_AUTO_START, m_bAutoStart);
DDX_Text(pDX, IDC_PORT, m_nPort);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSettingsDlg, CDialog)
//{{AFX_MSG_MAP(CSettingsDlg)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_BN_CLICKED(IDC_FILEBROWSE, OnFilebrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/********************************************************************/
/* */
/* Function name : OnBrowse */
/* Description : Browse for folder */
/* */
/********************************************************************/
void CSettingsDlg::OnBrowse()
{
UpdateData();
CString strDir = BrowseForFolder(m_hWnd, "Select a directory:", BIF_RETURNONLYFSDIRS);
if (!strDir.IsEmpty())
{
m_strWebPages = strDir;
UpdateData(FALSE);
}
}
/********************************************************************/
/* */
/* Function name : OnFilebrowse */
/* Description : Browse for file */
/* */
/********************************************************************/
void CSettingsDlg::OnFilebrowse()
{
UpdateData();
char szFilters[] = "HTML Files (*.html)|*.*|All Files (*.*)|*.*||";
CFileDialog dlg(TRUE, "html","*.html", OFN_NOVALIDATE| OFN_HIDEREADONLY, szFilters, this);
dlg.m_ofn.lpstrTitle = "Select the default web page";
dlg.m_ofn.lpstrInitialDir = m_strWebPages;
if (dlg.DoModal() == IDOK)
{
m_strDefaultPage = dlg.GetFileName();
UpdateData(FALSE);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -