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

📄 sttbar.cpp

📁 这是本人帮别人做的万能试验机数据吹系统(部分)
💻 CPP
字号:
// StTbar.cpp : implementation file
//

#include "stdafx.h"
#include "WJC.h"
#include "StTbar.h"


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

/////////////////////////////////////////////////////////////////////////////
// CStTbar

CStTbar::CStTbar()
{
}

CStTbar::~CStTbar()
{
}


BEGIN_MESSAGE_MAP(CStTbar, CStatic)
	//{{AFX_MSG_MAP(CStTbar)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CStTbar message handlers
void CStTbar::OnDestroy() 
{
	// nothing to clean
	CStatic::OnDestroy();
}

void CStTbar::PreTranslate(MSG* pMsg)
{
	// forward this to the toolbar
	// 
	if(m_wndMyDialogBar.IsWindowVisible())
			m_wndMyDialogBar.OnUpdateCmdUI(m_minifrm,TRUE);
}
void CStTbar::PreSubclassWindow() 
{

	CStatic::PreSubclassWindow();

	RECT rt; GetWindowRect(&rt);
	GetParent()->ScreenToClient(&rt);

	// hide the place holder, no not destro it I need it to rerout the messages
	ShowWindow(SW_HIDE);
	m_minifrm = new CSzMiniFrm();
	m_minifrm->Create( AfxRegisterWndClass(0,0,0),
				"",WS_VISIBLE|WS_CHILD,rt,GetParent()/*of placeholder*/);
    {
		// Initialize dialog bar m_wndMyDialogBar
		if (!m_wndMyDialogBar.Create(m_minifrm, GetDlgCtrlID(),
			CBRS_RIGHT | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_HIDE_INPLACE,
			CG_ID_VIEW_MYDIALOGBAR))
		{
			TRACE0("Failed to create dialog bar m_wndMyDialogBar\n");
			return;		// fail to create
		}

		m_wndMyDialogBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);
		m_minifrm->EnableDocking(CBRS_ALIGN_ANY);
		if(rt.right-rt.left > rt.bottom-rt.top)
			m_minifrm->DockControlBar(&m_wndMyDialogBar,CBRS_ALIGN_LEFT);	
		else
			// dock verically
			m_minifrm->DockControlBar(&m_wndMyDialogBar,CBRS_ALIGN_RIGHT);
		m_minifrm->RecalcLayout();
//		m_minifrm->DockControlBar(&m_wndMyDialogBar);

	}	

}

////////////////////////////////////////////////////////////////////////////
// CSzMiniFrm class implementation

CSzMiniFrm::CSzMiniFrm(){}
CSzMiniFrm::~CSzMiniFrm(){}
BEGIN_MESSAGE_MAP(CSzMiniFrm, CMiniFrameWnd)
	//{{AFX_MSG_MAP(CMyMiniFrm)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyMiniFrm message handlers
BOOL CSzMiniFrm::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
{
	// pass those up in the dialog to leave the OnUpdateUI mechanism to flow
	BOOL br = GetParent()->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
	// leave the default proc to handles the tooltip updating mechanism
	CMiniFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
	return br;	// return what the parent returns
}

⌨️ 快捷键说明

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