forked from enlightenment/efl
* Document mouse event callback system in LUA
SVN revision: 47063
This commit is contained in:
parent
976ea97214
commit
aad74ff4ca
|
@ -194,6 +194,7 @@ ALIASES += edcsection{2}="<tr class=\"section\"><td class=\"sectio
|
||||||
ALIASES += luaclass{2}="\anchor \1 \n<div class=\"luaclass\">\2</div>"
|
ALIASES += luaclass{2}="\anchor \1 \n<div class=\"luaclass\">\2</div>"
|
||||||
ALIASES += attributes="<div class=\"luaattrib\">Attributes:</div>"
|
ALIASES += attributes="<div class=\"luaattrib\">Attributes:</div>"
|
||||||
ALIASES += methods="<div class=\"luaattrib\">Methods:</div>"
|
ALIASES += methods="<div class=\"luaattrib\">Methods:</div>"
|
||||||
|
ALIASES += events="<div class=\"luaattrib\">Events:</div>"
|
||||||
ALIASES += setters="<div class=\"luaattrib\">Setters:</div>"
|
ALIASES += setters="<div class=\"luaattrib\">Setters:</div>"
|
||||||
ALIASES += seealso{2}="<b>See also:</b> <a href='\2'>\1</a>\n"
|
ALIASES += seealso{2}="<b>See also:</b> <a href='\2'>\1</a>\n"
|
||||||
ALIASES += seealso{1}="<b>See also:</b> \1\n"
|
ALIASES += seealso{1}="<b>See also:</b> \1\n"
|
||||||
|
|
|
@ -1373,8 +1373,28 @@ const luaL_Reg lTransition_fn[] = {
|
||||||
@page luaref
|
@page luaref
|
||||||
@luaclass{Object,General Object Class}
|
@luaclass{Object,General Object Class}
|
||||||
|
|
||||||
Within the lua_script scope, Edje objects (groups, parts, etc) have the
|
This is the base class, many other classes are children of this.
|
||||||
following basic attributes and methods:
|
|
||||||
|
You can attach event callbacks to this class using a classic c approach:
|
||||||
|
@code
|
||||||
|
function mouse_move_cb(self, ...)
|
||||||
|
print("mouse_move", ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
rect = ed:rectangle()
|
||||||
|
rect.mouse_events = true
|
||||||
|
rect.mouse_move = mouse_move_cb
|
||||||
|
@endcode
|
||||||
|
or you can also do the same in a more lua-fashion style
|
||||||
|
@code
|
||||||
|
rect = ed:rectangle {
|
||||||
|
mouse_events = true,
|
||||||
|
mouse_move = function (self, ...)
|
||||||
|
print ('mouse_move', ...)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
@seealso{Evas Object Docs,http://docs.enlightenment.org/auto/evas/group__Evas__Object__Group.html}
|
@seealso{Evas Object Docs,http://docs.enlightenment.org/auto/evas/group__Evas__Object__Group.html}
|
||||||
*/
|
*/
|
||||||
|
@ -2326,6 +2346,16 @@ const luaL_Reg lObject_set[] = {
|
||||||
{"mouse_events", _edje_lua_object_set_mouse_events},
|
{"mouse_events", _edje_lua_object_set_mouse_events},
|
||||||
{NULL, NULL} // sentinel
|
{NULL, NULL} // sentinel
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
@page luaref
|
||||||
|
@events
|
||||||
|
@li Object.mouse_in: func(self,output_x,output_y,canvas_x,canvas_y)
|
||||||
|
@li Object.mouse_out: func(self,output_x,output_y,canvas_x,canvas_y)
|
||||||
|
@li Object.mouse_down: func(self,button,output_x,output_y,canvas_x,canvas_y)
|
||||||
|
@li Object.mouse_up: func(self,button,output_x,output_y,canvas_x,canvas_y)
|
||||||
|
@li Object.mouse_move: func(self,buttons,output_x,output_y,canvas_x,canvas_y)
|
||||||
|
@li Object.mouse_wheel: func(self,z,output_x,output_y,canvas_x,canvas_y)
|
||||||
|
*/
|
||||||
|
|
||||||
const Edje_Lua_Reg *cRectangle[] = {
|
const Edje_Lua_Reg *cRectangle[] = {
|
||||||
&mClass,
|
&mClass,
|
||||||
|
|
Loading…
Reference in New Issue