-
Notifications
You must be signed in to change notification settings - Fork 5
/
MyFileDialog.cpp
66 lines (54 loc) · 1.46 KB
/
MyFileDialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// MyFileDialog.cpp : インプリメンテーション ファイル
//
#include "stdafx.h"
#include "charu3.h"
#include "MyFileDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyFileDialog
IMPLEMENT_DYNAMIC(CMyFileDialog, CFileDialog)
CMyFileDialog::CMyFileDialog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd,bool isDispCheck) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
m_nCheck = FALSE;
m_strCheckString = "";
m_isAutoMacro = false;
m_isDispCheck = isDispCheck;
if(isDispCheck)
SetTemplate(0,IDD_CHECKBOX);
}
BEGIN_MESSAGE_MAP(CMyFileDialog, CFileDialog)
//{{AFX_MSG_MAP(CMyFileDialog)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CMyFileDialog::OnInitDialog()
{
CFileDialog::OnInitDialog();
if(m_isDispCheck) {
CButton* pButton = (CButton*)GetDlgItem(IDC_CHECK_MACRO);
if(pButton) {
pButton->SetCheck(m_nCheck);
if(m_nCheck) m_isAutoMacro = true;
else m_isAutoMacro = false;
pButton->SetWindowText(m_strCheckString);
}
}
return TRUE;
}
void CMyFileDialog::OnDestroy()
{
if(m_isDispCheck) {
CButton* pButton = (CButton*)GetDlgItem(IDC_CHECK_MACRO);
if(pButton) {
if(pButton->GetCheck()) m_isAutoMacro = true;
else m_isAutoMacro = false;
}
}
CFileDialog::OnDestroy();
}