Skip to content

Commit

Permalink
Adapt to breaking changes of imgui 1.79
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnimuc committed Oct 19, 2020
1 parent f026cc4 commit 3f83d04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/demo_popups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 8 additions & 7 deletions src/wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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})
Expand Down

2 comments on commit 3f83d04

@Gnimuc
Copy link
Owner Author

@Gnimuc Gnimuc commented on 3f83d04 Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/23245

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.79.0 -m "<description of version>" 3f83d04634f97aea50949af5004af1d6a96f1bcb
git push origin v1.79.0

Please sign in to comment.