My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
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
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef MAP_VIEW__H
#define MAP_VIEW__H

#include "MapLevel.h"
#include "MapSerialize.h"

#define LAYOUTFILE <Map/MapView.lay>
#include <CtrlCore/lay.h>

#define IMAGECLASS MapViewImg
#define IMAGEFILE <Map/MapView.iml>
#include <Draw/iml_header.h>

class MapView : public WithMapViewLayout<TopWindow>
{
typedef MapView CLASSNAME;

public:
MapView();
virtual ~MapView() {}
virtual void Layout();

virtual void LeftDouble (Point p, dword keyflags);
virtual void LeftDown (Point p, dword keyflags);
virtual void LeftDrag (Point p, dword keyflags);
virtual void LeftUp (Point p, dword keyflags);

virtual void RightDouble(Point p, dword keyflags);
virtual void RightDown (Point p, dword keyflags);
virtual void RightDrag (Point p, dword keyflags);
virtual void RightUp (Point p, dword keyflags);

virtual void MouseMove (Point p, dword keyflags);

virtual void MouseEnter();
virtual void MouseLeave();

void OnLevelUp();
void OnLevelDown();

void OnMoveUp();
void OnMoveDown();
void OnMoveLeft();
void OnMoveRight();

void OnZoomIn();
void OnZoomOut();
void OnZoomSlide();
void UpdateButtons();

void DoSearch(const String& data);
void OnSearch();
void OnSearchClear();

void ShowNavButtons(bool flag = true);
void HideNavButtons() { ShowNavButtons(false); }

void ShowZoomSlider(bool flag = true);
void HideZoomSlider() { ShowZoomSlider(false); }

void ShowLevelsCtrl(bool flag = true);
void HideLevelsCtrl() { ShowLevelsCtrl(false); }

void ShowSearch(bool flag = true);
void HideSearch() { ShowSearch(false); }

bool UpdateLevel(Level& level, int pos, bool editMode = false);
bool LoadMap(Map& map, bool editMode = false);
bool LoadMap(const char* fp, bool editMode = false);

MapView& HighQuality(bool flag = true)
{
for (int i = 0; i < GetLevelCount(); ++i)
GetLevel(i)->HighQuality(flag);
return *this;
}

MapLevel* GetCurrentLevel() { return GetLevel(_level); }
MapLevel* GetLevel(int i)
{
return (i < 0 || i >= GetLevelCount())
? NULL
: &_levels[i];
}

int GetLevelCount() const { return _levels.GetCount(); }
void SetCurrentLevel(int level);

private:
int _level;
bool _drag;
bool _move;
Point _mousePos;

Array<MapLevel> _levels;
};

#endif

Change log

r4180 by Sc0rch on Nov 17, 2011   Diff
MapRender: First release
(FormEditorCommon, FormEditorProperties,
Map, MapBG, MapCommon, MapEditor,
MapRenderTest.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 2333 bytes, 98 lines
Powered by Google Project Hosting