forked from ennorehling/csmapfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregioninfos.h
85 lines (61 loc) · 1.78 KB
/
regioninfos.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
76
77
78
79
80
81
82
83
84
85
#ifndef _CSMAP_REGIONINFOS
#define _CSMAP_REGIONINFOS
#include <fx.h>
#include <list>
#include <vector>
#include "datafile.h"
class FXRegionInfos : public FXVerticalFrame
{
FXDECLARE(FXRegionInfos)
public:
FXRegionInfos(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 ~FXRegionInfos();
void mapfiles(std::list<datafile> *f);
public:
long onMapChange(FXObject*,FXSelector,void*);
long onToggleDescription(FXObject*,FXSelector,void*);
long onUpdateToggleDescription(FXObject*,FXSelector,void*);
long onUpdateDescription(FXObject*,FXSelector,void*);
public:
enum
{
ID_TOGGLEDESCRIPTION = FXVerticalFrame::ID_LAST,
ID_DESCRIPTION,
ID_LAST
};
protected:
datafile::SelectionState selection;
std::list<datafile> *files;
FXIcon *terrainIcons[datablock::TERRAIN_LAST];
bool show_description;
// Regionsinfos
struct
{
FXLabel *name;
FXFrame *matrixsep;
FXHorizontalFrame *matrixframe;
FXMatrix *leftmatrix, *rightmatrix;
FXFrame *descsep;
FXText *desc;
std::vector<FXLabel*> entries;
}tags;
struct Info
{
FXString name, tip;
FXint value, skill, offset;
Info(const FXString& n, const FXString& t, FXint v, FXint s, FXint o) : name(n), tip(t), value(v), skill(s), offset(o) {}
};
protected:
void clearLabels();
void createLabels(const FXString& name, const FXString& info, const FXString& info2, int column);
void setInfo(const std::list<Info>& info);
void addEntry(std::list<Info>& info, FXString name, int value, int skill, int offset, FXString tip = "");
void clearInfo();
void collectData(std::list<Info>& info, datablock::itor region);
void updateData();
protected:
FXRegionInfos(){}
FXRegionInfos(const FXRegionInfos&) {}
};
#endif //_CSMAP_REGIONINFOS