📄 editctrlbase.cpp
字号:
//-----------------------------------------------------------------------------
// (c) 2002 by Basler Vision Technologies
// Section: Vision Components
// Project: BCAM
// $Header: EditCtrlBase.cpp, 2, 02.10.2002 14:31:26, Nebelung, H.$
//-----------------------------------------------------------------------------
/**
\file EditCtrlBase.cpp
\brief implementation of the CEditCtrlBase class.
*/
//////////////////////////////////////////////////////////////////////
#include <atlbase.h>
#include <atlapp.h>
extern CAppModule _Module;
#include <atlwin.h>
#include "math.h"
#include "stdio.h"
#include "limits.h"
#include "EditCtrlBase.h"
//////////////////////////////////////////////////////////////////////
//
CEditCtrlBase::CEditCtrlBase()
{
m_bWantReturn = false;
m_bEscUndos = false;
m_bKillFocus = true;
m_nEditCtrlID = 0;
m_hEditCtrl = NULL;
}
//////////////////////////////////////////////////////////////////////
//
BOOL CEditCtrlBase::SetWindowText( LPCTSTR lpszString )
{
strncpy(m_szWndTxt, lpszString, sizeof(m_szWndTxt)-1);
return CEdit::SetWindowText(lpszString);
}
/**********
* OnGetDlgCode - handler of WM_GETDLGCODE
*
* this handler catches WM_KEYDOWN messages and decides
* if they should be handled by the default implementation
* or by our own WM_KEYDOWN handler
*
* \param uMsg
* \param wParam
* \param lParam
* \param bHandled
*/
LRESULT CEditCtrlBase::OnGetDlgCode(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
LRESULT lRes; // important: call controls default impl of OnGetDlgCode !!!
lRes = CallWindowProc(CEditCtrlBase::m_pfnSuperWindowProc, CEditCtrlBase::m_hWnd, uMsg, wParam, lParam);
// take care: not all calls of 'OnGetDlgCode' will be made with a MSG-Pointer
MSG *pMsg = (MSG *) lParam;
if ( pMsg != NULL )
{
// change the behavior of the control as needed
if ( WM_KEYDOWN == pMsg->message )
{
switch ( LOWORD(pMsg->wParam) )
{
case VK_RETURN: // make sure VK_RETURN isn't handled by the default handler -> my OnKeyDown
if ( m_bWantReturn )
{
// ATLTRACE("CEditCtrlBase::GetDlgCode VK_RETURN\n");
lRes |= DLGC_WANTALLKEYS;
}
break;
case VK_ESCAPE: //
if ( m_bWantReturn && m_bEscUndos )
{
// ATLTRACE("CEditCtrlBase::GetDlgCode VK_ESCAPE\n");
lRes |= DLGC_WANTALLKEYS;
}
break;
} /// switch ( LOWORD(pMsg->wParam) )
} /// if ( WM_KEYDOWN == pMsg->message )
}
// ATLTRACE("CEditCtrlBase::GetDlgCode == %4lx\n", lRes);
return lRes;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -