📄 dialogview.h
字号:
//-----------------------------------------------------------------------------
// (c) 2002 by Basler Vision Technologies
// Section: Vision Components
// Project: BCAM
// $Header: DialogView.h, 4, 02.10.2002 14:31:26, Nebelung, H.$
//-----------------------------------------------------------------------------
/**
\file DialogView.h
*
* \brief implementation of class CDialogView
*
*/
//-----------------------------------------------------------------------------
#if !defined(AFX_DIALOGVIEW_H__20010419_45AA_056A_8DC7_0080AD509054__INCLUDED_)
#define AFX_DIALOGVIEW_H__20010419_45AA_056A_8DC7_0080AD509054__INCLUDED_
#pragma once
//------------------------------------------------------------------------------
// class CDialogView
// Author:
//------------------------------------------------------------------------------
/**
* \brief Base class for the bus view window, and the feature control windows
*
*/
//------------------------------------------------------------------------------
template<class T, class TBase = CWindow>
class CDialogView : public CDialogImpl<T, TBase>
{
public:
HWND m_hWndFocus;
BEGIN_MSG_MAP(CDialogView)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
END_MSG_MAP()
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
ATLASSERT(GetStyle() & WS_CHILD);
ModifyStyle(WS_BORDER|WS_CAPTION, 0);
ShowWindow(SW_NORMAL);
bHandled = FALSE;
return 0;
}
LRESULT OnKillFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
HWND hWndFocus = ::GetFocus();
if( hWndFocus!=NULL && IsChild(hWndFocus) ) m_hWndFocus = hWndFocus;
return 0;
}
LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
// Set focus to last known control
if( !::IsWindow(m_hWndFocus) || !IsChild(m_hWndFocus) ) {
bHandled = FALSE;
return 0;
}
::SetFocus(m_hWndFocus);
return 0;
}
virtual BOOL PreTranslateMessage(MSG* pMsg)
{
HWND hWndFocus = ::GetFocus();
if( hWndFocus==NULL || !IsChild(hWndFocus) ) return FALSE;
if( GetWindow(GW_CHILD)==NULL ) return FALSE;
if( IsDialogMessage(pMsg) ) return TRUE;
return FALSE;
}
};
#endif // !defined(AFX_DIALOGVIEW_H__20010419_45AA_056A_8DC7_0080AD509054__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -