mrDarker
2025-06-03 0393d1ff2ebc378b3c4cff9b45f72ebc8a4ea516
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "BlButton.h"
 
 
#define ID_MSG_TOOLBAR_BTN_CLICKED        WM_USER + 20368
 
// CTopToolbar ¶Ô»°¿ò
 
class CTopToolbar : public CDialogEx
{
    DECLARE_DYNAMIC(CTopToolbar)
 
public:
    CTopToolbar(CWnd* pParent = NULL);   // ±ê×¼¹¹Ô캯Êý
    virtual ~CTopToolbar();
 
 
public:
    CWnd* GetBtn(UINT nId);
    void SetOperatorBtnText(const char* pszText);
    HMENU GetOperatorMenu();
 
private:
    void Resize();
    void InitBtn(CBlButton& btn, const char* pszIcon1, const char* pszIcon2);
 
private:
    COLORREF m_crBkgnd;
    HBRUSH m_hbrBkgnd;
 
 
private:
    CBlButton m_btnAdd;
    CBlButton m_btnDelete;
    CBlButton m_btnSettings;
    CBlButton m_btnAlarm;
    CBlButton m_btnOperator;
 
 
// ¶Ô»°¿òÊý¾Ý
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_TOP_TOOLBAR };
#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 OnSize(UINT nType, int cx, int cy);
    virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
    afx_msg void OnButtonOperatorMenuClicked(NMHDR* pNMHDR, LRESULT* pResult);
    virtual BOOL PreTranslateMessage(MSG* pMsg);
};