Skip to content

Commit

Permalink
add scrollTo methods
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Jul 8, 2024
1 parent c7bcc25 commit 72ade1b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions imgui/imgui-build/src/main/cpp/custom/ImGuiCustom.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ class ImGuiInternal {
static void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0) { im::SetKeyOwner(key, owner_id, flags); }
static void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0) { im::SetItemKeyOwner(key, flags); }
static bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id) { return im::TestKeyOwner(key, owner_id); }

static void ScrollToItem(ImGuiScrollFlags flags = 0) { im::ScrollToItem(flags); }
static void ScrollToRect(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0) { im::ScrollToRect(window, rect, flags); }
static ImVec2 ScrollToRectEx(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0) { return im::ScrollToRectEx(window, rect, flags); }
};

class ImGui {
Expand Down
17 changes: 17 additions & 0 deletions imgui/imgui-build/src/main/cpp/imgui.idl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ interface ImGuiInternal {
static void SetKeyOwner(ImGuiKey ImGuiKey, long owner_id, optional ImGuiInputFlags ImGuiInputFlags);
static void SetItemKeyOwner(ImGuiKey ImGuiKey, optional ImGuiInputFlags ImGuiInputFlags);
static boolean TestKeyOwner(ImGuiKey ImGuiKey, long owner_id);

static void ScrollToItem(optional ImGuiScrollFlags flags);
static void ScrollToRect(ImGuiWindow window, [Const, Ref] ImRect rect, optional ImGuiScrollFlags flags);
[Value] static ImVec2 ScrollToRectEx(ImGuiWindow window, [Const, Ref] ImRect rect, optional ImGuiScrollFlags flags);
};

[NoDelete, Prefix="ImGuiWrapper::"]
Expand Down Expand Up @@ -1737,4 +1741,17 @@ enum ImGuiInputFlags {
"ImGuiInputFlags_SupportedByShortcut",
"ImGuiInputFlags_SupportedBySetKeyOwner",
"ImGuiInputFlags_SupportedBySetItemKeyOwner"
};

enum ImGuiScrollFlags {
"ImGuiScrollFlags_None",
"ImGuiScrollFlags_KeepVisibleEdgeX",
"ImGuiScrollFlags_KeepVisibleEdgeY",
"ImGuiScrollFlags_KeepVisibleCenterX",
"ImGuiScrollFlags_KeepVisibleCenterY",
"ImGuiScrollFlags_AlwaysCenterX",
"ImGuiScrollFlags_AlwaysCenterY",
"ImGuiScrollFlags_NoScrollParent",
"ImGuiScrollFlags_MaskX_",
"ImGuiScrollFlags_MaskY_"
};

0 comments on commit 72ade1b

Please sign in to comment.