SpaceConvDlg.cpp
上传用户:hell82222
上传日期:2013-12-19
资源大小:1872k
文件大小:2k
- // SpaceConvDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "SpaceConvDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CSpaceConvDlg dialog
- CSpaceConvDlg::CSpaceConvDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CSpaceConvDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CSpaceConvDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- m_pTitle=NULL;
- }
- CSpaceConvDlg::~CSpaceConvDlg()
- {
- for(int i=0;i<m_pItems.GetSize();i++)
- {
- delete m_pItems[i];
- }
- m_pItems.RemoveAll();
- if(m_pTitle!=NULL)
- {
- delete m_pTitle;
- }
- }
- void CSpaceConvDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CSpaceConvDlg)
- DDX_Control(pDX, IDC_SPACE, m_ctrlSpace);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CSpaceConvDlg, CDialog)
- //{{AFX_MSG_MAP(CSpaceConvDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CSpaceConvDlg message handlers
- BOOL CSpaceConvDlg::OnInitDialog()
- {
- if(m_strSpaceNames.GetSize()!=m_strSpaceFiles.GetSize())
- {
- return FALSE;
- }
- CDialog::OnInitDialog();
- m_pTitle=new CPropertyItem("空间名称","转换后的文件名",PIT_EDIT_READONLY,"");
- m_ctrlSpace.AddPropItem(m_pTitle);
- CPropertyItem* pPropertyItem=NULL;
- for(int i=0;i<m_strSpaceNames.GetSize();i++)
- {
- pPropertyItem=new CPropertyItem(m_strSpaceNames[i],m_strSpaceFiles[i],PIT_FILE_SAVEAS,"");
- m_ctrlSpace.AddPropItem(pPropertyItem);
- m_pItems.Add(pPropertyItem);
- }
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CSpaceConvDlg::OnOK()
- {
- m_iCur=m_ctrlSpace.GetListCurSel();
- if(m_strSpaceNames.GetSize()!=m_strSpaceFiles.GetSize())
- {
- return ;
- }
- if(m_strSpaceNames.GetSize()!=m_pItems.GetSize())
- {
- return ;
- }
- for(int i=0;i<m_strSpaceNames.GetSize();i++)
- {
- m_strSpaceFiles[i]=m_pItems[i]->m_curValue;
- }
- CDialog::OnOK();
- }