DlgDeleteFileDBItem.cpp
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:3k
源码类别:
P2P编程
开发平台:
Visual C++
- // DlgDeleteFileDBItem.cpp : implementation file
- //
- #include "stdafx.h"
- #include "testbt.h"
- #include "DlgDeleteFileDBItem.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- const CString CDlgDeleteFileDBItem::m_strSection = "CDlgDeleteFileDBItem";
- /////////////////////////////////////////////////////////////////////////////
- // CDlgDeleteFileDBItem dialog
- CDlgDeleteFileDBItem::CDlgDeleteFileDBItem(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgDeleteFileDBItem::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDlgDeleteFileDBItem)
- m_bDelUncompleted = FALSE;
- m_bDelCompleted = FALSE;
- //}}AFX_DATA_INIT
- }
- void CDlgDeleteFileDBItem::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDlgDeleteFileDBItem)
- DDX_Control(pDX, IDCANCEL, m_btnCancel);
- DDX_Control(pDX, IDOK, m_btnOK);
- DDX_Check(pDX, IDC_CHECK_DEL_UNCOMPLETED, m_bDelUncompleted);
- DDX_Check(pDX, IDC_CHECK_DEL_COMPLETED, m_bDelCompleted);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDlgDeleteFileDBItem, CDialog)
- //{{AFX_MSG_MAP(CDlgDeleteFileDBItem)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgDeleteFileDBItem message handlers
- void CDlgDeleteFileDBItem::LoadState()
- {
- CString strKey = "uncompleted";
- m_bDelUncompleted = AfxGetApp()->GetProfileInt(m_strSection, strKey, m_bDelUncompleted);
- strKey = "completed";
- m_bDelCompleted = AfxGetApp()->GetProfileInt(m_strSection, strKey, m_bDelCompleted);
- }
- void CDlgDeleteFileDBItem::SaveState()
- {
- CString strKey = "uncompleted";
- AfxGetApp()->WriteProfileInt(m_strSection, strKey, m_bDelUncompleted);
- strKey = "completed";
- AfxGetApp()->WriteProfileInt(m_strSection, strKey, m_bDelCompleted);
- }
- BOOL CDlgDeleteFileDBItem::OnInitDialog()
- {
- CDialog::OnInitDialog();
- //
- // Create BitmapList
- //
- HBITMAP hbm = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),
- MAKEINTRESOURCE(IDB_BITMAP_DLG_ICONS),
- IMAGE_BITMAP,
- 0,0, // cx,cy
- LR_CREATEDIBSECTION); // | LR_LOADMAP3DCOLORS );
- CBitmap bm;
- bm.Attach(hbm);
- m_ctlImage.Create(16,15, ILC_COLOR8|ILC_MASK, 3, 4);
- m_ctlImage.SetBkColor(RGB(255, 255,255));
- m_ctlImage.Add(&bm, (COLORREF)RGB(255,0,255));
- //
- // set button image.
- //
- // m_btnBrowseDir.Create(m_ctlImage.ExtractIcon(2), true, "选择保存路径");
- m_btnOK.Create(m_ctlImage.ExtractIcon(0));
- m_btnCancel.Create(m_ctlImage.ExtractIcon(1));
- LoadState();
- UpdateData(false);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CDlgDeleteFileDBItem::OnOK()
- {
- UpdateData();
- SaveState();
- CDialog::OnOK();
- }