SelectDataDlg.cpp
上传用户:y440e3
上传日期:2010-03-08
资源大小:200k
文件大小:2k
- // SelectDataDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "draw.h"
- #include "drawdoc.h"
- #include "SelectDataDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CSelectDataDlg dialog
- CSelectDataDlg::CSelectDataDlg(CDrawDoc* pDoc,short Index,CWnd* pParent /*=NULL*/)
- : CDialog(CSelectDataDlg::IDD, pParent)
- {
- m_pDoc=pDoc;
- m_Index=Index;
- //{{AFX_DATA_INIT(CSelectDataDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CSelectDataDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CSelectDataDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CSelectDataDlg, CDialog)
- //{{AFX_MSG_MAP(CSelectDataDlg)
- ON_LBN_DBLCLK(IDC_LIST1, OnDblclkList1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CSelectDataDlg message handlers
- void CSelectDataDlg::OnDblclkList1()
- {
- // TODO: Add your control notification handler code here
- CListBox* plist1=(CListBox *)GetDlgItem(IDC_LIST1);
- m_Index=plist1->GetCurSel();
- CDialog::OnOK();
- }
- void CSelectDataDlg::OnOK()
- {
- // TODO: Add extra validation here
- CListBox* plist1=(CListBox *)GetDlgItem(IDC_LIST1);
- m_Index=plist1->GetCurSel();
- CDialog::OnOK();
- }
- BOOL CSelectDataDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- CListBox* plist1=(CListBox *)GetDlgItem(IDC_LIST1);
- plist1->ResetContent();
- for(int i=0;i<m_pDoc->m_NumbData;i++)
- plist1->AddString(m_pDoc->DataInfo[i].Name);
- plist1->SetCurSel(m_Index);
- // TODO: Add extra initialization here
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }