www.pudn.com > PBMS.rar > LibDelDlg.cpp
// LibDelDlg.cpp : implementation file
//
#include "stdafx.h"
#include "pbms.h"
#include "LibDelDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLibDelDlg dialog
CLibDelDlg::CLibDelDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLibDelDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLibDelDlg)
m_delbooks = FALSE;
//}}AFX_DATA_INIT
}
void CLibDelDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLibDelDlg)
DDX_Control(pDX, IDC_COMBO1, m_comLibs);
DDX_Check(pDX, IDC_DELBOOKS, m_delbooks);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLibDelDlg, CDialog)
//{{AFX_MSG_MAP(CLibDelDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLibDelDlg message handlers
BOOL CLibDelDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//初始化控件数据
int Item;
for (int i = 0; i < m_saLibsName.GetSize(); i ++)
{
Item = m_comLibs.AddString(m_saLibsName.GetAt(i));
m_comLibs.SetItemData(Item,m_uaLibsID.GetAt(i));
}
m_comLibs.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLibDelDlg::OnOK()
{
//更新数据
UpdateData();
//获取要删除的图书馆ID
m_libID = (int)m_comLibs.GetItemData(m_comLibs.GetCurSel());
CDialog::OnOK();
}