admin
2025-04-08 5c9991be21f57781573f04961ec511ac2938ea3d
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include<list>
#include<string>
#include <gdiplus.h>
using namespace Gdiplus;
using namespace std;
#include <mutex>
 
// DealQueueDlg 对话框
struct DealQueueInfo {
    int type;// 0-买入  1-卖出
    int orderNo; // 订单号
    string time_str;
    int volume;
    int money;
    string price;
    int percent;
};
 
 
class DealQueueDlg : public CDialogEx
{
    DECLARE_DYNAMIC(DealQueueDlg)
 
private:
    list<DealQueueInfo> dealQueueList;
    string code;
    bool windowClosed;
    Gdiplus::Graphics* m_pGraphics;
    Gdiplus::Pen m_Pen;
    Gdiplus::LinearGradientBrush *m_BackBrush;
    Gdiplus::LinearGradientBrush *m_ProgressBrush;
    Gdiplus::GraphicsPath m_Path;
    Gdiplus::GraphicsPath m_ProgressPath;
    Gdiplus::REAL m_CornerRadius;
    std::mutex mtx; // 互斥锁
    int minMoney;
 
    void AddRoundRect(Gdiplus::GraphicsPath& path, Gdiplus::REAL x, Gdiplus::REAL y, Gdiplus::REAL width, Gdiplus::REAL height, Gdiplus::REAL radius);
 
 
public:
    DealQueueDlg( CWnd* pParent = nullptr);   // 标准构造函数
    virtual ~DealQueueDlg();
    void setTargetCode(string code);
 
// 对话框数据
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_DIALOG_DEAL_QUEUE };
#endif
 
private:
    static void startRequestDealQueueTask( DealQueueDlg *context);
 
    static void requestDealQueue(DealQueueDlg* context);
 
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
 
    DECLARE_MESSAGE_MAP()
public:
    virtual BOOL OnInitDialog();
    CListCtrl listCtrl;
    afx_msg void OnItemchangedListDealQueue(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnClose();
    afx_msg void OnCustomdrawListDealQueue(NMHDR* pNMHDR, LRESULT* pResult);
 
    void InitializeGDIPlus();
    void CleanupGDIPlus();
    CEdit editMinMoney;
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    afx_msg void OnChangeEditMinMoney();
};