// LogsDlg.cpp : implementation file // #include "stdafx.h" #include "dicomsrv.h" #include "LogsDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern CDICOMSRVApp theApp; ///////////////////////////////////////////////////////////////////////////// // CLogOptionsDlg dialog CLogOptionsDlg::CLogOptionsDlg(CWnd* pParent /*=NULL*/) : CDialog(CLogOptionsDlg::IDD, pParent) { //{{AFX_DATA_INIT(CLogOptionsDlg) m_sLogFolder = _T(""); m_bGenerateEventsLogFile = FALSE; m_bSaveReceivedCSs = FALSE; m_bSaveReceivedDSs = FALSE; m_bSaveSentDSs = FALSE; //}}AFX_DATA_INIT } void CLogOptionsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CLogOptionsDlg) DDX_Text(pDX, IDC_EDIT_LOGFOLDER, m_sLogFolder); DDX_Check(pDX, IDC_CHECK_LOGFILE, m_bGenerateEventsLogFile); DDX_Check(pDX, IDC_CHECK_RECEIVEDCS, m_bSaveReceivedCSs); DDX_Check(pDX, IDC_CHECK_RECEIVEDDS, m_bSaveReceivedDSs); DDX_Check(pDX, IDC_CHECK_SENTDS, m_bSaveSentDSs); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CLogOptionsDlg, CDialog) //{{AFX_MSG_MAP(CLogOptionsDlg) ON_BN_CLICKED(IDC_CHECK_RECEIVEDCS, OnCheckReceivedCS) ON_BN_CLICKED(IDC_CHECK_RECEIVEDDS, OnCheckReceivedDS) ON_BN_CLICKED(IDC_CHECK_SENTDS, OnCheckSentDS) ON_BN_CLICKED(IDC_BUTTON_BROWSE, OnButtonBrowse) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CLogOptionsDlg message handlers BOOL CLogOptionsDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here EnableLogFolderItems(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CLogOptionsDlg::OnCheckReceivedCS() { EnableLogFolderItems(); } void CLogOptionsDlg::OnCheckReceivedDS() { EnableLogFolderItems(); } void CLogOptionsDlg::OnCheckSentDS() { EnableLogFolderItems(); } void CLogOptionsDlg::OnButtonBrowse() { CString sFolder; if (theApp.GetFolder(m_hWnd, sFolder)) { SetDlgItemText(IDC_EDIT_LOGFOLDER, sFolder); } } void CLogOptionsDlg::EnableLogFolderItems() { UpdateData(TRUE); BOOL bEnable = m_bSaveReceivedCSs || m_bSaveReceivedDSs || m_bSaveSentDSs; GetDlgItem(IDC_STATIC_LOGFOLDER)->EnableWindow(bEnable); GetDlgItem(IDC_EDIT_LOGFOLDER)->EnableWindow(bEnable); GetDlgItem(IDC_BUTTON_BROWSE)->EnableWindow(bEnable); }