home *** CD-ROM | disk | FTP | other *** search
- /*
- SpeedswitchXP V1.4
- - Windows XP CPU Frequency Control for Notebooks -
-
- Copyright(c) 2002-2004 Christian Diefer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2 as
- published by the Free Software Foundation.
-
- 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 "SpeedswitchXP.h"
- #include "CPUData.h"
- #include "PowerCapabilities.h"
- #include "SystemInfo.h"
-
- CCPUData cpuData;
- CPowerCapabilities powerCaps;
-
- // CSystemInfo dialog
-
- IMPLEMENT_DYNAMIC(CSystemInfo, CDialog)
- CSystemInfo::CSystemInfo(CWnd* pParent /*=NULL*/)
- : CDialog(CSystemInfo::IDD, pParent)
- { }
-
- CSystemInfo::~CSystemInfo()
- { }
-
- void CSystemInfo::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_TAB3, tabCtrl);
- DDX_Control(pDX, IDC_UPPERLEFT, m_cUpperLeft);
- DDX_Control(pDX, IDC_LOWERRIGHT, m_cLowerRight);
- }
-
-
- BEGIN_MESSAGE_MAP(CSystemInfo, CDialog)
- ON_NOTIFY(TCN_SELCHANGE, IDC_TAB3, OnTcnSelchangeTab3)
- END_MESSAGE_MAP()
-
-
- // CSystemInfo message handlers
-
- BOOL CSystemInfo::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- TC_ITEM TabCtrlItem;
- TabCtrlItem.mask = TCIF_TEXT;
- TabCtrlItem.pszText = "CPU Data";
- tabCtrl.InsertItem( 0, &TabCtrlItem );
- TabCtrlItem.pszText = "Power capabilities";
- tabCtrl.InsertItem( 1, &TabCtrlItem );
-
- tabs[0] = &cpuData;
- tabs[1] = &powerCaps;
-
- cpuData.Create( IDD_CPUDATA, this );
- powerCaps.Create( IDD_POWERCAPS, this );
-
- cpuData.ShowWindow( SW_SHOW );
- powerCaps.ShowWindow( SW_HIDE );
-
- // calculate overlay window position and size
- RECT r1, r2;
- m_cUpperLeft.GetWindowRect( &r1 );
- ScreenToClient( &r1 );
-
- m_cLowerRight.GetWindowRect( &r2 );
- ScreenToClient( &r2 );
-
- tabs[0]->SetWindowPos( &wndTop, r1.left, r1.top, r2.right-r1.left, r2.bottom-r1.top, SWP_SHOWWINDOW );
-
- for( int i=1; i<2; i++ )
- tabs[i]->SetWindowPos( &wndTop, r1.left, r1.top, r2.right-r1.left, r2.bottom-r1.top, SWP_HIDEWINDOW );
-
- cpuData.UpdateData( FALSE );
- powerCaps.UpdateData( FALSE );
-
- log( "OnInitDialog von Sysinfo zuende" );
-
- return TRUE;
- }
-
- void CSystemInfo::OnTcnSelchangeTab3( NMHDR *pNMHDR, LRESULT *pResult )
- {
- int i = tabCtrl.GetCurSel();
-
- for( int x=0; x<2; x++ )
- tabs[x]->ShowWindow( x==i ? SW_SHOW : SW_HIDE );
-
- *pResult = 0;
- }
-
- void CSystemInfo::OnOK()
- {
- CDialog::OnOK();
- }
-
- void CSystemInfo::setVars()
- {
- cpuData.setVars();
- powerCaps.setVars();
- }
-
-
-