Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

DlgSaveFilterAs.cpp

Go to the documentation of this file.
00001 //
00002 // SaveFilterAsDlg.cpp
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 //
00022 // Author : [email protected]
00023 //
00024 #include "stdafx.h"
00025 #include "Shareaza.h"
00026 #include "DlgSaveFilterAs.h"
00027 #include "DlgFilterSearch.h"
00028 #include "ResultFilters.h"
00029 
00030 // CSaveFilterAsDlg dialog
00031 
00032 CSaveFilterAsDlg::CSaveFilterAsDlg( CWnd* pParent /*=NULL*/ )
00033         : CSkinDialog( CSaveFilterAsDlg::IDD, pParent )
00034         , m_sName( _T( "" ) )
00035 {
00036 }
00037 
00038 CSaveFilterAsDlg::~CSaveFilterAsDlg()
00039 {
00040 }
00041 
00042 void CSaveFilterAsDlg::DoDataExchange(CDataExchange* pDX)
00043 {
00044         CDialog::DoDataExchange(pDX);
00045         DDX_Text( pDX, IDC_NAME, m_sName );
00046 }
00047 
00048 BEGIN_MESSAGE_MAP(CSaveFilterAsDlg, CSkinDialog)
00049         ON_EN_CHANGE(IDC_NAME, OnEnChangeName)
00050 END_MESSAGE_MAP()
00051 
00052 
00053 // CSaveFilterAsDlg message handlers
00054 
00055 void CSaveFilterAsDlg::OnOK()
00056 {
00057         if ( m_sName.IsEmpty() )
00058         {
00059                 CString strMessage;
00060                 LoadString( strMessage, IDS_FILTER_NO_NAME );
00061                 AfxMessageBox( strMessage, MB_OK );
00062                 return;
00063         }
00064         if ( ( (CFilterSearchDlg*)m_pParentWnd)->m_pResultFilters->Search( m_sName ) >= 0 )
00065         {
00066                 CString strFormat, strMessage;
00067                 LoadString( strFormat, IDS_FILTER_REPLACE );
00068                 strMessage.Format( strFormat, (LPCTSTR)m_sName );
00069                 if ( AfxMessageBox( strMessage, MB_ICONQUESTION | MB_YESNO ) == IDNO )
00070                 {
00071                         return;
00072                 }
00073         }
00074         CSkinDialog::OnOK();
00075 }
00076 
00077 
00078 BOOL CSaveFilterAsDlg::OnInitDialog()
00079 {
00080         CSkinDialog::OnInitDialog();
00081 
00082         SkinMe( _T( "CSaveFilterAsDlg" ), IDR_SEARCHFRAME );
00083 
00084         return TRUE;
00085 }
00086 
00087 void CSaveFilterAsDlg::OnEnChangeName()
00088 {
00089         UpdateData(TRUE);
00090 
00091         GetDlgItem( IDOK )->EnableWindow( !m_sName.IsEmpty() );
00092 }

Generated on Thu Dec 15 10:39:39 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2