www.pudn.com > LECTEUR-MP3.zip > NewDirDlg.cpp


// NewDirDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "MusGest.h" 
#include "NewDirDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// NewDirDlg dialog 
 
 
NewDirDlg::NewDirDlg(CWnd* pParent /*=NULL*/,int iMode /*=0*/, CString strOldName /*= ""*/) 
	: CDialog(NewDirDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(NewDirDlg) 
	//}}AFX_DATA_INIT 
 
	m_iMode = iMode; 
	m_strOldName = strOldName; 
} 
 
 
void NewDirDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(NewDirDlg) 
	DDX_Control(pDX, IDC_STATIC_MODIF, m_Titre); 
	DDX_Control(pDX, IDC_EDIT_NAME, m_Edit); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(NewDirDlg, CDialog) 
	//{{AFX_MSG_MAP(NewDirDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// NewDirDlg message handlers 
 
void NewDirDlg::OnOK()  
{ 
	m_Edit.GetWindowText(m_strName);	 
 
	if (m_strName.IsEmpty()) 
		AfxMessageBox("Vous devez entrez un Nom !"); 
 
	CDialog::OnOK(); 
} 
 
//---------------------------------------------------------------- 
BOOL NewDirDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	if (m_iMode == 1)//Renomer 
	{ 
		m_Titre.SetWindowText("Nouveau nom pour le dossier"); 
		SetWindowText("Modifier un dossier"); 
		m_Edit.SetWindowText(m_strOldName); 
	} 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
}