00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #include "stdafx.h" 00007 #include "FdmApp.h" 00008 #include "Dlg_ShutdownType.h" 00009 00010 #ifdef _DEBUG 00011 #define new DEBUG_NEW 00012 #undef THIS_FILE 00013 static char THIS_FILE[] = __FILE__; 00014 #endif 00015 00016 CDlg_ShutdownType::CDlg_ShutdownType(CWnd* pParent ) 00017 : CDialog(CDlg_ShutdownType::IDD, pParent) 00018 { 00019 //{{AFX_DATA_INIT(CDlg_ShutdownType) 00020 00021 //}}AFX_DATA_INIT 00022 00023 m_enType = ST_SHUTDOWN; 00024 m_bRemember = FALSE; 00025 } 00026 00027 void CDlg_ShutdownType::DoDataExchange(CDataExchange* pDX) 00028 { 00029 CDialog::DoDataExchange(pDX); 00030 //{{AFX_DATA_MAP(CDlg_ShutdownType) 00031 DDX_Control(pDX, IDC_TYPE, m_wndShutdownType); 00032 //}}AFX_DATA_MAP 00033 } 00034 00035 BEGIN_MESSAGE_MAP(CDlg_ShutdownType, CDialog) 00036 //{{AFX_MSG_MAP(CDlg_ShutdownType) 00037 //}}AFX_MSG_MAP 00038 END_MESSAGE_MAP() 00039 00040 BOOL CDlg_ShutdownType::OnInitDialog() 00041 { 00042 CDialog::OnInitDialog(); 00043 00044 m_wndShutdownType.AddString (LS (L_SHUTDOWN)); 00045 m_wndShutdownType.AddString (LS (L_RESTARTCOMP)); 00046 m_wndShutdownType.AddString (LS (L_LOGOFF)); 00047 m_wndShutdownType.AddString (LS (L_HIBERNATE)); 00048 m_wndShutdownType.AddString (LS (L_STANDBY)); 00049 m_wndShutdownType.SetCurSel (m_enType); 00050 00051 if (m_bRemember) 00052 CheckDlgButton (IDC_REMEMBER, BST_CHECKED); 00053 00054 SetDlgItemText (IDC_REMEMBER, LS (L_DONTASKAGAIN)); 00055 SetDlgItemText (IDCANCEL, LS (L_CANCEL)); 00056 00057 CString str = LS (L_SHUTDOWNTYPE); 00058 if (str [str.GetLength () - 1] == ':') 00059 str.Delete (str.GetLength () - 1, 1); 00060 SetWindowText (str); 00061 00062 return TRUE; 00063 } 00064 00065 void CDlg_ShutdownType::OnOK() 00066 { 00067 m_enType = (fsShutdownType) m_wndShutdownType.GetCurSel (); 00068 m_bRemember = IsDlgButtonChecked (IDC_REMEMBER) == BST_CHECKED; 00069 00070 CDialog::OnOK(); 00071 }
1.5.6