From 3f83d04634f97aea50949af5004af1d6a96f1bcb Mon Sep 17 00:00:00 2001 From: Gnimuc Date: Mon, 19 Oct 2020 23:14:09 +0800 Subject: [PATCH] Adapt to breaking changes of imgui 1.79 --- examples/demo_popups.jl | 4 ++-- src/wrapper.jl | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/demo_popups.jl b/examples/demo_popups.jl index a0167bb..46f98e4 100644 --- a/examples/demo_popups.jl +++ b/examples/demo_popups.jl @@ -100,10 +100,10 @@ function ShowDemoWindowPopups() end end - # We can also use OpenPopupContextItem() which is the same as BeginPopupContextItem() but without the Begin call. + # We can also use OpenPopupOnItemClick() which is the same as BeginPopupContextItem() but without the Begin call. # So here we will make it that clicking on the text field with the right mouse button (1) will toggle the visibility of the popup above. CImGui.Text("(You can also right-click me to the same popup as above.)") - CImGui.OpenPopupContextItem("item context menu", 1) + CImGui.OpenPopupOnItemClick("item context menu", 1) # When used after an item that has an ID (here the Button), we can skip providing an ID to BeginPopupContextItem(). # BeginPopupContextItem() will use the last item ID as the popup ID. diff --git a/src/wrapper.jl b/src/wrapper.jl index 5b0a6c5..69095b2 100644 --- a/src/wrapper.jl +++ b/src/wrapper.jl @@ -1794,13 +1794,13 @@ See [`BeginPopup`](@ref), [`BeginPopupContextItem`](@ref), [`BeginPopupContextWi EndPopup() = igEndPopup() """ - OpenPopupContextItem(str_id=C_NULL, mouse_button=1) -> Bool + OpenPopupOnItemClick(str_id=C_NULL, mouse_button=1) -> Nothing Helper to open popup when clicked on last item (note: actually triggers on the mouse -_released_ event to be consistent with popup behaviors). return true when just opened. +_released_ event to be consistent with popup behaviors). """ -OpenPopupContextItem(str_id=C_NULL, mouse_button=1) = igOpenPopupContextItem(str_id, mouse_button) +OpenPopupOnItemClick(str_id=C_NULL, mouse_button=1) = igOpenPopupOnItemClick(str_id, mouse_button) -@deprecate OpenPopupOnItemClick(str_id=C_NULL, mouse_button=1) OpenPopupContextItem(str_id=C_NULL, mouse_button=1) +@deprecate OpenPopupContextItem(str_id=C_NULL, mouse_button=1) OpenPopupOnItemClick(str_id=C_NULL, mouse_button=1) """ IsPopupOpen(str_id) -> Bool @@ -2924,7 +2924,7 @@ end ##################################### ImGuiListClipper ##################################### """ - Clipper(items_count=-1, items_height=-1.0) -> Ptr{ImGuiListClipper} + Clipper() -> Ptr{ImGuiListClipper} Manually clip large list of items. If you are submitting lots of evenly spaced items and you have a random access to the list, @@ -2940,7 +2940,8 @@ fetching/submission cost null. ### Example ```julia -clipper = CImGui.Clipper(1000) # we have 1000 elements, evenly spaced. +clipper = CImGui.Clipper() +Begin(clipper, 1000) # we have 1000 elements, evenly spaced. while CImGui.Step() dis_start = CImGui.Get(clipper, :DisplayStart) dis_end = CImGui.Get(clipper, :DisplayEnd)-1 @@ -2968,7 +2969,7 @@ end [`Step`](@ref). If you specify `items_height` you may call the old [`Begin`](@ref)/[`End`](@ref) api directly, but prefer calling [`Step`](@ref). """ -Clipper(items_count=-1, items_height=-1.0) = ImGuiListClipper_ImGuiListClipper(items_count, items_height) +Clipper() = ImGuiListClipper_ImGuiListClipper() """ Destroy(handle::Ptr{ImGuiListClipper})