From 45328cbadd8a946c19a77301f218efbf650e2f28 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 18 Oct 2021 19:56:41 +0800 Subject: *misc --- .../Scripting/EditorGUI/ContainerWindow.bind.cpp | 50 ++++++++++++++++++---- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'Editor/Scripting/EditorGUI/ContainerWindow.bind.cpp') diff --git a/Editor/Scripting/EditorGUI/ContainerWindow.bind.cpp b/Editor/Scripting/EditorGUI/ContainerWindow.bind.cpp index 265ea2e..d3d0997 100644 --- a/Editor/Scripting/EditorGUI/ContainerWindow.bind.cpp +++ b/Editor/Scripting/EditorGUI/ContainerWindow.bind.cpp @@ -3,9 +3,11 @@ LUA_BIND_REGISTRY(ContainnerWindow) { LUA_BIND_REGISTER_METHODS(state, - { "SetTitle", _SetTitle }, - { "DoPaint", _DoPaint } - ); + { "SetTitle", _SetTitle }, + { "SetIcon", _SetIcon }, + { "DoPaint", _DoPaint }, + { "New", _New } + ); } LUA_BIND_POSTPROCESS(ContainnerWindow) @@ -22,16 +24,46 @@ LUA_BIND_POSTPROCESS(ContainnerWindow) LUA_BIND_IMPL_METHOD(ContainnerWindow, _SetTitle) { - LUA_BIND_PREPARE(L, ContainnerWindow); + LUA_BIND_PREPARE(L, ContainnerWindow); + + cc8* title = state.GetValue(2, ""); + self->SetTitle(title); + return 0; +} +LUA_BIND_IMPL_METHOD(ContainnerWindow, _SetIcon) +{ + LUA_BIND_PREPARE(L, ContainnerWindow); - return 0; + cc8* path = state.GetValue(2, ""); + self->SetIcon(path); + + return 0; } LUA_BIND_IMPL_METHOD(ContainnerWindow, _DoPaint) { - LUA_BIND_PREPARE(L, ContainnerWindow); - self->DoPaint(); - return 0; -} \ No newline at end of file + LUA_BIND_PREPARE(L, ContainnerWindow); + self->DoPaint(); + return 0; +} + +LUA_BIND_IMPL_METHOD(ContainnerWindow, ContainnerWindow::_New) +{ + LUA_BIND_STATE(L, ContainnerWindow); + LUA_BIND_CHECK(L, "TNTT"); + + ContainnerWindow* wnd = new ContainnerWindow(); + + Rectf rect = state.GetValue(state, Rectf()); + int showMode = state.GetValue(2, 0); + Vector2f min = state.GetValue(state, Vector2f()); + Vector2f max = state.GetValue(state, Vector2f()); + + wnd->Init(rect, showMode, min, max); + + wnd->PushUserdata(state); + + return 1; +} -- cgit v1.1-26-g67d0