home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.funduc.com
/
2014.08.ftp.funduc.com.tar
/
ftp.funduc.com
/
fshedcode-072212.zip
/
AddBookmarkDlg.cpp
next >
Wrap
C/C++ Source or Header
|
2010-09-13
|
3KB
|
99 lines
/////////////////////////////////////////////////////////////////////////////
// License (GPLv2+):
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "fshed.h"
#include "AddBookmarkDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAddBookmarkDlg dialog
CAddBookmarkDlg::CAddBookmarkDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAddBookmarkDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddBookmarkDlg)
m_strName = _T("");
m_strOffset = _T("");
//}}AFX_DATA_INIT
m_nOffset = 0;
}
void CAddBookmarkDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddBookmarkDlg)
//}}AFX_DATA_MAP
DDX_Text(pDX, IDC_OFFSET_ED, m_strOffset);
if (pDX->m_bSaveAndValidate)
{
if (_stscanf(m_strOffset, _T("x%x"), &m_nOffset) == 0)
{
if (_stscanf(m_strOffset, _T("%d"), &m_nOffset) == 0)
{
AfxMessageBox (IDS_ERR_BK_OFFSET);
pDX->Fail();
}
}
}
DDX_Text(pDX, IDC_NAME_ED, m_strName);
if (pDX->m_bSaveAndValidate)
{
if (m_strName.IsEmpty())
{
AfxMessageBox (IDS_ERR_NOBKNAME);
pDX->Fail();
}
}
}
BEGIN_MESSAGE_MAP(CAddBookmarkDlg, CDialog)
//{{AFX_MSG_MAP(CAddBookmarkDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddBookmarkDlg message handlers
BOOL CAddBookmarkDlg::OnInitDialog()
{
m_strOffset.Format(_T("x%x"), m_nOffset);
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CAddBookmarkDlg::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}