-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathdemo_helper.jl
More file actions
95 lines (85 loc) · 5.56 KB
/
Copy pathdemo_helper.jl
File metadata and controls
95 lines (85 loc) · 5.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"""
ShowUserGuide()
Helper to display basic user controls.
"""
function ShowUserGuide()
CImGui.BulletText("Double-click on title bar to collapse window.")
CImGui.BulletText("Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents).")
CImGui.BulletText("Click and drag on any empty space to move window.")
CImGui.BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.")
CImGui.BulletText("CTRL+Click on a slider or drag box to input value as text.")
CImGui.GetIO().FontAllowUserScaling && CImGui.BulletText("CTRL+Mouse Wheel to zoom window contents.")
CImGui.BulletText("Mouse Wheel to scroll.")
CImGui.BulletText("While editing text:\n")
CImGui.Indent()
CImGui.BulletText("Hold SHIFT or use mouse to select text.")
CImGui.BulletText("CTRL+Left/Right to word jump.")
CImGui.BulletText("CTRL+A or double-click to select all.")
CImGui.BulletText("CTRL+X,CTRL+C,CTRL+V to use clipboard.")
CImGui.BulletText("CTRL+Z,CTRL+Y to undo/redo.")
CImGui.BulletText("ESCAPE to revert.")
CImGui.BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.")
CImGui.Unindent()
end
"""
ShowAboutWindow(p_open::Ref{Bool})
Access from ImGui Demo -> Help -> About
"""
function ShowAboutWindow(p_open::Ref{Bool})
CImGui.Begin("About Dear ImGui", p_open, CImGui.ImGuiWindowFlags_AlwaysAutoResize) || (CImGui.End(); return)
CImGui.Text("Dear ImGui $(CImGui.IMGUI_VERSION)")
CImGui.Separator()
CImGui.Text("By Omar Cornut and all dear imgui contributors.")
CImGui.Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.")
@cstatic show_config_info=false begin
@c CImGui.Checkbox("Config/Build Information", &show_config_info)
if show_config_info
io = CImGui.GetIO()
style = CImGui.GetStyle()
copy_to_clipboard = CImGui.Button("Copy to clipboard")
CImGui.BeginChildFrame(CImGui.GetID("cfginfos"), ImVec2(0, CImGui.GetTextLineHeightWithSpacing() * 18), CImGui.ImGuiWindowFlags_NoMove)
copy_to_clipboard && CImGui.LogToClipboard()
CImGui.Text("Dear ImGui $(CImGui.IMGUI_VERSION)")
CImGui.Separator()
CImGui.Text("sizeof(size_t): $(sizeof(Csize_t)), sizeof(ImDrawIdx): $(sizeof(CImGui.ImDrawIdx)), sizeof(ImDrawVert): $(sizeof(CImGui.ImDrawVert))")
CImGui.Separator()
CImGui.Text(@sprintf("io.BackendPlatformName: %s", io.BackendPlatformName != C_NULL ? unsafe_string(io.BackendPlatformName) : "NULL"))
CImGui.Text(@sprintf("io.BackendRendererName: %s", io.BackendRendererName != C_NULL ? unsafe_string(io.BackendRendererName) : "NULL"))
CImGui.Text(@sprintf("io.ConfigFlags: 0x%08X", io.ConfigFlags))
io.ConfigFlags & CImGui.ImGuiConfigFlags_NavEnableKeyboard != 0 && CImGui.Text(" NavEnableKeyboard")
io.ConfigFlags & CImGui.ImGuiConfigFlags_NavEnableGamepad != 0 && CImGui.Text(" NavEnableGamepad")
io.ConfigFlags & CImGui.ImGuiConfigFlags_NavEnableSetMousePos != 0 && CImGui.Text(" NavEnableSetMousePos")
io.ConfigFlags & CImGui.ImGuiConfigFlags_NavNoCaptureKeyboard != 0 && CImGui.Text(" NavNoCaptureKeyboard")
io.ConfigFlags & CImGui.ImGuiConfigFlags_NoMouse != 0 && CImGui.Text(" NoMouse")
io.ConfigFlags & CImGui.ImGuiConfigFlags_NoMouseCursorChange != 0 && CImGui.Text(" NoMouseCursorChange")
io.MouseDrawCursor && CImGui.Text("io.MouseDrawCursor")
io.ConfigMacOSXBehaviors && CImGui.Text("io.ConfigMacOSXBehaviors")
io.ConfigInputTextCursorBlink && CImGui.Text("io.ConfigInputTextCursorBlink")
io.ConfigWindowsResizeFromEdges && CImGui.Text("io.ConfigWindowsResizeFromEdges")
io.ConfigWindowsMoveFromTitleBarOnly && CImGui.Text("io.ConfigWindowsMoveFromTitleBarOnly")
CImGui.Text(@sprintf("io.BackendFlags: 0x%08X", io.BackendFlags))
io.BackendFlags & ImGuiBackendFlags_HasGamepad != 0 && CImGui.Text(" HasGamepad")
io.BackendFlags & ImGuiBackendFlags_HasMouseCursors != 0 && CImGui.Text(" HasMouseCursors")
io.BackendFlags & ImGuiBackendFlags_HasSetMousePos != 0 && CImGui.Text(" HasSetMousePos")
CImGui.Separator()
# CImGui.Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight);
CImGui.Text(@sprintf("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y))
CImGui.Text(@sprintf("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y))
CImGui.Separator()
window_padding = style.WindowPadding
CImGui.Text(@sprintf("style.WindowPadding: %.2f,%.2f", window_padding.x, window_padding.y))
CImGui.Text(@sprintf("style.WindowBorderSize: %.2f", style.WindowBorderSize))
frame_padding = style.FramePadding
CImGui.Text(@sprintf("style.FramePadding: %.2f,%.2f", frame_padding.x, frame_padding.y))
CImGui.Text(@sprintf("style.FrameRounding: %.2f", style.FrameRounding))
CImGui.Text(@sprintf("style.FrameBorderSize: %.2f", style.FrameBorderSize))
item_spacing = style.ItemSpacing
CImGui.Text(@sprintf("style.ItemSpacing: %.2f,%.2f", item_spacing.x, item_spacing.y))
item_inner_spacing = style.ItemInnerSpacing
CImGui.Text(@sprintf("style.ItemInnerSpacing: %.2f,%.2f", item_inner_spacing.x, item_inner_spacing.y))
copy_to_clipboard && CImGui.LogFinish()
CImGui.EndChildFrame()
end
end
CImGui.End()
end