Skip to content

Commit

Permalink
Fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnimuc committed Feb 18, 2021
1 parent b54e0e0 commit a61a512
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
3 changes: 2 additions & 1 deletion examples/app_long_text.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function ShowExampleAppLongText(p_open::Ref{Bool})
@case 1
# multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper.
CImGui.PushStyleVar(CImGui.ImGuiStyleVar_ItemSpacing, (0,0))
clipper = CImGui.Clipper(lines)
clipper = CImGui.Clipper()
CImGui.Begin(clipper, lines)
while CImGui.Step(clipper)
s = CImGui.Get(clipper, :DisplayStart)
e = CImGui.Get(clipper, :DisplayEnd)-1
Expand Down
40 changes: 20 additions & 20 deletions examples/demo_columns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,27 @@ function ShowDemoWindowColumns()
# CImGui.TreePop()
# end

if CImGui.TreeNode("Horizontal Scrolling")
CImGui.SetNextWindowContentSize((1500.0, 0.0))
CImGui.BeginChild("##ScrollingRegion", ImVec2(0, CImGui.GetFontSize() * 20), false, CImGui.ImGuiWindowFlags_HorizontalScrollbar)
CImGui.Columns(10)
ITEMS_COUNT = 2000

clipper = CImGui.Clipper(ITEMS_COUNT) # also demonstrate using the clipper for large list
while CImGui.Step(clipper)
s = CImGui.Get(clipper, :DisplayStart)
e = CImGui.Get(clipper, :DisplayEnd)-1
for i = s:e, j = 0:9
CImGui.Text("Line $i Column $j...")
CImGui.NextColumn()
end
end
CImGui.Destroy(clipper)
# if CImGui.TreeNode("Horizontal Scrolling")
# CImGui.SetNextWindowContentSize((1500.0, 0.0))
# CImGui.BeginChild("##ScrollingRegion", ImVec2(0, CImGui.GetFontSize() * 20), false, CImGui.ImGuiWindowFlags_HorizontalScrollbar)
# CImGui.Columns(10)
# ITEMS_COUNT = 2000

# clipper = CImGui.Clipper() # also demonstrate using the clipper for large list
# while CImGui.Step(clipper)
# s = CImGui.Get(clipper, :DisplayStart)
# e = CImGui.Get(clipper, :DisplayEnd)-1
# for i = s:e, j = 0:9
# CImGui.Text("Line $i Column $j...")
# CImGui.NextColumn()
# end
# end
# CImGui.Destroy(clipper)

CImGui.Columns(1)
CImGui.EndChild()
CImGui.TreePop()
end
# CImGui.Columns(1)
# CImGui.EndChild()
# CImGui.TreePop()
# end

node_open = CImGui.TreeNode("Tree within single cell")
CImGui.SameLine()
Expand Down
8 changes: 4 additions & 4 deletions src/wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ SmallButton(label) = igSmallButton(label)
"""
InvisibleButton(str_id, size, flag = 0) -> Bool
Return true when the value has been changed or when pressed/selected.
Flexible button behavior without the visuals, frequently useful to build custom behaviors using
Flexible button behavior without the visuals, frequently useful to build custom behaviors using
the public api along with [`IsItemActive`](@ref), [`IsItemHovered`](@ref), etc.
"""
InvisibleButton(str_id, size, flag = 0) = igInvisibleButton(str_id, size, flag)
Expand Down Expand Up @@ -1201,7 +1201,7 @@ Combo(label, current_item, items_getter::Union{Ptr,Base.CFunction}, data, items_
If `v_min` >= `v_max` we have no bound.
"""
DragFloat(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) = igDragFloat(label, v, v_speed, v_min, v_max, format, flag)
@deprecate DragFloat(label, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragFloat(label, v, v_speed, v_min, v_max, format, 0)
@deprecate DragFloat(label, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragFloat(label, v, v_speed, v_min, v_max, format, 0)

"""
DragFloat2(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) -> Bool
Expand Down Expand Up @@ -2940,7 +2940,7 @@ fetching/submission cost null.
### Example
```julia
clipper = CImGui.Clipper()
clipper = CImGui.Clipper()
Begin(clipper, 1000) # we have 1000 elements, evenly spaced.
while CImGui.Step()
dis_start = CImGui.Get(clipper, :DisplayStart)
Expand Down Expand Up @@ -2987,7 +2987,7 @@ Step(handle::Ptr{ImGuiListClipper}) = ImGuiListClipper_Step(handle)
Begin(handle::Ptr{ImGuiListClipper}, items_count, items_height=-1.0)
Automatically called by constructor if you passed `items_count` or by [`Step`](@ref) in Step 1.
"""
Begin(handle::Ptr{ImGuiListClipper}, items_count, items_height=-1.0) = ImGuiListClipper_Begin(self, items_count, items_height)
Begin(handle::Ptr{ImGuiListClipper}, items_count, items_height=-1.0) = ImGuiListClipper_Begin(handle, items_count, items_height)

"""
End(handle::Ptr{ImGuiListClipper})
Expand Down

0 comments on commit a61a512

Please sign in to comment.