mrDarker
2025-10-22 e8a27bb203fe2aff70390a5eca002d7438da9b0f
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
#pragma once
#include "afxdialogex.h"
#include "GridCtrl.h"
#include "CBaseDlg.h"
#include "BLLabel.h"
 
 
// CRecipeListDlg 对话框
 
class CRecipeListDlg : public CBaseDlg
{
    DECLARE_DYNAMIC(CRecipeListDlg)
 
public:
    CRecipeListDlg(CWnd* pParent = nullptr);   // 标准构造函数
    virtual ~CRecipeListDlg();
 
// 对话框数据
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_DIALOG_RECIPE_LIST };
#endif
 
private:
    //CFont* GetOrCreateFont(int nFontSize);
    //void AdjustControls(float dScaleX, float dScaleY);
    //void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
    void AdjustLabelFont(CBLLabel& label);
    void InitRecipeLise();
    void FillRecipeLise();
    void UpdateDataFile(const CString& strRecipeName, const CString& strNewDescription);
 
private:
    //int m_nInitialWidth;
    //int m_nInitialHeight;
    //std::map<int, CFont*> m_mapFonts;        // 字体映射
    //std::map<int, CRect> m_mapCtrlLayouts;    // 控件布局映射
 
    // 控件
    CBLLabel* m_staticCurrRecipe;
    CGridCtrl m_grid;
 
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
    virtual BOOL OnInitDialog();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnBnClickedButtonCreateRecipe();
    afx_msg void OnBnClickedButtonDeleteRecipe();
    afx_msg void OnBnClickedButtonSelectRecipe();
    afx_msg void OnGridCellEditFinished(NMHDR* pNotifyStruct, LRESULT* pResult);
    DECLARE_MESSAGE_MAP()
};