#pragma once
|
#include "afxwin.h"
|
#include "AlarmManager.h"
|
#include "Common.h"
|
#include "ToolUnits.h"
|
#include "BlButton.h"
|
|
// 简化版报警弹窗,对接 AlarmManager 的活跃告警
|
class CAlarmPopupDlg : public CDialogEx
|
{
|
DECLARE_DYNAMIC(CAlarmPopupDlg)
|
|
public:
|
CAlarmPopupDlg(CWnd* pParent = NULL);
|
virtual ~CAlarmPopupDlg();
|
|
public:
|
void RefreshContent(); // 刷新当前告警显示
|
|
private:
|
COLORREF m_crBkgnd;
|
HBRUSH m_hbrBkgnd;
|
CFont m_fontTitle;
|
CFont m_fontLevel;
|
CFont m_fontName;
|
CFont m_fontDescription;
|
CBlButton m_btnClose;
|
CBlButton m_btnSoundOff;
|
CBlButton m_btnAlarmOff;
|
|
// 对话框数据
|
#ifdef AFX_DESIGN_TIME
|
enum { IDD = IDD_DIALOG_POPUP_ALARM };
|
#endif
|
|
protected:
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
|
DECLARE_MESSAGE_MAP()
|
public:
|
virtual BOOL OnInitDialog();
|
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
afx_msg void OnDestroy();
|
afx_msg void OnBnClickedClose();
|
afx_msg void OnBnClickedAlarmOff();
|
|
private:
|
bool m_hasActive;
|
AlarmData m_activeAlarm;
|
void SetButtonBackgroundColors(bool bMute);
|
void ShowNoAlarmControls(bool bShow);
|
void ShowAlarmControls(bool bShow);
|
};
|