?? phonenavigatordlg.cpp
字號:
/*
Filename : PhoneNavigatorDlg.cpp
Part of : Phone Navigator
Description : Implementation of dialog class of PhoneNavigator
Version : 3.2
This example is only to be used with PC Connectivity API version 3.2.
Compability ("as is") with future versions is not quaranteed.
Copyright (c) 2007 Nokia Corporation.
This material, including but not limited to documentation and any related
computer programs, is protected by intellectual property rights of Nokia
Corporation and/or its licensors.
All rights are reserved. Reproducing, modifying, translating, or
distributing any or all of this material requires the prior written consent
of Nokia Corporation. Nokia Corporation retains the right to make changes
to this material at any time without notice. A copyright license is hereby
granted to download and print a copy of this material for personal use only.
No other license to any other intellectual property rights is granted. The
material is provided "as is" without warranty of any kind, either express or
implied, including without limitation, any warranty of non-infringement,
merchantability and fitness for a particular purpose. In no event shall
Nokia Corporation be liable for any direct, indirect, special, incidental,
or consequential loss or damages, including but not limited to, lost profits
or revenue,loss of use, cost of substitute program, or loss of data or
equipment arising out of the use or inability to use the material, even if
Nokia Corporation has been advised of the likelihood of such damages occurring.
*/
#include "stdafx.h"
#include "PhoneNavigator.h"
#include "PhoneNavigatorDlg.h"
#include "BTPairingDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//===================================================================
// CPhoneNavigatorDlg dialog
//===================================================================
// Constructor
//
//===================================================================
CPhoneNavigatorDlg::CPhoneNavigatorDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPhoneNavigatorDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPhoneNavigatorDlg)
// 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);
}
//===================================================================
// Destructor
//
//===================================================================
CPhoneNavigatorDlg::~CPhoneNavigatorDlg()
{
}
void CPhoneNavigatorDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPhoneNavigatorDlg)
DDX_Control(pDX, IDC_STATIC_PHONE, m_staticPhone);
DDX_Control(pDX, IDC_LIST_PHONES, m_lbPhones);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPhoneNavigatorDlg, CDialog)
//{{AFX_MSG_MAP(CPhoneNavigatorDlg)
ON_BN_CLICKED(IDC_BUTTON_DEVICE_INFO, OnButtonDeviceInfo)
ON_BN_CLICKED(IDC_BUTTON_RENAME, OnButtonRename)
ON_BN_CLICKED(IDC_BUTTON_BT_PAIRING, OnButtonBtPairing)
ON_WM_SYSCOMMAND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//===================================================================
// CPhoneNavigatorDlg message handlers
BOOL CPhoneNavigatorDlg::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
// Initializing phone file list:
m_lbPhones.Init(&m_staticPhone);
return TRUE; // return TRUE unless you set the focus to a control
}
void CPhoneNavigatorDlg::OnOK()
{
// Disabled to prevent closing dialog by pressing enter
}
void CPhoneNavigatorDlg::OnCancel()
{
CDialog::OnCancel();
}
//===================================================================
// OnButtonDeviceInfo
//
// Shows a general device info dialog
//===================================================================
void CPhoneNavigatorDlg::OnButtonDeviceInfo()
{
m_lbPhones.ShowCurrentDeviceInfo();
}
//===================================================================
// OnButtonRename
//
// Renames the selected phone
//===================================================================
void CPhoneNavigatorDlg::OnButtonRename()
{
m_lbPhones.RenameCurrentPhone();
}
//===================================================================
// OnButtonBtPairing
//
// Bluetooth pairing dialog
//===================================================================
void CPhoneNavigatorDlg::OnButtonBtPairing()
{
CBTPairingDlg dlg;
dlg.DoModal();
}
// EOF
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -