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

📄 myviewbar.cpp

📁 本程序源码是为日本一家地震监测机构编写的
💻 CPP
字号:
// mybar.cpp : implementation file
//

#include "stdafx.h"
#include "CQuakeDemo.h"

#include "myviewbar.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyViewBar

CMyViewBar::CMyViewBar()
{
	m_pInterface = NULL;
}

CMyViewBar::~CMyViewBar()
{
}


BEGIN_MESSAGE_MAP(CMyViewBar, baseCMyBar)
    //{{AFX_MSG_MAP(CMyViewBar)
    ON_WM_CREATE()
    ON_WM_SIZE()
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_INIINTERFACE,OnIniInterface)
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMyViewBar message handlers

int CMyViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
    if (baseCMyBar::OnCreate(lpCreateStruct) == -1)
        return -1;

	m_TabCtrl.Create(TCS_DOWN|WS_CHILD|WS_VISIBLE,CRect(0,0,100,100),this,126);
	///将树型控件加入到TabCtrl中
	m_PageOne.Create(IDD_DLG_PAGE_ONE,&m_TabCtrl);
	m_PageTwo.Create(IDD_DLG_PAGE_TWO,&m_TabCtrl);
	CString str1, str2;
	str1.LoadString(IDS_STRING_PAGEONE_TITLE);
	str2.LoadString(IDS_STRING_PAGETWO_TITLE);
	m_TabCtrl.AddPage(&m_PageOne,str1,IDI_ICON15);
	m_TabCtrl.AddPage(&m_PageTwo,str2,IDI_ICON14);
	m_TabCtrl.UpdateWindow();
    // older versions of Windows* (NT 3.51 for instance)
    // fail with DEFAULT_GUI_FONT
    return 0;
}

void CMyViewBar::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
{
	baseCMyBar::OnUpdateCmdUI(pTarget, bDisableIfNoHndler);
	UpdateDialogControls(pTarget, bDisableIfNoHndler);
}

void CMyViewBar::OnSize(UINT nType, int cx, int cy) 
{
    baseCMyBar::OnSize(nType, cx, cy);
	CRect rc;
    GetClientRect(rc);
	m_TabCtrl.MoveWindow(rc);
}

LRESULT CMyViewBar::OnIniInterface(LPARAM lParam, WPARAM wParam)
{
	m_pInterface = (CControlInterface*)lParam;
	m_PageOne.m_pInterface = m_pInterface;
	m_PageTwo.m_pInterface = m_pInterface;

	m_pInterface->SetPageOnePointer(&m_PageOne);
	m_pInterface->SetPageTwoPointer(&m_PageTwo);
	return NULL;
}

⌨️ 快捷键说明

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