⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bthset.cpp

📁 EVC环境
💻 CPP
字号:
// BthSet.cpp : implementation file
//

#include "stdafx.h"
#include "FlightQuery.h"
#include "BthSet.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBthSet

IMPLEMENT_DYNCREATE(CBthSet, CFormView)

CBthSet::CBthSet()
	: CFormView(CBthSet::IDD)
{
	//{{AFX_DATA_INIT(CBthSet)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

CBthSet::~CBthSet()
{
}

void CBthSet::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBthSet)
	DDX_Control(pDX, IDC_TAB1, m_tabbth);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBthSet, CFormView)
	//{{AFX_MSG_MAP(CBthSet)
	ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
	ON_NOTIFY(NM_CLICK, IDC_TAB1, OnClickTab1)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBthSet diagnostics

#ifdef _DEBUG
void CBthSet::AssertValid() const
{
	CFormView::AssertValid();
}

void CBthSet::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CBthSet message handlers

void CBthSet::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here

	m_Page1.ShowWindow(SW_HIDE);
	m_Page2.ShowWindow(SW_HIDE);
	m_Page3.ShowWindow(SW_HIDE);
	
	switch(m_tabbth.GetCurSel()) //获取当前被选中的序号
	{
		case 0:
			m_Page1.ShowWindow(SW_SHOW);
			break;
		case 1:
			m_Page2.ShowWindow(SW_SHOW);
			break;
		case 2:
			m_Page3.ShowWindow(SW_SHOW);
			break;
		

	}

	*pResult = 0;
}

void CBthSet::OnClickTab1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	
	*pResult = 0;
}

void CBthSet::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CRect r;
	m_tabbth.GetClientRect (&r);

	TCITEM tcItem1;
	TCITEM tcItem2;
	TCITEM tcItem3;

	tcItem1.mask = TCIF_TEXT;
	tcItem1.pszText = _T("蓝牙属性");
	tcItem1.cchTextMax=100;

	tcItem2.mask = TCIF_TEXT;
	tcItem2.pszText = _T("文件传输");
	tcItem2.cchTextMax=100;

	tcItem3.mask = TCIF_TEXT;
	tcItem3.pszText = _T("关于");
	tcItem3.cchTextMax=100;


	m_tabbth.InsertItem(0,&tcItem1);
	m_tabbth.InsertItem(1,&tcItem2);
	m_tabbth.InsertItem(2,&tcItem3);

//	m_sheet.AddPage("tab1", &m_page1, IDD_DIALOG1);
//	m_sheet.AddPage("tab2", &m_page2, IDD_DIALOG2);
//	m_sheet.Show();

	m_Page1.Create(IDD_DIALOG1,&m_tabbth);
	m_Page2.Create(IDD_DIALOG2,&m_tabbth);
	m_Page3.Create(IDD_DIALOG3,&m_tabbth);

	m_Page1.ShowWindow(SW_SHOW); //默认只显示一页
	m_Page2.ShowWindow(SW_HIDE);
	m_Page3.ShowWindow(SW_HIDE);

	m_Page1.SetWindowPos (NULL,5,5,r.right -20,r.bottom -40,SWP_SHOWWINDOW);
	m_Page2.SetWindowPos (NULL,5,5,r.right -20,r.bottom -40,SWP_HIDEWINDOW); 
	m_Page3.SetWindowPos (NULL,5,5,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
}

void CBthSet::OnSize(UINT nType, int cx, int cy) 
{
	CFormView::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
//	CView::OnSize(nType, cx, cy);

//	if (m_tabbth.GetSafeHwnd())
//	m_tabbth.MoveWindow(10, 5, );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -