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
#ifndef FORM_EDITOR_PROPERTIES__PROPERTIES_MACRO_H
#define FORM_EDITOR_PROPERTIES__PROPERTIES_MACRO_H

///////////////////////////////////////////////////////////////////////////////////////////////
// Properties declaration macros
///////////////////////////////////////////////////////////////////////////////////////////////

#define PROPS_INIT_PROPERTIES virtual void InitProperties() \
{

#define PROPS_INIT_PROPERTIES_END \
}

#define PROPS_DEFINE_PROPERTY(MethodSet, MethodGet) \
GetProperties().Add().SetCalls(THISBACK(PropSet##MethodSet), THISBACK(PropGet##MethodGet)) \
PROPS_SET_NAME(#MethodSet)PROPS_GET_NAME(#MethodGet)

// Meta info for property
#define PROPS_SET_NAME(Name) .AddMetaInfo("SetMethodName", Name)
#define PROPS_GET_NAME(Name) .AddMetaInfo("GetMethodName", Name)
#define PROPS_GROUP(Group) .AddMetaInfo("Group", Group)
#define PROPS_NAME(Name) .AddMetaInfo("Name", Name)
#define PROPS_HINT(Hint) .AddMetaInfo("Hint", Hint)
#define PROPS_DEFAULT(Default) .SetDefault(Default)
#define PROPS_TYPE(EditType, Notify) .SetEdit(new EditType, Notify)

// Ends property description
#define PROPS_PROPERTY_END \
;

///////////////////////////////////////////////////////////////////////////////////////////////
// Properties implementation macros
///////////////////////////////////////////////////////////////////////////////////////////////

#define PROPS_METHOD_SET(MethodName, ...) \
void PropSet##MethodName(const Vector<Value>& args) \
{ \
SProperty c(args); \
PropertyCaller<CLASSNAME, __VA_ARGS__>::call(*this, &CLASSNAME::MethodName, c); \
}

#define PROPS_METHOD_GET(MethodName, ...) \
void PropGet##MethodName(Value& v, const Vector<Value>& args) \
{ \
SProperty c(args); \
PropertyCaller<CLASSNAME, __VA_ARGS__>::call(*this, &CLASSNAME::MethodName, c); \
v = c.Return; \
}

#define PROPS_CLASS_METHOD_SET(ClassName, MethodName, ...) \
void PropSet##MethodName(const Vector<Value>& args) \
{ \
SProperty c(args); \
PropertyCaller<ClassName, __VA_ARGS__>::call(GetCtrl(), &ClassName::MethodName, c); \
}

#define PROPS_CLASS_METHOD_GET(ClassName, MethodName, ...) \
void PropGet##MethodName(Value& v, const Vector<Value>& args) \
{ \
SProperty c(args); \
PropertyCaller<ClassName, __VA_ARGS__>::call(GetCtrl(), &ClassName::MethodName, c); \
v = c.Return; \
}

#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: 2453 bytes, 65 lines
Powered by Google Project Hosting