PPageTweaks.cpp

00001 /* 
00002  *      Copyright (C) 2003-2005 Gabest
00003  *      http://www.gabest.org
00004  *
00005  *  This Program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2, or (at your option)
00008  *  any later version.
00009  *   
00010  *  This Program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  *  GNU General Public License for more details.
00014  *   
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with GNU Make; see the file COPYING.  If not, write to
00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
00018  *  http://www.gnu.org/copyleft/gpl.html
00019  *
00020  */
00021 
00022 // PPageTweaks.cpp : implementation file
00023 //
00024 
00025 #include "stdafx.h"
00026 #include "mplayerc.h"
00027 #include "PPageTweaks.h"
00028 
00029 // CPPageTweaks dialog
00030 
00031 IMPLEMENT_DYNAMIC(CPPageTweaks, CPPageBase)
00032 CPPageTweaks::CPPageTweaks()
00033         : CPPageBase(CPPageTweaks::IDD, CPPageTweaks::IDD)
00034         , m_fDisabeXPToolbars(FALSE)
00035         , m_fUseWMASFReader(FALSE)
00036         , m_nJumpDistS(0)
00037         , m_nJumpDistM(0)
00038         , m_nJumpDistL(0)
00039         , m_fFreeWindowResizing(TRUE)
00040         , m_fNotifyMSN(TRUE)
00041 {
00042         m_fWMASFReader = SUCCEEDED(CComPtr<IBaseFilter>().CoCreateInstance(
00043                 GUIDFromCString(_T("{187463A0-5BB7-11D3-ACBE-0080C75E246E}")))); // WM ASF Reader
00044 }
00045 
00046 CPPageTweaks::~CPPageTweaks()
00047 {
00048 }
00049 
00050 void CPPageTweaks::DoDataExchange(CDataExchange* pDX)
00051 {
00052         __super::DoDataExchange(pDX);
00053         DDX_Check(pDX, IDC_CHECK3, m_fDisabeXPToolbars);
00054         DDX_Control(pDX, IDC_CHECK3, m_fDisabeXPToolbarsCtrl);
00055         DDX_Check(pDX, IDC_CHECK2, m_fUseWMASFReader);
00056         DDX_Control(pDX, IDC_CHECK2, m_fUseWMASFReaderCtrl);
00057         DDX_Text(pDX, IDC_EDIT1, m_nJumpDistS);
00058         DDX_Text(pDX, IDC_EDIT2, m_nJumpDistM);
00059         DDX_Text(pDX, IDC_EDIT3, m_nJumpDistL);
00060         DDX_Check(pDX, IDC_CHECK1, m_fFreeWindowResizing);
00061         DDX_Check(pDX, IDC_CHECK4, m_fNotifyMSN);
00062 }
00063 
00064 BOOL CPPageTweaks::OnInitDialog()
00065 {
00066         __super::OnInitDialog();
00067 
00068         AppSettings& s = AfxGetAppSettings();
00069 
00070         m_fDisabeXPToolbars = s.fDisabeXPToolbars;
00071         m_fUseWMASFReader = s.fUseWMASFReader;
00072         m_nJumpDistS = s.nJumpDistS;
00073         m_nJumpDistM = s.nJumpDistM;
00074         m_nJumpDistL = s.nJumpDistL;
00075         m_fFreeWindowResizing = s.fFreeWindowResizing;
00076         m_fNotifyMSN = s.fNotifyMSN;
00077 
00078         UpdateData(FALSE);
00079 
00080         return TRUE;  // return TRUE unless you set the focus to a control
00081         // EXCEPTION: OCX Property Pages should return FALSE
00082 }
00083 
00084 BOOL CPPageTweaks::OnApply()
00085 {
00086         UpdateData();
00087 
00088         AppSettings& s = AfxGetAppSettings();
00089 
00090         s.fDisabeXPToolbars = !!m_fDisabeXPToolbars;
00091         s.fUseWMASFReader = !!m_fUseWMASFReader;
00092         s.nJumpDistS = m_nJumpDistS;
00093         s.nJumpDistM = m_nJumpDistM;
00094         s.nJumpDistL = m_nJumpDistL;
00095         s.fFreeWindowResizing = m_fFreeWindowResizing;
00096         s.fNotifyMSN = m_fNotifyMSN;
00097 
00098         return __super::OnApply();
00099 }
00100 
00101 BEGIN_MESSAGE_MAP(CPPageTweaks, CPPageBase)
00102         ON_UPDATE_COMMAND_UI(IDC_CHECK3, OnUpdateCheck3)
00103         ON_UPDATE_COMMAND_UI(IDC_CHECK2, OnUpdateCheck2)
00104         ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
00105 END_MESSAGE_MAP()
00106 
00107 
00108 // CPPageTweaks message handlers
00109 
00110 void CPPageTweaks::OnUpdateCheck3(CCmdUI* pCmdUI)
00111 {
00112         if(!AfxGetAppSettings().fXpOrBetter)
00113         {
00114                 pCmdUI->Enable(FALSE);
00115                 pCmdUI->SetCheck(TRUE);
00116         }
00117 }
00118 
00119 void CPPageTweaks::OnUpdateCheck2(CCmdUI* pCmdUI)
00120 {
00121         pCmdUI->Enable(m_fWMASFReader);
00122 }
00123 
00124 void CPPageTweaks::OnBnClickedButton1()
00125 {
00126         m_nJumpDistS = 1000;
00127         m_nJumpDistM = 5000;
00128         m_nJumpDistL = 20000;
00129 
00130         UpdateData(FALSE);
00131 }
00132 
00133 

Generated on Tue Dec 13 14:47:02 2005 for guliverkli by  doxygen 1.4.5