From ec6d86d8783fd58dc7ee6b7b79135f9c45323a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Sat, 1 Jun 2024 15:06:02 +0200 Subject: [PATCH] Added table_setup_scroll_freeze --- example/example.script | 1 + imgui/api/imgui.script_api | 10 ++++++++++ imgui/src/extension_imgui.cpp | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/example/example.script b/example/example.script index b6377dc..3346b84 100644 --- a/example/example.script +++ b/example/example.script @@ -161,6 +161,7 @@ local function update_tab1(self) end if imgui.begin_table("table_example", 3) then + imgui.table_setup_scroll_freeze(1, 1) imgui.table_setup_column("FIRST NAME") imgui.table_setup_column("LAST NAME") imgui.table_setup_column("AGE") diff --git a/imgui/api/imgui.script_api b/imgui/api/imgui.script_api index da5eb58..01483fe 100644 --- a/imgui/api/imgui.script_api +++ b/imgui/api/imgui.script_api @@ -548,6 +548,16 @@ - name: init_width_or_weight type: number +#***************************************************************************************************** + + - name: table_setup_scroll_freeze + type: function + + parameters: + - name: columns + type: number + - name: rows + type: number #***************************************************************************************************** diff --git a/imgui/src/extension_imgui.cpp b/imgui/src/extension_imgui.cpp index 2dbca2f..b991755 100644 --- a/imgui/src/extension_imgui.cpp +++ b/imgui/src/extension_imgui.cpp @@ -919,6 +919,17 @@ static int imgui_TableNextRow(lua_State* L) } +static int imgui_TableSetupScrollFreeze(lua_State* L) +{ + DM_LUA_STACK_CHECK(L, 0); + imgui_NewFrame(); + int freeze_cols = luaL_checkinteger(L, 1); + int freeze_rows = luaL_checkinteger(L, 2); + ImGui::TableSetupScrollFreeze(freeze_cols, freeze_rows); + return 0; +} + + // ---------------------------- // ----- TOOLTIP --------- // ----------------------------