📄 toptionsdlg.cpp
字号:
/*****************************************************************************/
/* TOptionsDlg.cpp Copyright (c) Ladislav Zezula 2003 */
/*---------------------------------------------------------------------------*/
/* Description : */
/*---------------------------------------------------------------------------*/
/* Date Ver Who Comment */
/* -------- ---- --- ------- */
/* 11.04.03 1.00 Lad The first version of TOptionsDlg.cpp */
/*****************************************************************************/
#include "stdafx.h"
#include "TOptionsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//-----------------------------------------------------------------------------
// TOptionsDlg dialog
BEGIN_MESSAGE_MAP(TOptionsDlg, CDialog)
//{{AFX_MSG_MAP(TOptionsDlg)
ON_BN_CLICKED(IDC_BROWSE1, OnBrowse1)
ON_BN_CLICKED(IDC_BROWSE2, OnBrowse2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
TOptionsDlg::TOptionsDlg(CWnd* pParent /*=NULL*/)
: CDialog(TOptionsDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(TOptionsDlg)
m_strListFileDir = _T("");
m_strWorkDir = _T("");
m_bUseStorm = FALSE;
//}}AFX_DATA_INIT
}
void TOptionsDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(TOptionsDlg)
DDX_Text(pDX, IDC_LISTFILEDIR, m_strListFileDir);
DDV_MaxChars(pDX, m_strListFileDir, 260);
DDX_Text(pDX, IDC_WORKDIR, m_strWorkDir);
DDV_MaxChars(pDX, m_strWorkDir, 260);
DDX_Check(pDX, IDC_USESTORM, m_bUseStorm);
//}}AFX_DATA_MAP
}
int CALLBACK TOptionsDlg::BFFDialogProc(HWND hwnd, UINT message, LPARAM /* lParam */, LPARAM lpData)
{
if(message == BFFM_INITIALIZED)
::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
return 0;
}
void TOptionsDlg::BrowseFolder(UINT nIDEdit)
{
LPITEMIDLIST lpidl;
BROWSEINFO bi;
char szFolder[MAX_PATH] = "";
char szTitle[256] = "";
UpdateData(TRUE);
// LoadString(AfxGetResourceHandle(), IDS_BROWSETITLE, szTitle, sizeof(szTitle) - 1);
GetDlgItemText(nIDEdit, szFolder, sizeof(szFolder));
bi.hwndOwner = m_hWnd; // Set the dialog parent
bi.pidlRoot = NULL; // Set the ROOT directory
bi.pszDisplayName = szFolder; // Set folder to be browsed
bi.lpszTitle = szTitle; // No hint text
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = BFFDialogProc;
bi.lParam = (LPARAM)szFolder;
// bi.iImage = 0; // No image
if((lpidl = SHBrowseForFolder(&bi)) != NULL)
{
SHGetPathFromIDList(lpidl, szFolder);
SetDlgItemText(nIDEdit, szFolder);
}
}
//-----------------------------------------------------------------------------
// TOptionsDlg message handlers
void TOptionsDlg::OnBrowse1()
{
BrowseFolder(IDC_WORKDIR);
}
void TOptionsDlg::OnBrowse2()
{
BrowseFolder(IDC_LISTFILEDIR);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -