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
#include "PolygonItem.h"
#include "IMapRender.h"

void PolygonItem::StatePerformed(dword state, const String& param)
{
if (state == PERFORM_SEARCH)
{
if (param.IsEmpty() || ToLower(GetName() + GetTags()).Find(ToLower(param)) < 0)
StateOff(STATE_FOUND);
else
StateOn (STATE_FOUND);
}
}

bool PolygonItem::ProcessLeftDown(Point p, dword keyflags)
{
bool sel = Contains(p);

if (sel)
{
_click = GetTopRender()->ViewToScene(p);
StatesOff(STATE_SELECTED);
StateOn(STATE_SELECTED);
}

return sel || IMapItem::ProcessLeftDown(p, keyflags);
}

bool PolygonItem::ProcessLeftUp(Point p, dword keyflags)
{
bool sel = Contains(p);

p = GetTopRender()->ViewToScene(p);

if (sel && !IsNull(_click))
{
if (abs(_click.x - p.x) < 5 && abs(_click.y - p.y) < 5)
WhenClick(this);
}

_click = Null;
return IMapItem::ProcessLeftUp(p, keyflags);
}

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: 905 bytes, 43 lines
Powered by Google Project Hosting