📄 mytabview.cpp
字号:
// MyTabView.cpp: implementation of the CMyTabView class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "mbpc.h"
#include "MyTabView.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMyTabView::CMyTabView()
{
}
CMyTabView::~CMyTabView()
{
}
void CMyTabView::InitTabs(CTabCtrlView *pView)
{
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT | TCIF_IMAGE;
TabCtrlItem.pszText = "DeviceInfo";
TabCtrlItem.iImage = 1;
m_TabCtl.InsertItem( 0, &TabCtrlItem );
TabCtrlItem.pszText = "AnalogInfo";
m_TabCtl.InsertItem( 1, &TabCtrlItem );
TabCtrlItem.pszText = "AnalogValue";
m_TabCtl.InsertItem( 2, &TabCtrlItem );
TabCtrlItem.pszText = "EnergyValue";
m_TabCtl.InsertItem( 3, &TabCtrlItem );
TabCtrlItem.pszText = "Setup";
m_TabCtl.InsertItem( 4, &TabCtrlItem );
TabCtrlItem.pszText = "DO";
m_TabCtl.InsertItem( 5, &TabCtrlItem );
TabCtrlItem.pszText = "Setting";
m_TabCtl.InsertItem( 6, &TabCtrlItem );
TabCtrlItem.pszText = "KeyFun";
m_TabCtl.InsertItem( 7, &TabCtrlItem );
TabCtrlItem.pszText = "Record";
m_TabCtl.InsertItem( 8, &TabCtrlItem );
TabCtrlItem.pszText = "SOEView";
m_TabCtl.InsertItem( 9, &TabCtrlItem );
//Important You must always call the base class
CTabCtrlView::InitTabs(pView);
return;
}
BOOL CMyTabView::HandleTabs(int sel)
{
//The MFC doc/view model expects the
//mainFrame to handle changing view
//so we let the mainframe do it.
CWnd* Wnd = AfxGetMainWnd();
switch(sel)
{
case 0:
Wnd->SendMessage(WM_COMMAND, ID_DEVICEINFO, 0);
break;
case 1:
Wnd->SendMessage(WM_COMMAND, ID_ANALOGINFO, 0);
break;
case 2:
Wnd->SendMessage(WM_COMMAND, ID_ANAVALUE, 0);
break;
case 3:
Wnd->SendMessage(WM_COMMAND, ID_ENERGYVAL,0);
break;
case 4:
Wnd->SendMessage(WM_COMMAND, ID_SETUP,0);
break;
case 5:
Wnd->SendMessage(WM_COMMAND, ID_DOSTATUS,0);
break;
case 6:
Wnd->SendMessage(WM_COMMAND, ID_SETTINGSEC,0);
break;
case 7:
Wnd->SendMessage(WM_COMMAND, ID_KEYFUN,0);
break;
case 8:
Wnd->SendMessage(WM_COMMAND, ID_RECORD,0);
break;
case 9:
Wnd->SendMessage(WM_COMMAND, ID_SOE,0);
break;
default:
ASSERT(0);
return FALSE;
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -