00001 // 00002 // PageProfileBio.cpp : implementation file 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 #include "StdAfx.h" 00023 #include "Shareaza.h" 00024 #include "GProfile.h" 00025 #include "XML.h" 00026 #include "PageProfileBio.h" 00027 00028 #ifdef _DEBUG 00029 #define new DEBUG_NEW 00030 #undef THIS_FILE 00031 static char THIS_FILE[] = __FILE__; 00032 #endif 00033 00034 IMPLEMENT_DYNCREATE(CBioProfilePage, CSettingsPage) 00035 00036 BEGIN_MESSAGE_MAP(CBioProfilePage, CSettingsPage) 00037 //{{AFX_MSG_MAP(CBioProfilePage) 00038 //}}AFX_MSG_MAP 00039 END_MESSAGE_MAP() 00040 00041 00043 // CBioProfilePage property page 00044 00045 CBioProfilePage::CBioProfilePage() : CSettingsPage( CBioProfilePage::IDD ) 00046 { 00047 //{{AFX_DATA_INIT(CBioProfilePage) 00048 //}}AFX_DATA_INIT 00049 } 00050 00051 CBioProfilePage::~CBioProfilePage() 00052 { 00053 } 00054 00055 void CBioProfilePage::DoDataExchange(CDataExchange* pDX) 00056 { 00057 CSettingsPage::DoDataExchange(pDX); 00058 //{{AFX_DATA_MAP(CBioProfilePage) 00059 DDX_Control(pDX, IDC_PROFILE_BIO, m_wndText); 00060 //}}AFX_DATA_MAP 00061 } 00062 00064 // CBioProfilePage message handlers 00065 00066 BOOL CBioProfilePage::OnInitDialog() 00067 { 00068 CSettingsPage::OnInitDialog(); 00069 00070 if ( CXMLElement* pNotes = MyProfile.GetXML( _T("notes") ) ) 00071 { 00072 m_wndText.SetWindowText( pNotes->GetValue() ); 00073 } 00074 00075 UpdateData( FALSE ); 00076 00077 return TRUE; 00078 } 00079 00080 void CBioProfilePage::OnOK() 00081 { 00082 if ( CXMLElement* pNotes = MyProfile.GetXML( _T("notes"), TRUE ) ) 00083 { 00084 CString str; 00085 m_wndText.GetWindowText( str ); 00086 00087 if ( str.GetLength() ) 00088 pNotes->SetValue( str ); 00089 else 00090 pNotes->Delete(); 00091 } 00092 00093 CSettingsPage::OnOK(); 00094 }