Skip to content

Commit 9fdd6d7

Browse files
committed
[API] Add internal ImGuiItemFlags api
1 parent 9b0307e commit 9fdd6d7

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

imgui-binding/src/main/java/imgui/internal/ImGui.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ public final class ImGui extends imgui.ImGui {
1111
#include <imgui_internal.h>
1212
*/
1313

14+
// Basic Helpers for widget code
15+
16+
public static native void pushItemFlag(int imGuiItemFlags, boolean enabled); /*
17+
ImGui::PushItemFlag(imGuiItemFlags, enabled);
18+
*/
19+
20+
public static native void popItemFlag(); /*
21+
ImGui::PopItemFlag();
22+
*/
23+
1424
// Docking - Builder function needs to be generally called before the node is used/submitted.
1525
// - The DockBuilderXXX functions are designed to _eventually_ become a public API, but it is too early to expose it and guarantee stability.
1626
// - Do not hold on ImGuiDockNode* pointers! They may be invalidated by any split/merge/remove operation and every frame.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package imgui.internal.flag;
2+
3+
/**
4+
* Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
5+
* This is going to be exposed in imgui.h when stabilized enough.
6+
*/
7+
public final class ImGuiItemFlags {
8+
private ImGuiItemFlags() {
9+
}
10+
11+
public static final int None = 0;
12+
public static final int NoTabStop = 1;
13+
/**
14+
* Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
15+
*/
16+
public static final int ButtonRepeat = 1 << 1;
17+
/**
18+
* [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211
19+
*/
20+
public static final int Disabled = 1 << 2;
21+
public static final int NoNav = 1 << 3;
22+
public static final int NoNavDefaultFocus = 1 << 4;
23+
/**
24+
* MenuItem/Selectable() automatically closes current Popup window
25+
*/
26+
public static final int SelectableDontClosePopup = 1 << 5;
27+
/**
28+
* [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ.
29+
* Currently only supported by Checkbox() (later should support all sorts of widgets)
30+
*/
31+
public static final int MixedValue = 1 << 6;
32+
/**
33+
* [ALPHA] Allow hovering interactions but underlying value is not changed.
34+
*/
35+
public static final int ReadOnly = 1 << 7;
36+
}

0 commit comments

Comments
 (0)