用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

208 lines
5.5 KiB

5 months ago
/**
* Copyright (C) 2014-2050 SOUI团队
* All rights reserved.
*
* @file SHotKeyCtrl.h
* @brief
* @version v1.0
* @author soui
* @date 2014-07-02
*
* Describe
*/
#pragma once
#include "core/SWnd.h"
#include "core/SAccelerator.h"
namespace SOUI
{
/**
* @class SHotKeyCtrl
* @brief
*
* Describe
*/
class SOUI_EXP SHotKeyCtrl
: public SWindow
, public SAccelerator
{
SOUI_CLASS_NAME(SHotKeyCtrl, L"hotkey")
enum{
Mod_SC = Mod_Shift|Mod_Ctrl,
Mod_SA = Mod_Shift|Mod_Alt,
Mod_CA = Mod_Ctrl|Mod_Alt,
Mod_SCA = Mod_Shift|Mod_Ctrl|Mod_Alt,
};
public:
/**
* SHotKeyCtrl::SHotKeyCtrl
* @brief
*
* Describe
*/
SHotKeyCtrl(void);
/**
* SHotKeyCtrl::~SHotKeyCtrl
* @brief
*
* Describe
*/
virtual ~SHotKeyCtrl(void);
/**
* SHotKeyCtrl::SetRule
* @brief
* @param WORD wInvalidComp --
* @param WORD wModifier --
*
* Describe
*/
void SetRule(WORD wInvalidComp, WORD wModifier);
/**
* SHotKeyCtrl::SetHotKey
* @brief
* @param WORD vKey --
* @param WORD wModifiers --
*
* Describe
*/
void SetHotKey(WORD vKey, WORD wModifiers);
/**
* SHotKeyCtrl::GetHotKey
* @brief
* @param WORD &vKey --
* @param WORD wModifiers --
*
* Describe
*/
void GetHotKey(WORD & vKey,WORD &wModifers);
public:
virtual SStringT GetWindowText(BOOL bRawText = FALSE);
protected:
/**
* SHotKeyCtrl::OnGetDlgCode
* @brief
*
* Describe
*/
virtual UINT OnGetDlgCode()
{
return (SC_WANTALLKEYS|SC_WANTSYSKEY) & (~SC_WANTTAB);
}
/**
* SHotKeyCtrl::OnLButtonDown
* @brief
* @param UINT nFlags --
* @param CPoint point --
*
* Describe
*/
void OnLButtonDown(UINT nFlags,CPoint pt);
/**
* SHotKeyCtrl::OnPaint
* @brief
* @param IRenderTarget *pRT --
*
* Describe
*/
void OnPaint(IRenderTarget *pRT);
/**
* SHotKeyCtrl::OnSetFocus
* @brief
*
* Describe
*/
void OnSetFocus(SWND wndOld);
/**
* SHotKeyCtrl::OnKillFocus
* @brief
*
* Describe
*/
void OnKillFocus(SWND wndFocus);
/**
* SHotKeyCtrl::OnKeyDown
* @brief
* @param UINT nChar --
* @param UINT nRepCnt --
* @param UINT nFlags --
*
* Describe
*/
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
/**
* SHotKeyCtrl::OnKeyUp
* @brief
* @param UINT nChar --
* @param UINT nRepCnt --
* @param UINT nFlags --
*
* Describe
*/
void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
/**
* SHotKeyCtrl::OnSysKeyDown
* @brief
* @param UINT nChar --
* @param UINT nRepCnt --
* @param UINT nFlags --
*
* Describe
*/
void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
/**
* SHotKeyCtrl::OnSysKeyUp
* @brief
* @param UINT nChar --
* @param UINT nRepCnt --
* @param UINT nFlags --
*
* Describe
*/
void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
void UpdateModifier();
void UpdateCaret(IRenderTarget *pRT);
UINT GetTextAlign();
protected:
HRESULT OnAttrInvalidComb(const SStringW & value, BOOL bLoading);
HRESULT OnAttrInvalidModifier(const SStringW & value, BOOL bLoading);
HRESULT OnAttrHotKey(const SStringW & value, BOOL bLoading);
SOUI_ATTRS_BEGIN()
ATTR_CUSTOM(L"invalidComb",OnAttrInvalidComb)
ATTR_CUSTOM(L"invalidModifier",OnAttrInvalidModifier)
ATTR_CUSTOM(L"hotKey",OnAttrHotKey)
SOUI_ATTRS_END()
SOUI_MSG_MAP_BEGIN()
MSG_WM_PAINT_EX(OnPaint)
MSG_WM_LBUTTONDOWN(OnLButtonDown)
MSG_WM_SETFOCUS_EX(OnSetFocus)
MSG_WM_KILLFOCUS_EX(OnKillFocus)
MSG_WM_KEYDOWN(OnKeyDown)
MSG_WM_KEYUP(OnKeyUp)
MSG_WM_SYSKEYDOWN(OnSysKeyDown)
MSG_WM_SYSKEYUP(OnSysKeyUp)
SOUI_MSG_MAP_END()
WORD m_wInvalidComb; /**< 无效的组合键 */
WORD m_wInvalidModifier; /**< 对无效组合键的替换方案,默认方案 */
BOOL m_bInSetting; /**< 正在设置中 */
};
}
//namespace SOUI