mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
[lua] Add 'ondblclick' event for canvas widget
This commit is contained in:
parent
11abe10c20
commit
af9f7288ee
@ -124,6 +124,12 @@ bool Canvas::onProcessMessage(ui::Message* msg)
|
||||
break;
|
||||
}
|
||||
|
||||
case ui::kDoubleClickMessage: {
|
||||
auto mouseMsg = static_cast<ui::MouseMessage*>(msg);
|
||||
DoubleClick(mouseMsg);
|
||||
break;
|
||||
}
|
||||
|
||||
case ui::kMouseWheelMessage: {
|
||||
auto mouseMsg = static_cast<ui::MouseMessage*>(msg);
|
||||
Wheel(mouseMsg);
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
obs::signal<void(ui::MouseMessage*)> MouseMove;
|
||||
obs::signal<void(ui::MouseMessage*)> MouseDown;
|
||||
obs::signal<void(ui::MouseMessage*)> MouseUp;
|
||||
obs::signal<void(ui::MouseMessage*)> DoubleClick;
|
||||
obs::signal<void(ui::MouseMessage*)> Wheel;
|
||||
obs::signal<void(ui::TouchMessage*)> TouchMagnify;
|
||||
|
||||
|
@ -1149,6 +1149,12 @@ int Dialog_canvas(lua_State* L)
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
type = lua_getfield(L, 2, "ondblclick");
|
||||
if (type == LUA_TFUNCTION) {
|
||||
Dialog_connect_signal(L, 1, widget->DoubleClick, fill_mousemessage_values);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
type = lua_getfield(L, 2, "onwheel");
|
||||
if (type == LUA_TFUNCTION) {
|
||||
Dialog_connect_signal(L, 1, widget->Wheel, fill_mousemessage_values);
|
||||
|
Loading…
x
Reference in New Issue
Block a user