/* (C) 2003 XDA Developers * Author: Willem Jan Hengeveld * Web: http://www.xda-developers.com/ * * $Header$ */ // bandswitchDlg.cpp : implementation file // #include "stdafx.h" #include "bandswitch.h" #include "bandswitchDlg.h" #include "switcher.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CBandswitchDlg dialog CBandswitchDlg::CBandswitchDlg(CWnd* pParent /*=NULL*/) : CDialog(CBandswitchDlg::IDD, pParent) { //{{AFX_DATA_INIT(CBandswitchDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CBandswitchDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CBandswitchDlg) DDX_Control(pDX, IDC_CURRENT_BAND, m_cCurrentBand); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CBandswitchDlg, CDialog) //{{AFX_MSG_MAP(CBandswitchDlg) ON_BN_CLICKED(IDC_BUTTON_900, OnButton900) ON_BN_CLICKED(IDC_BUTTON_1900, OnButton1900) ON_BN_CLICKED(IDC_BUTTON_900_1800, OnButton9001800) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CBandswitchDlg message handlers BOOL CBandswitchDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CenterWindow(GetDesktopWindow()); // center to the hpc screen // TODO: Add extra initialization here UpdateCurrent(); return TRUE; // return TRUE unless you set the focus to a control } void CBandswitchDlg::UpdateCurrent() { Band current= g_switcher.GetCurrentBand(); CString str; switch(current) { case BAND_900: str= L"900"; break; case BAND_1900: str= L"1900"; break; case BAND_900_1800: str= L"900 / 1800"; break; default: str= L"ERROR"; } m_cCurrentBand.SetWindowText(str); } void CBandswitchDlg::OnButton900() { g_switcher.SwitchTo(BAND_900); UpdateCurrent(); } void CBandswitchDlg::OnButton1900() { g_switcher.SwitchTo(BAND_1900); UpdateCurrent(); } void CBandswitchDlg::OnButton9001800() { g_switcher.SwitchTo(BAND_900_1800); UpdateCurrent(); }