用于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.

112 lines
3.4 KiB

5 months ago
/**
* Copyright (C) 2014-2050 SOUI团队
* All rights reserved.
*
* @file SMessageBox.h
* @brief
* @version v1.0
* @author soui
* @date 2014-07-06
*
* Describe
*/
#pragma once
#include <core/shostdialog.h>
#include <helper/SDpiHelper.hpp>
namespace SOUI
{
//下面是几个在msgbox模板中必须指定的ID。
#define NAME_MSGBOX_BTNSWITCH L"btnSwitch" //一个包含3个页面的tabctrl
#define NAME_MSGBOX_TEXT L"msgtext" //文本控件,只需要指定两个坐标
#define NAME_MSGBOX_TITLE L"msgtitle" //标题ID
#define NAME_MSGBOX_ICON L"msgicon" //图标显示控件
#define NAME_MSGBOX_BTN1 L"button1st" //第1个按钮ID,按钮ID在显示时会自动修改为如IDOK,IDCANCEL这样的ID。
#define NAME_MSGBOX_BTN2 L"button2nd" //第2个按钮ID
#define NAME_MSGBOX_BTN3 L"button3rd" //第3个按钮ID
BOOL SOUI_EXP SetMsgTemplate(pugi::xml_node xmlNode);
pugi::xml_node SOUI_EXP GetMsgTemplate();
INT_PTR SOUI_EXP SMessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
/**
* @class SMessageBoxImpl
* @brief
*
* Describe msgbox的消息处理对象msgbox
*/
class SOUI_EXP SMessageBoxImpl:public SHostDialog, public SDpiHandler<SMessageBoxImpl>
{
public:
/**
* SMessageBoxImpl::SMessageBoxImpl
* @brief
*
* Describe
*/
SMessageBoxImpl();
/**
* SMessageBoxImpl::MessageBox
* @brief
* @param HWND hWnd --
* @param LPCTSTR lpText --
* @param LPCTSTR lpCaption --
* @param UINT uType --
*
* Describe
*/
INT_PTR MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
protected:
/**
* OnInitDialog
* @brief MsgBox初始化
* @param HWND wnd -- host窗口句柄
* @param LPARAM lInitParam -- 使
* @return BOOL 使
*
* Describe
*/
BOOL OnInitDialog(HWND wnd, LPARAM lInitParam);
/**
* SMessageBoxImpl::OnSetIcon
* @brief
* @param UINT uType --
* @return BOOL
*
* Describe
*/
virtual BOOL OnSetIcon(UINT uType);
virtual SStringT OnGetButtonText(int nBtnID) const;
/**
* SMessageBoxImpl::OnBtnClick
* @brief
* @param int uID -- ID
*
* Describe
*/
void OnBtnClick(int uID)
{
EndDialog(uID);
}
EVENT_MAP_BEGIN()
EVENT_ID_COMMAND_RANGE(IDOK,IDNO, OnBtnClick)
EVENT_MAP_END()
BEGIN_MSG_MAP_EX(SMessageBoxImpl)
CHAIN_MSG_MAP(SDpiHandler<SMessageBoxImpl>)
MSG_WM_INITDIALOG(OnInitDialog)
CHAIN_MSG_MAP(SHostDialog)
REFLECT_NOTIFICATIONS_EX()
END_MSG_MAP()
};
}//end of namespace