-
Notifications
You must be signed in to change notification settings - Fork 1
/
regionlist.h
81 lines (57 loc) · 2.05 KB
/
regionlist.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
#ifndef _CSMAP_REGIONLIST
#define _CSMAP_REGIONLIST
#include "datafile.h"
#include "terrain.h"
#include <fx.h>
#include <list>
class FXRegionItem;
class FXRegionList : public FXTreeList
{
FXDECLARE(FXRegionList)
public:
FXRegionList(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 ~FXRegionList();
void setMapFile(std::shared_ptr<datafile>& f);
public:
long onSelected(FXObject*,FXSelector,void*);
long onPopup(FXObject*, FXSelector, void*);
long showPopup(const FXString& label, datablock* block, FXint root_x, FXint root_y);
long onToggleOwnFactionGroup(FXObject*, FXSelector, void*);
long onUpdateOwnFactionGroup(FXObject*, FXSelector, void*);
long onToggleUnitColors(FXObject*,FXSelector,void*);
long onUpdateUnitColors(FXObject*,FXSelector,void*);
long onMapChange(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
bool colorized() const {
return colorized_units;
}
bool isConfirmed(const datablock* block) const;
FXFont* getBoldFont() const { return boldfont; }
public:
enum
{
ID_TOGGLE_UNITCOLORS = FXTreeList::ID_LAST,
ID_TOGGLE_OWNFACTIONGROUP,
ID_LAST
};
protected:
datafile::SelectionState selection;
std::shared_ptr<datafile> mapFile;
FXIcon* terrainIcons[data::TERRAIN_LAST] = {};
FXIcon *green = nullptr, *red = nullptr, *blue = nullptr, *cyan = nullptr, *yellow = nullptr, *orange = nullptr, *gray = nullptr, *black = nullptr;
FXFont *boldfont = nullptr;
bool isConfirmed(const datablock& unit) const;
// rekursivly searches item with userdata=data in treeitem list
FXTreeItem* findTreeItem(FXTreeItem* first, void* data);
bool active_faction_group = false;
bool colorized_units = true;
private:
FXRegionList() {}
FXRegionList(const FXRegionList&) = delete;
void rebuildTree();
FXRegionItem* appendRegion(const datablock *regionPtr);
FXColor getItemColor(const datablock& unit) const;
friend class FXRegionItem;
};
#endif //_CSMAP_REGIONLIST