You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: imgui-binding/src/main/java/imgui/ImGui.java
+31-50Lines changed: 31 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -4018,29 +4018,29 @@ public static boolean beginPopupModal(String name, ImBoolean pOpen, int imGuiWin
4018
4018
/**
4019
4019
* Helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
4020
4020
*/
4021
-
publicstaticnativevoidopenPopupContextItem(); /*
4022
-
ImGui::OpenPopupContextItem();
4021
+
publicstaticnativevoidopenPopupOnItemClick(); /*
4022
+
ImGui::OpenPopupOnItemClick();
4023
4023
*/
4024
4024
4025
4025
/**
4026
4026
* Helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
* Helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
* Helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
// - Helpers to do OpenPopup+BeginPopup where the Open action is triggered by e.g. hovering an item and right-clicking.
4088
4055
// - They are convenient to easily create context menus, hence the name.
4089
4056
// - IMPORTANT: Notice that BeginPopupContextXXX takes ImGuiPopupFlags just like OpenPopup() and unlike BeginPopup(). For full consistency, we may add ImGuiWindowFlags to the BeginPopupContextXXX functions in the future.
4090
-
// - We exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter. Passing a mouse button to ImGuiPopupFlags is guaranteed to be legal.
4057
+
// - IMPORTANT: we exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter, so if you add other flags remember to re-add the ImGuiPopupFlags_MouseButtonRight.
4091
4058
4092
4059
/**
4093
4060
* Open+begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id.
Copy file name to clipboardExpand all lines: imgui-binding/src/main/java/imgui/ImGuiListClipper.java
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,23 @@
4
4
5
5
/**
6
6
* Helper: Manually clip large list of items.
7
-
* If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all.
7
+
* If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse
8
+
* clipping based on visibility to save yourself from processing those items at all.
8
9
* The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
9
-
* ImGui already clip items based on their bounds but it needs to measure text size to do so. Coarse clipping before submission makes this cost and your own data fetching/submission cost null.
10
-
* Usage:
10
+
* (Dear ImGui already clip items based on their bounds but it needs to measure text size to do so, whereas manual coarse clipping before submission makes this cost and your own data fetching/submission cost almost null)
11
11
* <pre>
12
-
* ImGuiListClipper clipper(1000); // we have 1000 elements, evenly spaced.
13
-
* while (clipper.Step())
14
-
* for (int i = clipper.DisplayStart; i {@code <} clipper.DisplayEnd; i++)
15
-
* ImGui::Text("line number %d", i);
12
+
* ImGuiListClipper clipper;
13
+
* clipper.Begin(1000); // We have 1000 elements, evenly spaced.
14
+
* while (clipper.Step())
15
+
* for (int i = clipper.DisplayStart; i {@code <} clipper.DisplayEnd; i++)
16
+
* ImGui::Text("line number %d", i);
16
17
* </pre>
17
-
* - Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height (step skipped if we passed a known height as second arg to constructor).
18
-
* - Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element.
19
-
* - (Step 2: empty step only required if an explicit items_height was passed to constructor or Begin() and user call Step(). Does nothing and switch to Step 3.)
20
-
* - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
18
+
* Generally what happens is:
19
+
* - Clipper lets you process the first element (DisplayStart = 0, DisplayEnd = 1) regardless of it being visible or not.
20
+
* - User code submit one element.
21
+
* - Clipper can measure the height of the first element
22
+
* - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element.
23
+
* - User code submit visible elements.
21
24
* <p>
22
25
* BINDING NOTICE:
23
26
* It's impossible to implement the same API like in the original. Method {@link #forEach(int, int, ImListClipperCallback)} could be used instead.
@@ -55,7 +58,8 @@ public static void forEach(final int itemsCount, final ImListClipperCallback cal
Copy file name to clipboardExpand all lines: imgui-binding/src/main/java/imgui/flag/ImGuiConfigFlags.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ private ImGuiConfigFlags() {
47
47
// When using viewports it is recommended that your default value for ImGuiCol_WindowBg is opaque (Alpha=1.0) so transition to a viewport won't be noticeable.
48
48
49
49
/**
50
-
* Viewport enable flags (require both ImGuiConfigFlags_PlatformHasViewports + ImGuiConfigFlags_RendererHasViewports set by the respective back-ends)
50
+
* Viewport enable flags (require both ImGuiBackendFlags_PlatformHasViewports + ImGuiBackendFlags_RendererHasViewports set by the respective back-ends)
0 commit comments