Back to index

lightning-sunbird  0.9+nobinonly
Preferences.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: Mozilla-sample-code 1.0
00004  *
00005  * Copyright (c) 2002 Netscape Communications Corporation and
00006  * other contributors
00007  *
00008  * Permission is hereby granted, free of charge, to any person obtaining a
00009  * copy of this Mozilla sample software and associated documentation files
00010  * (the "Software"), to deal in the Software without restriction, including
00011  * without limitation the rights to use, copy, modify, merge, publish,
00012  * distribute, sublicense, and/or sell copies of the Software, and to permit
00013  * persons to whom the Software is furnished to do so, subject to the
00014  * following conditions:
00015  *
00016  * The above copyright notice and this permission notice shall be included
00017  * in all copies or substantial portions of the Software.
00018  *
00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00020  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00021  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00022  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00023  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00024  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00025  * DEALINGS IN THE SOFTWARE.
00026  *
00027  * Contributor(s):
00028  *   Chak Nanga <chak@netscape.com>
00029  *
00030  * ***** END LICENSE BLOCK ***** */
00031 
00032 #include "stdafx.h"
00033 #include "Preferences.h"
00034 
00035 #ifdef _DEBUG
00036 #define new DEBUG_NEW
00037 #undef THIS_FILE
00038 static char THIS_FILE[] = __FILE__;
00039 #endif
00040 
00042 // CPreferences
00043 
00044 IMPLEMENT_DYNAMIC(CPreferences, CPropertySheet)
00045 
00046 CPreferences::CPreferences(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
00047     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
00048 {
00049     AddPage(&m_startupPage);
00050 }
00051 
00052 CPreferences::~CPreferences()
00053 {
00054 }
00055 
00056 BEGIN_MESSAGE_MAP(CPreferences, CPropertySheet)
00057     //{{AFX_MSG_MAP(CPreferences)
00058         // NOTE - the ClassWizard will add and remove mapping macros here.
00059     //}}AFX_MSG_MAP
00060 END_MESSAGE_MAP()
00061 
00062 
00063 BOOL CPreferences::OnInitDialog() 
00064 {
00065     BOOL bResult = CPropertySheet::OnInitDialog();
00066     
00067     // Hide the Apply button
00068     CWnd* pApplyButton = GetDlgItem(ID_APPLY_NOW);
00069     ASSERT(pApplyButton);
00070     pApplyButton->ShowWindow(SW_HIDE);
00071 
00072     return bResult;
00073 }
00074 
00075 
00077 // CStartupPrefsPage property page
00078 
00079 IMPLEMENT_DYNCREATE(CStartupPrefsPage, CPropertyPage)
00080 
00081 CStartupPrefsPage::CStartupPrefsPage() : CPropertyPage(CStartupPrefsPage::IDD)
00082 {
00083     //{{AFX_DATA_INIT(CStartupPrefsPage)
00084     m_strHomePage = _T("");
00085     m_iStartupPage = -1;
00086     //}}AFX_DATA_INIT
00087 }
00088 
00089 CStartupPrefsPage::~CStartupPrefsPage()
00090 {
00091 }
00092 
00093 void CStartupPrefsPage::DoDataExchange(CDataExchange* pDX)
00094 {
00095     CPropertyPage::DoDataExchange(pDX);
00096     //{{AFX_DATA_MAP(CStartupPrefsPage)
00097     DDX_Control(pDX, IDC_EDIT_HOMEPAGE, m_HomePage);
00098     DDX_Text(pDX, IDC_EDIT_HOMEPAGE, m_strHomePage);
00099     DDX_Radio(pDX, IDC_RADIO_BLANK_PAGE, m_iStartupPage);
00100     //}}AFX_DATA_MAP
00101 }
00102 
00103 
00104 BEGIN_MESSAGE_MAP(CStartupPrefsPage, CPropertyPage)
00105     //{{AFX_MSG_MAP(CStartupPrefsPage)
00106     //}}AFX_MSG_MAP
00107 END_MESSAGE_MAP()