home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.funduc.com
/
2014.08.ftp.funduc.com.tar
/
ftp.funduc.com
/
fshedcode-072212.zip
/
RemoveBookmarkDlg.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2011-01-27
|
3KB
|
105 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 "RemoveBookmarkDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRemoveBookmarkDlg dialog
CRemoveBookmarkDlg::CRemoveBookmarkDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRemoveBookmarkDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRemoveBookmarkDlg)
//}}AFX_DATA_INIT
m_nSelBookmark = -1;
m_pbmkRemove = NULL;
m_nNumBookmarks = 0;
m_uWindowTitle = 0;
}
void CRemoveBookmarkDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRemoveBookmarkDlg)
DDX_Control(pDX, IDC_LIST1, m_listBookmarks);
//}}AFX_DATA_MAP
if (pDX->m_bSaveAndValidate)
{
m_nSelBookmark = m_listBookmarks.GetCurSel();
if (m_nSelBookmark == LB_ERR)
{
AfxMessageBox(IDS_ERR_SELBK2DEL);
pDX->Fail();
}
}
}
BEGIN_MESSAGE_MAP(CRemoveBookmarkDlg, CDialog)
//{{AFX_MSG_MAP(CRemoveBookmarkDlg)
ON_LBN_DBLCLK(IDC_LIST1, OnDblclklist)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRemoveBookmarkDlg message handlers
BOOL CRemoveBookmarkDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString strLine;
for (int i = 0; i < m_nNumBookmarks; i++)
{
if (m_pbmkRemove[i].name == NULL)
strLine.Format(_T("%d) 0x%x"), i+1, m_pbmkRemove[i].offset);
else
strLine.Format(_T("%d) 0x%x:%s"), i+1, m_pbmkRemove[i].offset, m_pbmkRemove[i].name);
m_listBookmarks.AddString(strLine);
}
if (m_uWindowTitle)
{
strLine.LoadString(m_uWindowTitle);
SetWindowText(strLine);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CRemoveBookmarkDlg::OnDblclklist()
{
OnOK();
}
void CRemoveBookmarkDlg::OnOK()
{
m_nSelBookmark = m_listBookmarks.GetCurSel();
CDialog::OnOK();
}