-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtradepanel.h
75 lines (52 loc) · 1.43 KB
/
tradepanel.h
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
74
75
#ifndef _CSMAP_TRADEINFOS
#define _CSMAP_TRADEINFOS
#include "datafile.h"
#include <fx.h>
#include <memory>
#include <vector>
class FXTradePanel : public FXVerticalFrame
{
FXDECLARE(FXTradePanel)
public:
FXTradePanel(FXComposite* p, FXObject* tgt=NULL,FXSelector sel=0, FXuint opts=0, FXint x=0,FXint y=0,FXint w=0,FXint h=0);
void create();
virtual ~FXTradePanel();
void setMapFile(std::shared_ptr<datafile>& f);
public:
long onMapChange(FXObject*,FXSelector,void*);
public:
enum
{
ID_LAST = FXVerticalFrame::ID_LAST
};
protected:
datafile::SelectionState selection;
std::shared_ptr<datafile> mapFile;
// Tradeinfos
struct
{
FXLabel *luxury, *luxuryVolume;
FXLabel *selled, *selledPrice;
FXFrame *matrixsep;
FXHorizontalFrame *matrixframe;
FXMatrix *topmatrix, *leftmatrix, *rightmatrix;
std::vector<FXLabel*> entries;
} tags;
struct Info
{
FXString name, tip;
FXint value;
Info(const FXString& n, const FXString& t, FXint v) : name(n), tip(t), value(v) {}
};
protected:
void clearLabels();
void createLabels(const FXString& name, const FXString& info, int column);
void setInfo(const std::vector<Info>& info);
void addEntry(std::vector<Info>& info, FXString name, int value, FXString tip = "");
void collectData(std::vector<Info>& info, const datablock::itor & region);
void updateData();
protected:
FXTradePanel() {}
FXTradePanel(const FXTradePanel&) {}
};
#endif //_CSMAP_TRADEINFOS