Dear ImGui’s internal API (imgui_internal.h): the functions and structures that the widgets are built with.
Use it to write custom widgets, or to reach what the public API does not expose. It may change between versions of Dear ImGui, without notice.
The module imgui_bundle.imgui.internal, the Python API of Dear ImGui, from bindings/imgui_bundle/imgui/internal.pyi: 566 functions, 91 classes, 44 enums. Each entry gives the Python signature, then the C++ one, then the doc of the C++ header. The sections are the header’s.
imgui_internal.h¶
Generic helpers¶
im_hash_data¶
def im_hash_data(data: Any, data_size: int, seed: ID = 0) -> IDIMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);Note that the ImXXX helpers functions are lower-level than ImGui functions.
ImGui functions or the ImGui context are never called/used from other ImXXX functions.
Helpers: Hashing
Helpers: Sorting
Helpers: Bit manipulation
Helpers: String
Helpers: Formatting
Helpers: UTF-8 <> wchar conversions
Helpers: ImVec2/ImVec4 operators
Helpers: Maths
Helpers: Geometry
Helper: ImVec1
Helper: ImVec2ih
Helper: ImRect
Helper: ImBitArray
Helper: ImBitVector
Helper: ImSpan<>, ImSpanAllocator<>
Helper: ImStableVector<>
Helper: ImPool<>
Helper: ImChunkStream<>
Helper: ImGuiTextIndex
Helper: ImGuiStorage
Helpers: Hashing
im_hash_str¶
def im_hash_str(data: str, data_size: int = 0, seed: ID = 0) -> IDIMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);im_hash_skip_uncontributing_prefix¶
def im_hash_skip_uncontributing_prefix(label: str) -> strIMGUI_API const char* ImHashSkipUncontributingPrefix(const char* label);Helpers: Sorting¶
im_alpha_blend_colors¶
def im_alpha_blend_colors(col_a: ImU32, col_b: ImU32) -> ImU32IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);Helpers: Color Blending
Helpers: Bit manipulation¶
im_is_power_of_two¶
@overload
def im_is_power_of_two(v: int) -> bool
@overload
def im_is_power_of_two(v: ImU64) -> boolinline bool ImIsPowerOfTwo(int v);
inline bool ImIsPowerOfTwo(ImU64 v);(private API)
im_upper_power_of_two¶
def im_upper_power_of_two(v: int) -> intinline int ImUpperPowerOfTwo(int v);(private API)
im_count_set_bits¶
def im_count_set_bits(v: int) -> intinline unsigned int ImCountSetBits(unsigned int v);(private API)
Helpers: String¶
im_memdup¶
def im_memdup(src: Any, size: int) -> AnyIMGUI_API void* ImMemdup(const void* src, size_t size);Duplicate a chunk of memory.
im_char_is_blank_w¶
def im_char_is_blank_w(c: int) -> boolinline bool ImCharIsBlankW(unsigned int c);(private API)
Helpers: UTF-8 <> wchar conversions¶
im_text_find_previous_utf8_codepoint¶
def im_text_find_previous_utf8_codepoint(in_text_start: str, in_p: str) -> strIMGUI_API const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_p);return previous UTF-8 code-point.
im_text_find_valid_utf8_codepoint_end¶
def im_text_find_valid_utf8_codepoint_end(in_text_start: str, in_text_end: str, in_p: str) -> strIMGUI_API const char* ImTextFindValidUtf8CodepointEnd(const char* in_text_start, const char* in_text_end, const char* in_p);return previous UTF-8 code-point if ‘in_p’ is not the end of a valid one.
im_text_count_lines¶
def im_text_count_lines(in_text: str, in_text_end: str) -> intIMGUI_API int ImTextCountLines(const char* in_text, const char* in_text_end);return number of lines taken by text. trailing carriage return doesn’t count as an extra line.
ImDrawTextFlags_ (enum)¶
Helpers: High-level text functions (DO NOT USE!!! THIS IS A MINIMAL SUBSET OF LARGER UPCOMING CHANGES)
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImDrawTextFlags_None = 0 | |
cpu_fine_clip | 1 << 0 | ImDrawTextFlags_CpuFineClip = 1 << 0 | Must be == 1/True for legacy with ‘bool cpu_fine_clip’ arg to RenderText() |
wrap_keep_blanks | 1 << 1 | ImDrawTextFlags_WrapKeepBlanks = 1 << 1 | |
stop_on_new_line | 1 << 2 | ImDrawTextFlags_StopOnNewLine = 1 << 2, } |
im_font_calc_word_wrap_position_ex¶
def im_font_calc_word_wrap_position_ex(font: ImFont, size: float, text: str, text_end: str, wrap_width: float, flags: ImDrawTextFlags = 0) -> strIMGUI_API const char* ImFontCalcWordWrapPositionEx(ImFont* font, float size, const char* text, const char* text_end, float wrap_width, ImDrawTextFlags flags = 0);im_text_calc_word_wrap_next_line_start¶
def im_text_calc_word_wrap_next_line_start(text: str, text_end: str, flags: ImDrawTextFlags = 0) -> strIMGUI_API const char* ImTextCalcWordWrapNextLineStart(const char* text, const char* text_end, ImDrawTextFlags flags = 0);trim trailing space and find beginning of next line
ImWcharClass (enum)¶
Character classification for word-wrapping logic
| Member | Value | C++ | |
|---|---|---|---|
blank | 0 | ImWcharClass_Blank | |
punct | 1 | ImWcharClass_Punct | |
other | 2 | ImWcharClass_Other |
im_text_init_classifiers¶
def im_text_init_classifiers() -> NoneIMGUI_API void ImTextInitClassifiers();im_text_classifier_clear¶
def im_text_classifier_clear(bits: ImU32, codepoint_min: int, codepoint_end: int, char_class: ImWcharClass) -> NoneIMGUI_API void ImTextClassifierClear(ImU32* bits, unsigned int codepoint_min, unsigned int codepoint_end, ImWcharClass char_class);im_text_classifier_set_char_class¶
def im_text_classifier_set_char_class(bits: ImU32, codepoint_min: int, codepoint_end: int, char_class: ImWcharClass, c: int) -> NoneIMGUI_API void ImTextClassifierSetCharClass(ImU32* bits, unsigned int codepoint_min, unsigned int codepoint_end, ImWcharClass char_class, unsigned int c);Helpers: File System¶
Wrapper for standard libs functions. (Note that imgui_demo.cpp does not use them to keep the code easy to copy)
ImMin/ImMax/ImClamp/ImLerp/ImSwap are used by widgets which support variety of types: signed/unsigned int/long long float/double (Exceptionally using templates here but we could also redefine them for those types)
Misc maths helpers
im_min¶
def im_min(lhs: ImVec2Like, rhs: ImVec2Like) -> ImVec2inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs);(private API)
im_max¶
def im_max(lhs: ImVec2Like, rhs: ImVec2Like) -> ImVec2inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs);(private API)
im_clamp¶
def im_clamp(v: ImVec2Like, mn: ImVec2Like, mx: ImVec2Like) -> ImVec2inline ImVec2 ImClamp(const ImVec2& v, const ImVec2&mn, const ImVec2&mx);(private API)
im_lerp¶
@overload
def im_lerp(a: ImVec2Like, b: ImVec2Like, t: float) -> ImVec2
@overload
def im_lerp(a: ImVec2Like, b: ImVec2Like, t: ImVec2Like) -> ImVec2
@overload
def im_lerp(a: ImVec4Like, b: ImVec4Like, t: float) -> ImVec4inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t);
inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t);
inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t);(private API)
im_saturate¶
def im_saturate(f: float) -> floatinline float ImSaturate(float f);(private API)
im_length_sqr¶
@overload
def im_length_sqr(lhs: ImVec2Like) -> float
@overload
def im_length_sqr(lhs: ImVec4Like) -> floatinline float ImLengthSqr(const ImVec2& lhs);
inline float ImLengthSqr(const ImVec4& lhs);(private API)
im_inv_length¶
def im_inv_length(lhs: ImVec2Like, fail_value: float) -> floatinline float ImInvLength(const ImVec2& lhs, float fail_value);(private API)
im_trunc¶
@overload
def im_trunc(f: float) -> float
@overload
def im_trunc(v: ImVec2Like) -> ImVec2inline float ImTrunc(float f);
inline ImVec2 ImTrunc(const ImVec2& v);(private API)
im_floor¶
@overload
def im_floor(f: float) -> float
@overload
def im_floor(v: ImVec2Like) -> ImVec2inline float ImFloor(float f);
inline ImVec2 ImFloor(const ImVec2& v);(private API)
Decent replacement for floorf()
im_trunc64¶
def im_trunc64(f: float) -> floatinline float ImTrunc64(float f);(private API)
im_round64¶
def im_round64(f: float) -> floatinline float ImRound64(float f);(private API)
FIXME: Positive values only.
im_ceil_fast¶
def im_ceil_fast(f: float) -> floatinline float ImCeilFast(float f);(private API)
Consider using the the bit-hack version (search for “0x1p120f”).
im_mod_positive¶
def im_mod_positive(a: int, b: int) -> intinline int ImModPositive(int a, int b);(private API)
im_dot¶
def im_dot(a: ImVec2Like, b: ImVec2Like) -> floatinline float ImDot(const ImVec2& a, const ImVec2& b);(private API)
im_rotate¶
def im_rotate(v: ImVec2Like, cos_a: float, sin_a: float) -> ImVec2inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a);(private API)
im_linear_sweep¶
def im_linear_sweep(current: float, target: float, speed: float) -> floatinline float ImLinearSweep(float current, float target, float speed);(private API)
im_linear_remap_clamp¶
def im_linear_remap_clamp(s0: float, s1: float, d0: float, d1: float, x: float) -> floatinline float ImLinearRemapClamp(float s0, float s1, float d0, float d1, float x);(private API)
im_mul¶
def im_mul(lhs: ImVec2Like, rhs: ImVec2Like) -> ImVec2inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs);(private API)
im_is_float_above_guaranteed_integer_precision¶
def im_is_float_above_guaranteed_integer_precision(f: float) -> boolinline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f);(private API)
im_exponential_moving_average¶
def im_exponential_moving_average(avg: float, sample: float, n: int) -> floatinline float ImExponentialMovingAverage(float avg, float sample, int n);(private API)
Helpers: Geometry¶
im_bezier_cubic_calc¶
def im_bezier_cubic_calc(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, p4: ImVec2Like, t: float) -> ImVec2IMGUI_API ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t);im_bezier_cubic_closest_point¶
def im_bezier_cubic_closest_point(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, p4: ImVec2Like, p: ImVec2Like, num_segments: int) -> ImVec2IMGUI_API ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments);For curves with explicit number of segments
im_bezier_cubic_closest_point_casteljau¶
def im_bezier_cubic_closest_point_casteljau(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, p4: ImVec2Like, p: ImVec2Like, max_error: float) -> ImVec2IMGUI_API ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float max_error);For auto-tessellated curves you can use max_error = style.CurveTessellationMaxError
im_bezier_quadratic_calc¶
def im_bezier_quadratic_calc(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, t: float) -> ImVec2IMGUI_API ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t);im_line_closest_point¶
def im_line_closest_point(a: ImVec2Like, b: ImVec2Like, p: ImVec2Like) -> ImVec2IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);im_triangle_contains_point¶
def im_triangle_contains_point(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like, p: ImVec2Like) -> boolIMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);im_triangle_closest_point¶
def im_triangle_closest_point(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like, p: ImVec2Like) -> ImVec2IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);im_triangle_barycentric_coords¶
def im_triangle_barycentric_coords(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like, p: ImVec2Like, out_u: float, out_v: float, out_w: float) -> Tuple[float, float, float]IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);im_triangle_area¶
def im_triangle_area(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like) -> floatinline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c);(private API)
im_triangle_is_clockwise¶
def im_triangle_is_clockwise(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like) -> boolinline bool ImTriangleIsClockwise(const ImVec2& a, const ImVec2& b, const ImVec2& c);(private API)
ImVec1 (class)¶
| Attribute | C++ | |
|---|---|---|
x: float | float x; |
ImVec1.__init__¶
@overload
def __init__(self) -> None
@overload
def __init__(self, _x: float) -> Noneconstexpr inline ImVec1() : x(0.0f);
constexpr inline ImVec1(float _x) : x(_x);ImVec2i (class)¶
Helper: ImVec2i (2D vector, integer)
| Attribute | C++ | |
|---|---|---|
x: int | int x, | |
y: int | y; |
ImVec2i.__init__¶
@overload
def __init__(self) -> None
@overload
def __init__(self, _x: int, _y: int) -> Noneconstexpr inline ImVec2i() : x(0), y(0);
constexpr inline ImVec2i(int _x, int _y) : x(_x), y(_y);ImVec2ih (class)¶
Helper: ImVec2ih (2D vector, half-size integer, for long-term packed storage)
| Attribute | C++ | |
|---|---|---|
x: int | short x, | |
y: int | y; |
ImVec2ih.__init__¶
@overload
def __init__(self) -> None
@overload
def __init__(self, _x: int, _y: int) -> None
@overload
def __init__(self, rhs: ImVec2Like) -> Noneconstexpr inline ImVec2ih() : x(0), y(0);
constexpr inline ImVec2ih(short _x, short _y) : x(_x), y(_y);
constexpr inline explicit ImVec2ih(const ImVec2& rhs) : x((short)rhs.x), y((short)rhs.y);ImRect (class)¶
Helper: ImRect (2D axis aligned bounding-box)
NB: we can’t rely on ImVec2 math operators being available here!
| Attribute | C++ | |
|---|---|---|
min: ImVec2 | ImVec2 Min; | Upper-left |
max: ImVec2 | ImVec2 Max; | Lower-right |
ImRect.__init__¶
@overload
def __init__(self) -> None
@overload
def __init__(self, min: ImVec2Like, max: ImVec2Like) -> None
@overload
def __init__(self, v: ImVec4Like) -> None
@overload
def __init__(self, x1: float, y1: float, x2: float, y2: float) -> Noneconstexpr inline ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f);
constexpr inline ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max);
constexpr inline ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w);
constexpr inline ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2);ImRect.get_center¶
def get_center(self) -> ImVec2ImVec2 GetCenter() const;(private API)
ImRect.get_size¶
def get_size(self) -> ImVec2ImVec2 GetSize() const;(private API)
ImRect.get_width¶
def get_width(self) -> floatfloat GetWidth() const;(private API)
ImRect.get_height¶
def get_height(self) -> floatfloat GetHeight() const;(private API)
ImRect.get_area¶
def get_area(self) -> floatfloat GetArea() const;(private API)
ImRect.get_tl¶
def get_tl(self) -> ImVec2ImVec2 GetTL() const;(private API)
Top-left
ImRect.get_tr¶
def get_tr(self) -> ImVec2ImVec2 GetTR() const;(private API)
Top-right
ImRect.get_bl¶
def get_bl(self) -> ImVec2ImVec2 GetBL() const;(private API)
Bottom-left
ImRect.get_br¶
def get_br(self) -> ImVec2ImVec2 GetBR() const;(private API)
Bottom-right
ImRect.contains¶
@overload
def contains(self, p: ImVec2Like) -> bool
@overload
def contains(self, r: ImRect) -> boolbool Contains(const ImVec2& p) const;
bool Contains(const ImRect& r) const;(private API)
ImRect.contains_with_pad¶
def contains_with_pad(self, p: ImVec2Like, pad: ImVec2Like) -> boolbool ContainsWithPad(const ImVec2& p, const ImVec2& pad) const;(private API)
ImRect.overlaps¶
def overlaps(self, r: ImRect) -> boolbool Overlaps(const ImRect& r) const;(private API)
ImRect.add¶
@overload
def add(self, p: ImVec2Like) -> None
@overload
def add(self, r: ImRect) -> Nonevoid Add(const ImVec2& p);
void Add(const ImRect& r);(private API)
ImRect.add_x¶
def add_x(self, x: float) -> Nonevoid AddX(float x);(private API)
ImRect.add_y¶
def add_y(self, y: float) -> Nonevoid AddY(float y);(private API)
ImRect.expand¶
@overload
def expand(self, amount: float) -> None
@overload
def expand(self, amount: ImVec2Like) -> Nonevoid Expand(const float amount);
void Expand(const ImVec2& amount);(private API)
ImRect.translate¶
def translate(self, d: ImVec2Like) -> Nonevoid Translate(const ImVec2& d);(private API)
ImRect.translate_x¶
def translate_x(self, dx: float) -> Nonevoid TranslateX(float dx);(private API)
ImRect.translate_y¶
def translate_y(self, dy: float) -> Nonevoid TranslateY(float dy);(private API)
ImRect.clip_with¶
def clip_with(self, r: ImRect) -> Nonevoid ClipWith(const ImRect& r);(private API)
Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
ImRect.clip_with_full¶
def clip_with_full(self, r: ImRect) -> Nonevoid ClipWithFull(const ImRect& r);(private API)
Full version, ensure both points are fully clipped.
ImRect.is_inverted¶
def is_inverted(self) -> boolbool IsInverted() const;(private API)
ImRect.to_vec4¶
def to_vec4(self) -> ImVec4ImVec4 ToVec4() const;(private API)
ImRect.as_vec4¶
def as_vec4(self) -> ImVec4const ImVec4& AsVec4() const;(private API)
Helper: ImBitArray¶
im_bit_array_get_storage_size_in_bytes¶
def im_bit_array_get_storage_size_in_bytes(bitcount: int) -> intinline size_t ImBitArrayGetStorageSizeInBytes(int bitcount);(private API)
im_bit_array_clear_all_bits¶
def im_bit_array_clear_all_bits(arr: ImU32, bitcount: int) -> Noneinline void ImBitArrayClearAllBits(ImU32* arr, int bitcount);(private API)
im_bit_array_test_bit¶
def im_bit_array_test_bit(arr: ImU32, n: int) -> boolinline bool ImBitArrayTestBit(const ImU32* arr, int n);(private API)
im_bit_array_clear_bit¶
def im_bit_array_clear_bit(arr: ImU32, n: int) -> Noneinline void ImBitArrayClearBit(ImU32* arr, int n);(private API)
im_bit_array_set_bit¶
def im_bit_array_set_bit(arr: ImU32, n: int) -> Noneinline void ImBitArraySetBit(ImU32* arr, int n);(private API)
im_bit_array_set_bit_range¶
def im_bit_array_set_bit_range(arr: ImU32, n: int, n2: int) -> Noneinline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on range [n..n2);(private API)
// Works on range [n..n2)
ImBitVector (class)¶
Helper: ImBitVector
Store 1-bit per value.
| Attribute | C++ | |
|---|---|---|
storage: ImVector_ImU32 | ImVector<ImU32> Storage; |
ImBitVector.create¶
def create(self, sz: int) -> Nonevoid Create(int sz);(private API)
ImBitVector.clear¶
def clear(self) -> Nonevoid Clear();(private API)
ImBitVector.test_bit¶
def test_bit(self, n: int) -> boolbool TestBit(int n) const;(private API)
ImBitVector.set_bit¶
def set_bit(self, n: int) -> Nonevoid SetBit(int n);(private API)
ImBitVector.clear_bit¶
def clear_bit(self, n: int) -> Nonevoid ClearBit(int n);(private API)
ImBitVector.__init__¶
def __init__(self, storage: Optional[ImVector_ImU32] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If Storage is None, then its default value will be: ImVector_ImU32()
TextIndex (class)¶
Helper: ImGuiTextIndex
Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API.
| Attribute | C++ | |
|---|---|---|
offsets: ImVector_int | ImVector<int> Offsets; | |
end_offset: int | int EndOffset = 0; | Because we don’t own text buffer we need to maintain EndOffset (may bake in LineOffsets?) |
TextIndex.clear¶
def clear(self) -> Nonevoid clear();(private API)
TextIndex.size¶
def size(self) -> intint size();(private API)
TextIndex.get_line_begin¶
def get_line_begin(self, base: str, n: int) -> strconst char* get_line_begin(const char* base, int n);(private API)
TextIndex.get_line_end¶
def get_line_end(self, base: str, n: int) -> strconst char* get_line_end(const char* base, int n);(private API)
TextIndex.append¶
def append(self, base: str, old_size: int, new_size: int) -> Nonevoid append(const char* base, int old_size, int new_size);(private API)
TextIndex.__init__¶
def __init__(self, offsets: Optional[ImVector_int] = None, end_offset: int = 0) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If Offsets is None, then its default value will be: ImVector_int()
PackedDate (class)¶
Helper: ImGuiPackedDate (sizeof() == 2)
Store a date in a way that is efficient to read/write in text form. If we stored e.g. number of days since Epoch we’d need costlier back and forth.
This is specifically designed to be able to prune old .ini data.
PackedDate.__init__¶
@overload
def __init__(self) -> None
@overload
def __init__(self, yyyymmdd: int) -> NoneImGuiPackedDate();
ImGuiPackedDate(int yyyymmdd);Pack
PackedDate.is_valid¶
def is_valid(self) -> boolbool IsValid();(private API)
PackedDate.unpack¶
def unpack(self) -> intint Unpack() const;(private API)
Unpack
PackedDate.subtract_months¶
def subtract_months(self, m: int) -> Nonevoid SubtractMonths(int m);(private API)
FIXME-OPT: Stupid but enough for what we do with it.
im_lower_bound¶
def im_lower_bound(in_begin: StoragePair, in_end: StoragePair, key: ID) -> StoragePairIMGUI_API ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key);Helper: ImGuiStorage
ImDrawList support¶
ImDrawListSharedData (class)¶
Data shared between all ImDrawList instances
Conceptually this could have been called e.g. ImDrawListSharedContext
Typically one ImGui context would create and maintain one of this.
You may want to create your own instance of you try to ImDrawList completely without ImGui. In that case, watch out for future changes to this structure.
| Attribute | C++ | |
|---|---|---|
tex_uv_white_pixel: ImVec2 | ImVec2 TexUvWhitePixel; | UV of white pixel in the atlas (== FontAtlas->TexUvWhitePixel) |
tex_uv_lines: ImVec4 | const ImVec4* TexUvLines; | UV of anti-aliased lines in the atlas (== FontAtlas->TexUvLines) # (const) |
font_atlas: ImFontAtlas | ImFontAtlas* FontAtlas; | Current font atlas |
font: ImFont | ImFont* Font; | Current font (used for simplified AddText overload) |
font_size: float | float FontSize; | Current font size (used for for simplified AddText overload) |
font_scale: float | float FontScale; | Current font scale (== FontSize / Font->FontSize) |
curve_tessellation_max_error: float | float CurveTessellationMaxError; | Tessellation tolerance when using PathBezierCurveTo() |
circle_tessellation_max_error: float | float CircleTessellationMaxError; | Number of circle segments to use per pixel of radius for AddCircle() etc |
initial_flags: ImDrawListFlags | ImDrawListFlags InitialFlags; | Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards) |
clip_rect_fullscreen: ImVec4 | ImVec4 ClipRectFullscreen; | Value for PushClipRectFullscreen() |
temp_buffer: ImVector_ImVec2 | ImVector<ImVec2> TempBuffer; | Temporary write buffer |
draw_lists: ImVector_ImDrawList_ptr | ImVector<ImDrawList*> DrawLists; | All draw lists associated to this ImDrawListSharedData |
context: Context | ImGuiContext* Context; | [OPTIONAL] Link to Dear ImGui context. 99% of ImDrawList/ImFontAtlas can function without an ImGui context, but this facilitate handling one legacy edge case. |
arc_fast_radius_cutoff: float | float ArcFastRadiusCutoff; | Cutoff radius after which arc drawing will fallback to slower PathArcTo() |
circle_segment_counts: np.ndarray | ImU8 CircleSegmentCounts[64]; | ndarray[type=ImU8, size=64] # Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead) |
ImDrawListSharedData.__init__¶
def __init__(self) -> NoneImDrawListSharedData();ImDrawListSharedData.set_circle_tessellation_max_error¶
def set_circle_tessellation_max_error(self, max_error: float) -> Nonevoid SetCircleTessellationMaxError(float max_error);(private API)
ImDrawDataBuilder (class)¶
| Attribute | C++ | |
|---|---|---|
layer_data1: ImVector_ImDrawList_ptr | ImVector<ImDrawList*> LayerData1; |
ImDrawDataBuilder.__init__¶
def __init__(self) -> NoneImDrawDataBuilder();ImFontStackData (class)¶
| Attribute | C++ | |
|---|---|---|
font: ImFont | ImFont* Font; | |
font_size_before_scaling: float | float FontSizeBeforeScaling; | ~~ style.FontSizeBase |
font_size_after_scaling: float | float FontSizeAfterScaling; | ~~ g.FontSize |
ImFontStackData.__init__¶
def __init__(self, font_size_before_scaling: float = float(), font_size_after_scaling: float = float()) -> NoneAuto-generated default constructor with named params
Style support¶
StyleVarInfo (class)¶
StyleVarInfo.get_var_ptr¶
def get_var_ptr(self, parent: Any) -> Anyvoid* GetVarPtr(void* parent) const;(private API)
StyleVarInfo.__init__¶
def __init__(self) -> NoneAuto-generated default constructor
ColorMod (class)¶
Stacked color modifier, backup of modified data so we can restore it
| Attribute | C++ | |
|---|---|---|
col: Col | ImGuiCol Col; | |
backup_value: ImVec4 | ImVec4 BackupValue; |
ColorMod.__init__¶
def __init__(self, col: Optional[Col] = None, backup_value: Optional[ImVec4Like] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* Col: Col()
* BackupValue: ImVec4()
StyleMod (class)¶
Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.
| Attribute | C++ | |
|---|---|---|
var_idx: StyleVar | ImGuiStyleVar VarIdx; |
StyleMod.__init__¶
@overload
def __init__(self, idx: StyleVar, v: int) -> None
@overload
def __init__(self, idx: StyleVar, v: float) -> None
@overload
def __init__(self, idx: StyleVar, v: ImVec2Like) -> NoneImGuiStyleMod(ImGuiStyleVar idx, int v);
ImGuiStyleMod(ImGuiStyleVar idx, float v);
ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v);Data types support¶
DataTypeStorage (class)¶
| Attribute | C++ | |
|---|---|---|
data: np.ndarray | ImU8 Data[8]; | ndarray[type=ImU8, size=8] # Opaque storage to fit any data up to ImGuiDataType_COUNT |
DataTypeStorage.__init__¶
def __init__(self) -> NoneAuto-generated default constructor
DataTypeInfo (class)¶
Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().
| Attribute | C++ | |
|---|---|---|
size: int | size_t Size; | Size in bytes |
name: str | const char* Name; | Short descriptive name for the type, for debugging # (const) |
print_fmt: str | const char* PrintFmt; | Default printf format for the type # (const) |
scan_fmt: str | const char* ScanFmt; | Default scanf format for the type # (const) |
DataTypeInfo.__init__¶
def __init__(self, size: int = int()) -> NoneAuto-generated default constructor with named params
DataTypePrivate_ (enum)¶
Extend ImGuiDataType_
| Member | Value | C++ | |
|---|---|---|---|
pointer | DataType_COUNT | ImGuiDataType_Pointer = ImGuiDataType_COUNT | |
id_ | ImGuiDataType_ID, } |
Widgets support: flags, enums, data structures¶
ItemFlagsPrivate_ (enum)¶
Extend ImGuiItemFlags
input: PushItemFlag() manipulates g.CurrentItemFlags, g.NextItemData.ItemFlags, ItemAdd() calls may add extra flags too.
output: stored in g.LastItemData.ItemFlags
| Member | Value | C++ | |
|---|---|---|---|
read_only | 1 << 11 | ImGuiItemFlags_ReadOnly = 1 << 11 | False // [ALPHA] Allow hovering interactions but underlying value is not changed. |
no_window_hoverable_check | 1 << 13 | ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13 | False // Disable hoverable check in ItemHoverable() |
allow_overlap | 1 << 14 | ImGuiItemFlags_AllowOverlap = 1 << 14 | False // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame. |
no_nav_disable_mouse_hover | 1 << 15 | ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15 | False // Nav keyboard/gamepad mode doesn’t disable hover highlight (behave as if NavHighlightItemUnderNav==False). |
no_mark_edited | 1 << 16 | ImGuiItemFlags_NoMarkEdited = 1 << 16 | False // Skip calling MarkItemEdited() |
no_focus | 1 << 17 | ImGuiItemFlags_NoFocus = 1 << 17 | False // [EXPERIMENTAL: Not very well specced] Clicking doesn’t take focus. Automatically sets ImGuiButtonFlags_NoFocus + ImGuiButtonFlags_NoNavFocus in ButtonBehavior(). |
inputable | 1 << 20 | ImGuiItemFlags_Inputable = 1 << 20 | False // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature. |
has_selection_user_data | 1 << 21 | ImGuiItemFlags_HasSelectionUserData = 1 << 21 | False // Set by SetNextItemSelectionUserData() |
is_multi_select | 1 << 22 | ImGuiItemFlags_IsMultiSelect = 1 << 22 | False // Set by SetNextItemSelectionUserData() |
default_ | ItemFlags_AutoClosePopups | ItemFlags_LiveEditOnInputText | ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups | ImGuiItemFlags_LiveEditOnInputText | Please don’t change, use PushItemFlag() instead. |
Obsolete¶
ImGuiItemFlags_SelectableDontClosePopup = !ImGuiItemFlags_AutoClosePopups, // Can’t have a redirect as we inverted the behavior
ItemStatusFlags_ (enum)¶
Status flags for an already submitted item
output: stored in g.LastItemData.StatusFlags
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiItemStatusFlags_None = 0 | |
hovered_rect | 1 << 0 | ImGuiItemStatusFlags_HoveredRect = 1 << 0 | Mouse position is within item rectangle (does NOT mean that the window is in correct z-order and can be hovered!, this is only one part of the most-common IsItemHovered test) |
has_display_rect | 1 << 1 | ImGuiItemStatusFlags_HasDisplayRect = 1 << 1 | g.LastItemData.DisplayRect is valid |
edited | 1 << 2 | ImGuiItemStatusFlags_Edited = 1 << 2 | Value exposed by item was edited in the current frame (should match the bool return value of most widgets) |
toggled_selection | 1 << 3 | ImGuiItemStatusFlags_ToggledSelection = 1 << 3 | Set when Selectable(), TreeNode() reports toggling a selection. We can’t report “Selected”, only state changes, in order to easily handle clipping with less issues. |
toggled_open | 1 << 4 | ImGuiItemStatusFlags_ToggledOpen = 1 << 4 | Set when TreeNode() reports toggling their open state. |
has_deactivated | 1 << 5 | ImGuiItemStatusFlags_HasDeactivated = 1 << 5 | Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag. |
deactivated | 1 << 6 | ImGuiItemStatusFlags_Deactivated = 1 << 6 | Only valid if ImGuiItemStatusFlags_HasDeactivated is set. |
hovered_window | 1 << 7 | ImGuiItemStatusFlags_HoveredWindow = 1 << 7 | Override the HoveredWindow test to allow cross-window hover testing. |
visible | 1 << 8 | ImGuiItemStatusFlags_Visible = 1 << 8 | [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don’t use yet: API/system will change as we refactor Itemadd()). |
has_clip_rect | 1 << 9 | ImGuiItemStatusFlags_HasClipRect = 1 << 9 | g.LastItemData.ClipRect is valid. |
has_shortcut | 1 << 10 | ImGuiItemStatusFlags_HasShortcut = 1 << 10 | g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd(). |
edited_internal | 1 << 11 | ImGuiItemStatusFlags_EditedInternal = 1 << 11 | Similar to ImGuiItemStatusFlags_Edited but bypassing ImGuiItemFlags_NoMarkEdited. |
Additional status + semantic for ImGuiTestEngine¶
HoveredFlagsPrivate_ (enum)¶
Extend ImGuiHoveredFlags_
| Member | Value | C++ | |
|---|---|---|---|
delay_mask_ | HoveredFlags_DelayNone | HoveredFlags_DelayShort | HoveredFlags_DelayNormal | HoveredFlags_NoSharedDelay | ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay | |
allowed_mask_for_is_window_hovered | HoveredFlags_ChildWindows | HoveredFlags_RootWindow | HoveredFlags_AnyWindow | HoveredFlags_NoPopupHierarchy | HoveredFlags_DockHierarchy | HoveredFlags_AllowWhenBlockedByPopup | HoveredFlags_AllowWhenBlockedByActiveItem | HoveredFlags_ForTooltip | HoveredFlags_Stationary | ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_DockHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | |
allowed_mask_for_is_item_hovered | HoveredFlags_AllowWhenBlockedByPopup | HoveredFlags_AllowWhenBlockedByActiveItem | HoveredFlags_AllowWhenOverlapped | HoveredFlags_AllowWhenDisabled | HoveredFlags_NoNavOverride | HoveredFlags_ForTooltip | HoveredFlags_Stationary | HoveredFlags_DelayMask_ | ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_, } |
InputTextFlagsPrivate_ (enum)¶
Extend ImGuiInputTextFlags_
| Member | Value | C++ | |
|---|---|---|---|
multiline | 1 << 26 | ImGuiInputTextFlags_Multiline = 1 << 26 | For internal use by InputTextMultiline() |
temp_input | 1 << 27 | ImGuiInputTextFlags_TempInput = 1 << 27 | For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match. |
localize_decimal_point | 1 << 28 | ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28 | For internal use by InputScalar() and TempInputScalar() |
ButtonFlagsPrivate_ (enum)¶
Extend ImGuiButtonFlags_
| Member | Value | C++ | |
|---|---|---|---|
pressed_on_click | 1 << 4 | ImGuiButtonFlags_PressedOnClick = 1 << 4 | return True on click (mouse down event) |
pressed_on_click_release | 1 << 5 | ImGuiButtonFlags_PressedOnClickRelease = 1 << 5 | [Default] return True on click + release on same item <-- this is what the majority of Button are using |
pressed_on_click_release_anywhere | 1 << 6 | ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6 | return True on click + release even if the release event is not done while hovering the item |
pressed_on_release | 1 << 7 | ImGuiButtonFlags_PressedOnRelease = 1 << 7 | return True on release (default requires click+release). Prior to 2026/03/20 this implied ImGuiButtonFlags_NoHoldingActiveId but they are separate now. |
pressed_on_double_click | 1 << 8 | ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8 | return True on double-click (default requires click+release) |
pressed_on_drag_drop_hold | 1 << 9 | ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9 | return True when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers) |
flatten_children | 1 << 11 | ImGuiButtonFlags_FlattenChildren = 1 << 11 | allow interactions even if a child window is overlapping |
align_text_base_line | 1 << 15 | ImGuiButtonFlags_AlignTextBaseLine = 1 << 15 | vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine |
no_key_mods_allowed | 1 << 16 | ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16 | disable mouse interaction if a key modifier is held |
no_holding_active_id | 1 << 17 | ImGuiButtonFlags_NoHoldingActiveId = 1 << 17 | don’t set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only) |
no_nav_focus | 1 << 18 | ImGuiButtonFlags_NoNavFocus = 1 << 18 | don’t override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don’t requires LastItemData to be set ButtonBehavior(), we can’t poll g.LastItemData.ItemFlags) |
no_hovered_on_focus | 1 << 19 | ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19 | don’t report as hovered when nav focus is on this item |
no_set_key_owner | 1 << 20 | ImGuiButtonFlags_NoSetKeyOwner = 1 << 20 | don’t set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) |
no_test_key_owner | 1 << 21 | ImGuiButtonFlags_NoTestKeyOwner = 1 << 21 | don’t test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) |
no_focus | 1 << 22 | ImGuiButtonFlags_NoFocus = 1 << 22 | [EXPERIMENTAL: Not very well specced]. Don’t focus parent window when clicking. |
pressed_on_mask_ | ButtonFlags_PressedOnClick | ButtonFlags_PressedOnClickRelease | ButtonFlags_PressedOnClickReleaseAnywhere | ButtonFlags_PressedOnRelease | ButtonFlags_PressedOnDoubleClick | ButtonFlags_PressedOnDragDropHold | ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold | |
pressed_on_default_ | ButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease |
SliderFlagsPrivate_ (enum)¶
Extend ImGuiSliderFlags_
| Member | Value | C++ | |
|---|---|---|---|
vertical | 1 << 20 | ImGuiSliderFlags_Vertical = 1 << 20 | Should this slider be orientated vertically? |
read_only | 1 << 21 | ImGuiSliderFlags_ReadOnly = 1 << 21 | Consider using g.NextItemData.ItemFlags |= ImGuiItemFlags_ReadOnly instead. |
SelectableFlagsPrivate_ (enum)¶
Extend ImGuiSelectableFlags_
| Member | Value | C++ | |
|---|---|---|---|
no_holding_active_id | 1 << 20 | ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20 | |
select_on_click | 1 << 22 | ImGuiSelectableFlags_SelectOnClick = 1 << 22 | Override button behavior to react on Click (default is Click+Release) |
select_on_release | 1 << 23 | ImGuiSelectableFlags_SelectOnRelease = 1 << 23 | Override button behavior to react on Release (default is Click+Release) |
span_avail_width | 1 << 24 | ImGuiSelectableFlags_SpanAvailWidth = 1 << 24 | Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus) |
set_nav_id_on_hover | 1 << 25 | ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25 | Set Nav/Focus ID on mouse hover (used by MenuItem) |
no_pad_with_half_spacing | 1 << 26 | ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26 | Disable padding each side with ItemSpacing * 0.5 |
no_set_key_owner | 1 << 27 | ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27 | Don’t set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) |
TreeNodeFlagsPrivate_ (enum)¶
Extend ImGuiTreeNodeFlags_
| Member | Value | C++ | |
|---|---|---|---|
no_nav_focus | 1 << 27 | ImGuiTreeNodeFlags_NoNavFocus = 1 << 27 | Don’t claim nav focus when interacting with this item (#8551) |
clip_label_for_trailing_button | 1 << 28 | ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28 | FIXME-WIP: Hard-coded for CollapsingHeader() |
upside_down_arrow | 1 << 29 | ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29 | FIXME-WIP: Turn Down arrow into an Up arrow, for reversed trees (#6517) |
open_on_mask_ | TreeNodeFlags_OpenOnDoubleClick | TreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow | |
draw_lines_mask_ | TreeNodeFlags_DrawLinesNone | TreeNodeFlags_DrawLinesFull | TreeNodeFlags_DrawLinesToNodes | ImGuiTreeNodeFlags_DrawLinesMask_ = ImGuiTreeNodeFlags_DrawLinesNone | ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DrawLinesToNodes, } |
SeparatorFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiSeparatorFlags_None = 0 | |
horizontal | 1 << 0 | ImGuiSeparatorFlags_Horizontal = 1 << 0 | Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar |
vertical | 1 << 1 | ImGuiSeparatorFlags_Vertical = 1 << 1 | |
span_all_columns | 1 << 2 | ImGuiSeparatorFlags_SpanAllColumns = 1 << 2 | Make separator cover all columns of a legacy Columns() set. |
FocusRequestFlags_ (enum)¶
Flags for FocusWindow(). This is not called ImGuiFocusFlags to avoid confusion with public-facing ImGuiFocusedFlags.
FIXME: Once we finishing replacing more uses of GetTopMostPopupModal()+IsWindowWithinBeginStackOf()
and FindBlockingModal() with this, we may want to change the flag to be opt-out instead of opt-in.
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiFocusRequestFlags_None = 0 | |
restore_focused_child | 1 << 0 | ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0 | Find last focused child (if any) and focus it instead. |
unless_below_modal | 1 << 1 | ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1 | Do not set focus if the window is below a modal. |
TextFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiTextFlags_None = 0 | |
no_width_for_large_clipped_text | 1 << 0 | ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0, } |
TooltipFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiTooltipFlags_None = 0 | |
override_previous | 1 << 1 | ImGuiTooltipFlags_OverridePrevious = 1 << 1 | Clear/ignore previously submitted tooltip (defaults to append) |
LayoutType_ (enum)¶
FIXME: this is in development, not exposed/functional as a generic feature yet.
Horizontal/Vertical enums are fixed to 0/1 so they may be used to index ImVec2
| Member | Value | C++ | |
|---|---|---|---|
horizontal | 0 | ImGuiLayoutType_Horizontal = 0 | |
vertical | 1 | ImGuiLayoutType_Vertical = 1 |
LogFlags_ (enum)¶
Flags for LogBegin() text capturing function
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiLogFlags_None = 0 | |
output_tty | 1 << 0 | ImGuiLogFlags_OutputTTY = 1 << 0 | |
output_file | 1 << 1 | ImGuiLogFlags_OutputFile = 1 << 1 | |
output_buffer | 1 << 2 | ImGuiLogFlags_OutputBuffer = 1 << 2 | |
output_clipboard | 1 << 3 | ImGuiLogFlags_OutputClipboard = 1 << 3 | |
output_mask_ | LogFlags_OutputTTY | LogFlags_OutputFile | LogFlags_OutputBuffer | LogFlags_OutputClipboard | ImGuiLogFlags_OutputMask_ = ImGuiLogFlags_OutputTTY | ImGuiLogFlags_OutputFile | ImGuiLogFlags_OutputBuffer | ImGuiLogFlags_OutputClipboard, } |
Axis (enum)¶
X/Y enums are fixed to 0/1 so they may be used to index ImVec2
| Member | Value | C++ | |
|---|---|---|---|
none | -1 | ImGuiAxis_None = -1 | |
x | 0 | ImGuiAxis_X = 0 | |
y | 1 | ImGuiAxis_Y = 1 |
PlotType (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
lines | 0 | ImGuiPlotType_Lines | |
histogram | 1 | ImGuiPlotType_Histogram, } |
ComboPreviewData (class)¶
Storage data for BeginComboPreview()/EndComboPreview()
| Attribute | C++ | |
|---|---|---|
preview_rect: ImRect | ImRect PreviewRect; | |
backup_cursor_pos: ImVec2 | ImVec2 BackupCursorPos; | |
backup_cursor_max_pos: ImVec2 | ImVec2 BackupCursorMaxPos; | |
backup_cursor_pos_prev_line: ImVec2 | ImVec2 BackupCursorPosPrevLine; | |
backup_prev_line_text_base_offset: float | float BackupPrevLineTextBaseOffset; | |
backup_work_rect_max_x: float | float BackupWorkRectMaxX; | |
backup_content_rect_max_x: float | float BackupContentRectMaxX; |
ComboPreviewData.__init__¶
def __init__(self) -> NoneImGuiComboPreviewData();GroupData (class)¶
Stacked storage data for BeginGroup()/EndGroup()
| Attribute | C++ | |
|---|---|---|
window_id: ID | ImGuiID WindowID; | |
backup_cursor_pos: ImVec2 | ImVec2 BackupCursorPos; | |
backup_cursor_max_pos: ImVec2 | ImVec2 BackupCursorMaxPos; | |
backup_cursor_pos_prev_line: ImVec2 | ImVec2 BackupCursorPosPrevLine; | |
backup_indent: ImVec1 | ImVec1 BackupIndent; | |
backup_group_offset: ImVec1 | ImVec1 BackupGroupOffset; | |
backup_curr_line_size: ImVec2 | ImVec2 BackupCurrLineSize; | |
backup_curr_line_text_base_offset: float | float BackupCurrLineTextBaseOffset; | |
backup_active_id_is_alive: ID | ImGuiID BackupActiveIdIsAlive; | |
backup_any_id_has_been_edited_this_frame: bool | bool BackupAnyIdHasBeenEditedThisFrame; | |
backup_deactivated_id_is_alive: bool | bool BackupDeactivatedIdIsAlive; | |
backup_hovered_id_is_alive: bool | bool BackupHoveredIdIsAlive; | |
backup_is_same_line: bool | bool BackupIsSameLine; | |
emit_item: bool | bool EmitItem; |
GroupData.__init__¶
def __init__(self, window_id: ID = ID(), backup_cursor_pos: Optional[ImVec2Like] = None, backup_cursor_max_pos: Optional[ImVec2Like] = None, backup_cursor_pos_prev_line: Optional[ImVec2Like] = None, backup_indent: Optional[ImVec1] = None, backup_group_offset: Optional[ImVec1] = None, backup_curr_line_size: Optional[ImVec2Like] = None, backup_curr_line_text_base_offset: float = float(), backup_active_id_is_alive: ID = ID(), backup_any_id_has_been_edited_this_frame: bool = bool(), backup_deactivated_id_is_alive: bool = bool(), backup_hovered_id_is_alive: bool = bool(), backup_is_same_line: bool = bool(), emit_item: bool = bool()) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* BackupCursorPos: ImVec2()
* BackupCursorMaxPos: ImVec2()
* BackupCursorPosPrevLine: ImVec2()
* BackupIndent: ImVec1()
* BackupGroupOffset: ImVec1()
* BackupCurrLineSize: ImVec2()
MenuColumns (class)¶
Simple column measurement, currently used for MenuItem() only.. This is very short-sighted/throw-away code and NOT a generic helper.
| Attribute | C++ | |
|---|---|---|
total_width: ImU32 | ImU32 TotalWidth; | |
next_total_width: ImU32 | ImU32 NextTotalWidth; | |
spacing: ImU16 | ImU16 Spacing; | |
offset_icon: ImU16 | ImU16 OffsetIcon; | Always zero for now |
offset_label: ImU16 | ImU16 OffsetLabel; | Offsets are locked in Update() |
offset_shortcut: ImU16 | ImU16 OffsetShortcut; | |
offset_mark: ImU16 | ImU16 OffsetMark; | |
widths: np.ndarray | ImU16 Widths[4]; | ndarray[type=ImU16, size=4] # Width of: Icon, Label, Shortcut, Mark (accumulators for current frame) |
MenuColumns.__init__¶
def __init__(self) -> NoneImGuiMenuColumns();MenuColumns.update¶
def update(self, spacing: float, window_reappearing: bool) -> Nonevoid Update(float spacing, bool window_reappearing);(private API)
MenuColumns.decl_columns¶
def decl_columns(self, w_icon: float, w_label: float, w_shortcut: float, w_mark: float) -> floatfloat DeclColumns(float w_icon, float w_label, float w_shortcut, float w_mark);(private API)
MenuColumns.calc_next_total_width¶
def calc_next_total_width(self, update_offsets: bool) -> Nonevoid CalcNextTotalWidth(bool update_offsets);(private API)
InputTextDeactivatedState (class)¶
Internal temporary state for deactivating InputText() instances.
Store as part of ImGuiDeactivatedItemData?
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | widget id owning the text state (which just got deactivated) |
elapse_frame: int | int ElapseFrame; | |
text_a: ImVector_char | ImVector<char> TextA; | text buffer |
InputTextDeactivatedState.__init__¶
def __init__(self) -> NoneImGuiInputTextDeactivatedState();InputTextDeactivatedState.clear_free_memory¶
def clear_free_memory(self) -> Nonevoid ClearFreeMemory();(private API)
InputTextState (class)¶
Internal state of the currently focused/edited text input box
For a given item ID, access with ImGui::GetInputTextState()
| Attribute | C++ | |
|---|---|---|
ctx: Context | ImGuiContext* Ctx; | parent UI context (needs to be set explicitly by parent). |
flags: InputTextFlags | ImGuiInputTextFlags Flags; | copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set. |
id_: ID | ImGuiID ID; | widget id owning the text state |
text_len: int | int TextLen; | UTF-8 length of the string in TextA (in bytes) |
text_src: str | const char* TextSrc; | == TextA.Data unless read-only, in which case == buf passed to InputText(). For _ReadOnly fields, pointer will be null outside the InputText() call. # (const) |
text_a: ImVector_char | ImVector<char> TextA; | main UTF8 buffer. TextA.Size is a buffer size! Should always be >= buf_size passed by user (and of course >= CurLenA + 1). |
text_to_revert_to: ImVector_char | ImVector<char> TextToRevertTo; | value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered) |
callback_text_backup: ImVector_char | ImVector<char> CallbackTextBackup; | temporary storage for callback to support automatic reconcile of undo-stack |
buf_capacity: int | int BufCapacity; | end-user buffer capacity (include zero terminator) |
scroll: ImVec2 | ImVec2 Scroll; | horizontal offset (managed manually) + vertical scrolling (pulled from child window’s own Scroll.y) |
line_count: int | int LineCount; | last line count (solely for debugging) |
wrap_width: float | float WrapWidth; | word-wrapping width |
cursor_anim: float | float CursorAnim; | timer for cursor blink, reset on every user action so the cursor reappears immediately |
cursor_follow: bool | bool CursorFollow; | set when we want scrolling to follow the current cursor position (not always!) |
cursor_center_y: bool | bool CursorCenterY; | set when we want scrolling to be centered over the cursor position (while resizing a word-wrapping field) |
selected_all_mouse_lock: bool | bool SelectedAllMouseLock; | after a double-click to select all, we ignore further mouse drags to update selection |
edited_before: bool | bool EditedBefore; | edited since activated |
edited_this_frame: bool | bool EditedThisFrame; | edited this frame |
validated_this_frame: bool | bool ValidatedThisFrame; | |
want_reload_user_buf: bool | bool WantReloadUserBuf; | force a reload of user buf so it may be modified externally. may be automatic in future version. |
last_move_direction_lr: ImS8 | ImS8 LastMoveDirectionLR; | ImGuiDir_Left or ImGuiDir_Right. track last movement direction so when cursor cross over a word-wrapping boundaries we can display it on either line depending on last move.s |
reload_selection_start: int | int ReloadSelectionStart; | |
reload_selection_end: int | int ReloadSelectionEnd; |
InputTextState.__init__¶
def __init__(self) -> NoneImGuiInputTextState();InputTextState.clear_text¶
def clear_text(self) -> Nonevoid ClearText();(private API)
InputTextState.clear_free_memory¶
def clear_free_memory(self) -> Nonevoid ClearFreeMemory();(private API)
InputTextState.on_key_pressed¶
def on_key_pressed(self, key: int) -> Nonevoid OnKeyPressed(int key);(private API)
Cannot be inline because we call in code in stb_textedit.h implementation
InputTextState.on_char_pressed¶
def on_char_pressed(self, c: int) -> Nonevoid OnCharPressed(unsigned int c);(private API)
InputTextState.get_preferred_offset_x¶
def get_preferred_offset_x(self) -> floatfloat GetPreferredOffsetX() const;(private API)
InputTextState.get_text¶
def get_text(self) -> strconst char* GetText();(private API)
InputTextState.cursor_anim_reset¶
def cursor_anim_reset(self) -> Nonevoid CursorAnimReset();(private API)
InputTextState.cursor_clamp¶
def cursor_clamp(self) -> Nonevoid CursorClamp();(private API)
InputTextState.has_selection¶
def has_selection(self) -> boolbool HasSelection() const;(private API)
InputTextState.clear_selection¶
def clear_selection(self) -> Nonevoid ClearSelection();(private API)
InputTextState.get_cursor_pos¶
def get_cursor_pos(self) -> intint GetCursorPos() const;(private API)
InputTextState.get_selection_start¶
def get_selection_start(self) -> intint GetSelectionStart() const;(private API)
InputTextState.get_selection_end¶
def get_selection_end(self) -> intint GetSelectionEnd() const;(private API)
InputTextState.set_selection¶
def set_selection(self, start: int, end: int) -> Nonevoid SetSelection(int start, int end);(private API)
InputTextState.select_all¶
def select_all(self) -> Nonevoid SelectAll();(private API)
InputTextState.reload_user_buf_and_select_all¶
def reload_user_buf_and_select_all(self) -> Nonevoid ReloadUserBufAndSelectAll();(private API)
InputTextState.reload_user_buf_and_keep_selection¶
def reload_user_buf_and_keep_selection(self) -> Nonevoid ReloadUserBufAndKeepSelection();(private API)
InputTextState.reload_user_buf_and_move_to_end¶
def reload_user_buf_and_move_to_end(self) -> Nonevoid ReloadUserBufAndMoveToEnd();(private API)
WindowRefreshFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiWindowRefreshFlags_None = 0 | |
try_to_avoid_refresh | 1 << 0 | ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0 | [EXPERIMENTAL] Try to keep existing contents, USER MUST NOT HONOR BEGIN() RETURNING FALSE AND NOT APPEND. |
refresh_on_hover | 1 << 1 | ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1 | [EXPERIMENTAL] Always refresh on hover |
refresh_on_focus | 1 << 2 | ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2 | [EXPERIMENTAL] Always refresh on focus |
WindowBgClickFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiWindowBgClickFlags_None = 0 | |
move | 1 << 0 | ImGuiWindowBgClickFlags_Move = 1 << 0 | Click on bg/None + drag to move window. Cleared by default when using io.ConfigWindowsMoveFromTitleBarOnly. |
NextWindowDataFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiNextWindowDataFlags_None = 0 | |
has_pos | 1 << 0 | ImGuiNextWindowDataFlags_HasPos = 1 << 0 | |
has_size | 1 << 1 | ImGuiNextWindowDataFlags_HasSize = 1 << 1 | |
has_content_size | 1 << 2 | ImGuiNextWindowDataFlags_HasContentSize = 1 << 2 | |
has_collapsed | 1 << 3 | ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3 | |
has_size_constraint | 1 << 4 | ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4 | |
has_focus | 1 << 5 | ImGuiNextWindowDataFlags_HasFocus = 1 << 5 | |
has_bg_alpha | 1 << 6 | ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6 | |
has_scroll | 1 << 7 | ImGuiNextWindowDataFlags_HasScroll = 1 << 7 | |
has_window_flags | 1 << 8 | ImGuiNextWindowDataFlags_HasWindowFlags = 1 << 8 | |
has_child_flags | 1 << 9 | ImGuiNextWindowDataFlags_HasChildFlags = 1 << 9 | |
has_refresh_policy | 1 << 10 | ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 10 | |
has_viewport | 1 << 11 | ImGuiNextWindowDataFlags_HasViewport = 1 << 11 | |
has_dock | 1 << 12 | ImGuiNextWindowDataFlags_HasDock = 1 << 12 | |
has_window_class | 1 << 13 | ImGuiNextWindowDataFlags_HasWindowClass = 1 << 13, } |
NextWindowData (class)¶
Storage for SetNexWindow** functions
| Attribute | C++ | |
|---|---|---|
has_flags: NextWindowDataFlags | ImGuiNextWindowDataFlags HasFlags; | |
pos_cond: Cond | ImGuiCond PosCond; | |
size_cond: Cond | ImGuiCond SizeCond; | |
collapsed_cond: Cond | ImGuiCond CollapsedCond; | |
dock_cond: Cond | ImGuiCond DockCond; | |
pos_val: ImVec2 | ImVec2 PosVal; | |
pos_pivot_val: ImVec2 | ImVec2 PosPivotVal; | |
size_val: ImVec2 | ImVec2 SizeVal; | |
content_size_val: ImVec2 | ImVec2 ContentSizeVal; | |
scroll_val: ImVec2 | ImVec2 ScrollVal; | |
window_flags_set: WindowFlags | ImGuiWindowFlags WindowFlagsSet; | Flags to set. Use SetNextWindowFlags()! |
window_flags_clear: WindowFlags | ImGuiWindowFlags WindowFlagsClear; | |
child_flags_set: ChildFlags | ImGuiChildFlags ChildFlagsSet; | Flags to set. Use SetNextWindowChildFlags(). |
child_flags_clear: ChildFlags | ImGuiChildFlags ChildFlagsClear; | |
pos_undock: bool | bool PosUndock; | |
collapsed_val: bool | bool CollapsedVal; | |
size_constraint_rect: ImRect | ImRect SizeConstraintRect; | |
size_callback: SizeCallback | ImGuiSizeCallback SizeCallback; | |
size_callback_user_data: Any | void* SizeCallbackUserData; | |
bg_alpha_val: float | float BgAlphaVal; | Override background alpha |
viewport_id: ID | ImGuiID ViewportId; | |
dock_id: ID | ImGuiID DockId; | |
window_class: WindowClass | ImGuiWindowClass WindowClass; | |
menu_bar_offset_min_val: ImVec2 | ImVec2 MenuBarOffsetMinVal; | (Always on) This is not exposed publicly, so we don’t clear it and it doesn’t have a corresponding flag (could we? for consistency?) |
refresh_flags_val: WindowRefreshFlags | ImGuiWindowRefreshFlags RefreshFlagsVal; |
NextWindowData.__init__¶
def __init__(self) -> NoneImGuiNextWindowData();NextWindowData.clear_flags¶
def clear_flags(self) -> Noneinline void ClearFlags();(private API)
NextItemDataFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiNextItemDataFlags_None = 0 | |
has_width | 1 << 0 | ImGuiNextItemDataFlags_HasWidth = 1 << 0 | |
has_open | 1 << 1 | ImGuiNextItemDataFlags_HasOpen = 1 << 1 | |
has_shortcut | 1 << 2 | ImGuiNextItemDataFlags_HasShortcut = 1 << 2 | |
has_ref_val | 1 << 3 | ImGuiNextItemDataFlags_HasRefVal = 1 << 3 | |
has_storage_id | 1 << 4 | ImGuiNextItemDataFlags_HasStorageID = 1 << 4 | |
has_color_marker | 1 << 5 | ImGuiNextItemDataFlags_HasColorMarker = 1 << 5, } |
NextItemData (class)¶
| Attribute | C++ | |
|---|---|---|
has_flags: NextItemDataFlags | ImGuiNextItemDataFlags HasFlags; | Called HasFlags instead of Flags to avoid mistaking this |
item_flags_set: ItemFlags | ImGuiItemFlags ItemFlagsSet; | Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData. |
focus_scope_id: ID | ImGuiID FocusScopeId; | Set by SetNextItemSelectionUserData() |
selection_user_data: SelectionUserData | ImGuiSelectionUserData SelectionUserData; | Set by SetNextItemSelectionUserData() (note that None/0 is a valid value, we use -1 == ImGuiSelectionUserData_Invalid to mark invalid values) |
width: float | float Width; | Set by SetNextItemWidth() |
shortcut: KeyChord | ImGuiKeyChord Shortcut; | Set by SetNextItemShortcut() |
shortcut_flags: InputFlags | ImGuiInputFlags ShortcutFlags; | Set by SetNextItemShortcut() |
open_val: bool | bool OpenVal; | Set by SetNextItemOpen() |
open_cond: ImU8 | ImU8 OpenCond; | Set by SetNextItemOpen() |
ref_val: DataTypeStorage | ImGuiDataTypeStorage RefVal; | Not exposed yet, for ImGuiInputTextFlags_ParseEmptyAsRefVal |
storage_id: ID | ImGuiID StorageId; | Set by SetNextItemStorageID() |
color_marker: ImU32 | ImU32 ColorMarker; | Set by SetNextItemColorMarker(). Not exposed yet, supported by DragScalar,SliderScalar and for ImGuiSliderFlags_ColorMarkers. |
NextItemData.__init__¶
def __init__(self) -> NoneImGuiNextItemData();NextItemData.clear_flags¶
def clear_flags(self) -> Noneinline void ClearFlags();(private API)
Also cleared manually by ItemAdd()!
LastItemData (class)¶
Status storage for the last submitted item
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
item_flags: ItemFlags | ImGuiItemFlags ItemFlags; | See ImGuiItemFlags_ (called ‘InFlags’ before v1.91.4). |
status_flags: ItemStatusFlags | ImGuiItemStatusFlags StatusFlags; | See ImGuiItemStatusFlags_ |
rect: ImRect | ImRect Rect; | Full rectangle |
nav_rect: ImRect | ImRect NavRect; | Navigation scoring rectangle (not displayed) |
display_rect: ImRect | ImRect DisplayRect; | Display rectangle. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) is set. |
clip_rect: ImRect | ImRect ClipRect; | Clip rectangle at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasClipRect) is set.. |
shortcut: KeyChord | ImGuiKeyChord Shortcut; | Shortcut at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasShortcut) is set.. |
LastItemData.__init__¶
def __init__(self) -> NoneImGuiLastItemData();TreeNodeStackData (class)¶
Store data emitted by TreeNode() for usage by TreePop()
To implement ImGuiTreeNodeFlags_NavLeftJumpsToParent: store the minimum amount of data which we can’t infer in TreePop(), to perform the equivalent of NavApplyItemToResult().
Only stored when the node is a potential candidate for landing on a Left arrow jump.
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
tree_flags: TreeNodeFlags | ImGuiTreeNodeFlags TreeFlags; | |
item_flags: ItemFlags | ImGuiItemFlags ItemFlags; | Used for nav landing |
nav_rect: ImRect | ImRect NavRect; | Used for nav landing |
draw_lines_x1: float | float DrawLinesX1; | |
draw_lines_to_nodes_y2: float | float DrawLinesToNodesY2; | |
draw_lines_table_column: TableColumnIdx | ImGuiTableColumnIdx DrawLinesTableColumn; |
TreeNodeStackData.__init__¶
def __init__(self, id_: ID = ID(), tree_flags: TreeNodeFlags = TreeNodeFlags(), item_flags: ItemFlags = ItemFlags(), nav_rect: Optional[ImRect] = None, draw_lines_x1: float = float(), draw_lines_to_nodes_y2: float = float(), draw_lines_table_column: Optional[TableColumnIdx] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* NavRect: ImRect()
* DrawLinesTableColumn: TableColumnIdx()
ErrorRecoveryState (class)¶
sizeof() = 20
| Attribute | C++ | |
|---|---|---|
size_of_window_stack: int | short SizeOfWindowStack; | |
size_of_id_stack: int | short SizeOfIDStack; | |
size_of_tree_stack: int | short SizeOfTreeStack; | |
size_of_color_stack: int | short SizeOfColorStack; | |
size_of_style_var_stack: int | short SizeOfStyleVarStack; | |
size_of_font_stack: int | short SizeOfFontStack; | |
size_of_focus_scope_stack: int | short SizeOfFocusScopeStack; | |
size_of_group_stack: int | short SizeOfGroupStack; | |
size_of_item_flags_stack: int | short SizeOfItemFlagsStack; | |
size_of_begin_popup_stack: int | short SizeOfBeginPopupStack; | |
size_of_disabled_stack: int | short SizeOfDisabledStack; |
ErrorRecoveryState.__init__¶
def __init__(self) -> NoneImGuiErrorRecoveryState();WindowStackData (class)¶
Storage for each window pushed into the stack.
| Attribute | C++ | |
|---|---|---|
window: Window | ImGuiWindow* Window; | |
parent_last_item_data_backup: LastItemData | ImGuiLastItemData ParentLastItemDataBackup; | |
stack_sizes_in_begin: ErrorRecoveryState | ImGuiErrorRecoveryState StackSizesInBegin; | Store size of various stacks for asserting |
disabled_override_reenable: bool | bool DisabledOverrideReenable; | Non-child window override disabled flag |
disabled_override_reenable_alpha_backup: float | float DisabledOverrideReenableAlphaBackup; | |
parent_last_combo_preview_rect: ImRect | ImRect ParentLastComboPreviewRect; |
WindowStackData.__init__¶
def __init__(self, parent_last_item_data_backup: Optional[LastItemData] = None, stack_sizes_in_begin: Optional[ErrorRecoveryState] = None, disabled_override_reenable: bool = bool(), disabled_override_reenable_alpha_backup: float = float(), parent_last_combo_preview_rect: Optional[ImRect] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* ParentLastItemDataBackup: LastItemData()
* StackSizesInBegin: ErrorRecoveryState()
* ParentLastComboPreviewRect: ImRect()
ShrinkWidthItem (class)¶
| Attribute | C++ | |
|---|---|---|
index: int | int Index; | |
width: float | float Width; | |
initial_width: float | float InitialWidth; |
ShrinkWidthItem.__init__¶
def __init__(self, index: int = int(), width: float = float(), initial_width: float = float()) -> NoneAuto-generated default constructor with named params
PtrOrIndex (class)¶
| Attribute | C++ | |
|---|---|---|
ptr: Any | void* Ptr; | Either field can be set, not both. e.g. Dock node tab bars are loose while BeginTabBar() ones are in a pool. |
index: int | int Index; | Usually index in a main pool. |
PtrOrIndex.__init__¶
@overload
def __init__(self, ptr: Any) -> None
@overload
def __init__(self, index: int) -> NoneImGuiPtrOrIndex(void* ptr);
ImGuiPtrOrIndex(int index);DeactivatedItemData (class)¶
Data used by IsItemDeactivated()/IsItemDeactivatedAfterEdit() functions
Also see ImGuiInputTextDeactivatedState which is an extension for this for InputText()
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
elapse_frame: int | int ElapseFrame; | |
has_been_edited_before: bool | bool HasBeenEditedBefore; | |
is_alive: bool | bool IsAlive; |
DeactivatedItemData.__init__¶
def __init__(self, id_: ID = ID(), elapse_frame: int = int(), has_been_edited_before: bool = bool(), is_alive: bool = bool()) -> NoneAuto-generated default constructor with named params
Popup support¶
PopupPositionPolicy (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
default | 0 | ImGuiPopupPositionPolicy_Default | |
combo_box | 1 | ImGuiPopupPositionPolicy_ComboBox | |
tooltip | 2 | ImGuiPopupPositionPolicy_Tooltip, } |
PopupData (class)¶
Storage for popup stacks (g.OpenPopupStack and g.BeginPopupStack)
| Attribute | C++ | |
|---|---|---|
popup_id: ID | ImGuiID PopupId; | Set on OpenPopup() |
window: Window | ImGuiWindow* Window; | Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() |
restore_nav_window: Window | ImGuiWindow* RestoreNavWindow; | Set on OpenPopup(), a NavWindow that will be restored on popup close |
parent_nav_layer: int | int ParentNavLayer; | Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as “not any of layers” value |
open_frame_count: int | int OpenFrameCount; | Set on OpenPopup() |
open_parent_id: ID | ImGuiID OpenParentId; | Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) |
open_popup_pos: ImVec2 | ImVec2 OpenPopupPos; | Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse) |
open_mouse_pos: ImVec2 | ImVec2 OpenMousePos; | Set on OpenPopup(), copy of mouse position at the time of opening popup |
PopupData.__init__¶
def __init__(self) -> NoneImGuiPopupData();Inputs support¶
[Internal] Key ranges¶
[Internal] Named shortcuts for Navigation
InputEventType (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiInputEventType_None = 0 | |
mouse_pos | 1 | ImGuiInputEventType_MousePos | |
mouse_wheel | 2 | ImGuiInputEventType_MouseWheel | |
mouse_button | 3 | ImGuiInputEventType_MouseButton | |
mouse_viewport | 4 | ImGuiInputEventType_MouseViewport | |
key | 5 | ImGuiInputEventType_Key | |
text | 6 | ImGuiInputEventType_Text | |
focus | 7 | ImGuiInputEventType_Focus | |
count | 8 | ImGuiInputEventType_COUNT |
InputSource (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiInputSource_None = 0 | |
mouse | 1 | ImGuiInputSource_Mouse | Note: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them. |
keyboard | 2 | ImGuiInputSource_Keyboard | |
gamepad | 3 | ImGuiInputSource_Gamepad | |
count | 4 | ImGuiInputSource_COUNT |
InputEventMousePos (class)¶
| Attribute | C++ | |
|---|---|---|
pos_x: float | float PosX, | |
pos_y: float | PosY; | |
mouse_source: MouseSource | ImGuiMouseSource MouseSource; |
InputEventMousePos.__init__¶
def __init__(self, pos_x: float = float(), pos_y: float = float(), mouse_source: Optional[MouseSource] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If MouseSource is None, then its default value will be: MouseSource()
InputEventMouseWheel (class)¶
| Attribute | C++ | |
|---|---|---|
wheel_x: float | float WheelX, | |
wheel_y: float | WheelY; | |
mouse_source: MouseSource | ImGuiMouseSource MouseSource; |
InputEventMouseWheel.__init__¶
def __init__(self, wheel_x: float = float(), wheel_y: float = float(), mouse_source: Optional[MouseSource] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If MouseSource is None, then its default value will be: MouseSource()
InputEventMouseButton (class)¶
| Attribute | C++ | |
|---|---|---|
button: int | int Button; | |
down: bool | bool Down; | |
mouse_source: MouseSource | ImGuiMouseSource MouseSource; |
InputEventMouseButton.__init__¶
def __init__(self, button: int = int(), down: bool = bool(), mouse_source: Optional[MouseSource] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If MouseSource is None, then its default value will be: MouseSource()
InputEventMouseViewport (class)¶
| Attribute | C++ | |
|---|---|---|
hovered_viewport_id: ID | ImGuiID HoveredViewportID; |
InputEventMouseViewport.__init__¶
def __init__(self, hovered_viewport_id: ID = ID()) -> NoneAuto-generated default constructor with named params
InputEventKey (class)¶
| Attribute | C++ | |
|---|---|---|
key: Key | ImGuiKey Key; | |
down: bool | bool Down; | |
analog_value: float | float AnalogValue; |
InputEventKey.__init__¶
def __init__(self, key: Key = Key(), down: bool = bool(), analog_value: float = float()) -> NoneAuto-generated default constructor with named params
InputEventText (class)¶
| Attribute | C++ | |
|---|---|---|
char: int | unsigned int Char; |
InputEventText.__init__¶
def __init__(self) -> NoneAuto-generated default constructor
InputEventAppFocused (class)¶
| Attribute | C++ | |
|---|---|---|
focused: bool | bool Focused; |
InputEventAppFocused.__init__¶
def __init__(self, focused: bool = bool()) -> NoneAuto-generated default constructor with named params
InputEvent (class)¶
| Attribute | C++ | |
|---|---|---|
type: InputEventType | ImGuiInputEventType Type; | |
source: InputSource | ImGuiInputSource Source; | |
event_id: ImU32 | ImU32 EventId; | Unique, sequential increasing integer to identify an event (if you need to correlate them to other data). |
added_by_test_engine: bool | bool AddedByTestEngine; |
InputEvent.__init__¶
def __init__(self) -> NoneImGuiInputEvent();KeyRoutingData (class)¶
Routing table entry (sizeof() == 16 bytes)
| Attribute | C++ | |
|---|---|---|
next_entry_index: KeyRoutingIndex | ImGuiKeyRoutingIndex NextEntryIndex; | |
mods: ImU16 | ImU16 Mods; | Technically we’d only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits. |
routing_curr_score: ImU16 | ImU16 RoutingCurrScore; | [DEBUG] For debug display |
routing_next_score: ImU16 | ImU16 RoutingNextScore; | Lower is better (0: perfect score) |
routing_curr: ID | ImGuiID RoutingCurr; | |
routing_next: ID | ImGuiID RoutingNext; |
KeyRoutingData.__init__¶
def __init__(self) -> NoneImGuiKeyRoutingData();KeyRoutingTable (class)¶
Routing table: maintain a desired owner for each possible key-chord (key + mods), and setup owner in NewFrame() when mods are matching.
Stored in main context (1 instance)
| Attribute | C++ | |
|---|---|---|
entries: ImVector_KeyRoutingData | ImVector<ImGuiKeyRoutingData> Entries; | |
entries_next: ImVector_KeyRoutingData | ImVector<ImGuiKeyRoutingData> EntriesNext; | Double-buffer to avoid reallocation (could use a shared buffer) |
KeyRoutingTable.__init__¶
def __init__(self) -> NoneImGuiKeyRoutingTable();KeyRoutingTable.clear¶
def clear(self) -> Nonevoid Clear();(private API)
KeyOwnerData (class)¶
This extends ImGuiKeyData but only for named keys (legacy keys don’t support the new features)
Stored in main context (1 per named key). In the future it might be merged into ImGuiKeyData.
| Attribute | C++ | |
|---|---|---|
owner_curr: ID | ImGuiID OwnerCurr; | |
owner_next: ID | ImGuiID OwnerNext; | |
lock_this_frame: bool | bool LockThisFrame; | Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame. |
lock_until_release: bool | bool LockUntilRelease; | Reading this key requires explicit owner id (until key is released). Set by ImGuiInputFlags_LockUntilRelease. When this is True LockThisFrame is always True as well. |
KeyOwnerData.__init__¶
def __init__(self) -> NoneImGuiKeyOwnerData();InputFlagsPrivate_ (enum)¶
Extend ImGuiInputFlags_
Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner()
Don’t mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)
| Member | Value | C++ | |
|---|---|---|---|
repeat_rate_default | 1 << 1 | ImGuiInputFlags_RepeatRateDefault = 1 << 1 | Repeat rate: Regular (default) |
repeat_rate_nav_move | 1 << 2 | ImGuiInputFlags_RepeatRateNavMove = 1 << 2 | Repeat rate: Fast |
repeat_rate_nav_tweak | 1 << 3 | ImGuiInputFlags_RepeatRateNavTweak = 1 << 3 | Repeat rate: Faster |
repeat_until_release | 1 << 4 | ImGuiInputFlags_RepeatUntilRelease = 1 << 4 | Stop repeating when released (default for all functions except Shortcut). This only exists to allow overriding Shortcut() default behavior. |
repeat_until_key_mods_change | 1 << 5 | ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5 | Stop repeating when released OR if keyboard mods are changed (default for Shortcut) |
repeat_until_key_mods_change_from_none | 1 << 6 | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6 | Stop repeating when released OR if keyboard mods are leaving the None state. Allows going from Mod+Key to Key by releasing Mod. |
repeat_until_other_key_press | 1 << 7 | ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7 | Stop repeating when released OR if any other keyboard key is pressed during the repeat |
lock_this_frame | 1 << 20 | ImGuiInputFlags_LockThisFrame = 1 << 20 | Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame. |
lock_until_release | 1 << 21 | ImGuiInputFlags_LockUntilRelease = 1 << 21 | Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released. |
cond_hovered | 1 << 22 | ImGuiInputFlags_CondHovered = 1 << 22 | Only set if item is hovered (default to both) |
cond_active | 1 << 23 | ImGuiInputFlags_CondActive = 1 << 23 | Only set if item is active (default to both) |
cond_default_ | InputFlags_CondHovered | InputFlags_CondActive | ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive | |
repeat_rate_mask_ | InputFlags_RepeatRateDefault | InputFlags_RepeatRateNavMove | InputFlags_RepeatRateNavTweak | ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak | |
repeat_until_mask_ | InputFlags_RepeatUntilRelease | InputFlags_RepeatUntilKeyModsChange | InputFlags_RepeatUntilKeyModsChangeFromNone | InputFlags_RepeatUntilOtherKeyPress | ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress | |
repeat_mask_ | InputFlags_Repeat | InputFlags_RepeatRateMask_ | InputFlags_RepeatUntilMask_ | ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_ | |
cond_mask_ | InputFlags_CondHovered | InputFlags_CondActive | ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive | |
route_type_mask_ | InputFlags_RouteActive | InputFlags_RouteFocused | InputFlags_RouteGlobal | InputFlags_RouteAlways | ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways | |
route_options_mask_ | InputFlags_RouteOverFocused | InputFlags_RouteOverActive | InputFlags_RouteUnlessBgFocused | InputFlags_RouteFromRootWindow | ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow | |
supported_by_is_key_pressed | InputFlags_RepeatMask_ | ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_ | |
supported_by_is_mouse_clicked | InputFlags_Repeat | ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat | |
supported_by_shortcut | InputFlags_RepeatMask_ | InputFlags_RouteTypeMask_ | InputFlags_RouteOptionsMask_ | ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | |
supported_by_set_next_item_shortcut | InputFlags_RepeatMask_ | InputFlags_RouteTypeMask_ | InputFlags_RouteOptionsMask_ | InputFlags_Tooltip | ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip | |
supported_by_set_key_owner | InputFlags_LockThisFrame | InputFlags_LockUntilRelease | ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease | |
supported_by_set_item_key_owner | InputFlags_SupportedBySetKeyOwner | InputFlags_CondMask_ | ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_, } |
Clipper support¶
ListClipperRange (class)¶
Note that Max is exclusive, so perhaps should be using a Begin/End convention.
| Attribute | C++ | |
|---|---|---|
min: int | int Min; | |
max: int | int Max; | |
pos_to_index_convert: bool | bool PosToIndexConvert; | Begin/End are absolute position (will be converted to indices later) |
pos_to_index_offset_min: ImS8 | ImS8 PosToIndexOffsetMin; | Add to Min after converting to indices |
pos_to_index_offset_max: ImS8 | ImS8 PosToIndexOffsetMax; | Add to Min after converting to indices |
ListClipperRange.from_indices¶
@staticmethod
def from_indices(min: int, max: int) -> ListClipperRangestatic ImGuiListClipperRange FromIndices(int min, int max);(private API)
ListClipperRange.from_positions¶
@staticmethod
def from_positions(y1: float, y2: float, off_min: int, off_max: int) -> ListClipperRangestatic ImGuiListClipperRange FromPositions(float y1, float y2, int off_min, int off_max);(private API)
ListClipperRange.__init__¶
def __init__(self, min: int = int(), max: int = int(), pos_to_index_convert: bool = bool(), pos_to_index_offset_min: ImS8 = ImS8(), pos_to_index_offset_max: ImS8 = ImS8()) -> NoneAuto-generated default constructor with named params
ListClipperData (class)¶
Temporary clipper data, buffers shared/reused between instances
| Attribute | C++ | |
|---|---|---|
list_clipper: ListClipper | ImGuiListClipper* ListClipper; | |
lossyness_offset: float | float LossynessOffset; | |
step_no: int | int StepNo; | |
items_frozen: int | int ItemsFrozen; | |
ranges: ImVector_ListClipperRange | ImVector<ImGuiListClipperRange> Ranges; |
ListClipperData.__init__¶
def __init__(self) -> NoneImGuiListClipperData();ListClipperData.reset¶
def reset(self, clipper: ListClipper) -> Nonevoid Reset(ImGuiListClipper* clipper);(private API)
Navigation support¶
ActivateFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiActivateFlags_None = 0 | |
prefer_input | 1 << 0 | ImGuiActivateFlags_PreferInput = 1 << 0 | Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key. |
prefer_tweak | 1 << 1 | ImGuiActivateFlags_PreferTweak = 1 << 1 | Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used. |
try_to_preserve_state | 1 << 2 | ImGuiActivateFlags_TryToPreserveState = 1 << 2 | Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection) |
from_tabbing | 1 << 3 | ImGuiActivateFlags_FromTabbing = 1 << 3 | Activation requested by a tabbing request (ImGuiNavMoveFlags_IsTabbing) |
from_shortcut | 1 << 4 | ImGuiActivateFlags_FromShortcut = 1 << 4 | Activation requested by an item shortcut via SetNextItemShortcut() function. |
from_focus_api | 1 << 5 | ImGuiActivateFlags_FromFocusApi = 1 << 5 | Activation requested by an api request (ImGuiNavMoveFlags_FocusApi) |
ScrollFlags_ (enum)¶
Early work-in-progress API for ScrollToItem()
FIXME: Missing flags to request making both edges visible when possible.
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiScrollFlags_None = 0 | |
keep_visible_edge_x | 1 << 0 | ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0 | If item is not visible: scroll as little as possible on X axis to bring item back into view [default for X axis] |
keep_visible_edge_y | 1 << 1 | ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1 | If item is not visible: scroll as little as possible on Y axis to bring item back into view [default for Y axis for windows that are already visible] |
keep_visible_center_x | 1 << 2 | ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2 | If item is not visible: scroll to make the item centered on X axis [rarely used] |
keep_visible_center_y | 1 << 3 | ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3 | If item is not visible: scroll to make the item centered on Y axis |
always_center_x | 1 << 4 | ImGuiScrollFlags_AlwaysCenterX = 1 << 4 | Always center the result item on X axis [rarely used] |
always_center_y | 1 << 5 | ImGuiScrollFlags_AlwaysCenterY = 1 << 5 | Always center the result item on Y axis [default for Y axis for appearing window) |
no_scroll_parent | 1 << 6 | ImGuiScrollFlags_NoScrollParent = 1 << 6 | Disable forwarding scrolling to parent window if required to keep item/rect visible (only scroll window the function was applied to). |
mask_x_ | ScrollFlags_KeepVisibleEdgeX | ScrollFlags_KeepVisibleCenterX | ScrollFlags_AlwaysCenterX | ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX | |
mask_y_ | ScrollFlags_KeepVisibleEdgeY | ScrollFlags_KeepVisibleCenterY | ScrollFlags_AlwaysCenterY | ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY, } |
NavRenderCursorFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiNavRenderCursorFlags_None = 0 | |
compact | 1 << 1 | ImGuiNavRenderCursorFlags_Compact = 1 << 1 | Compact highlight, no padding/distance from focused item |
always_draw | 1 << 2 | ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2 | Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == False, aka even when using the mouse. |
NavMoveFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiNavMoveFlags_None = 0 | |
loop_x | 1 << 0 | ImGuiNavMoveFlags_LoopX = 1 << 0 | On failed request, restart from opposite side |
loop_y | 1 << 1 | ImGuiNavMoveFlags_LoopY = 1 << 1 | |
wrap_x | 1 << 2 | ImGuiNavMoveFlags_WrapX = 1 << 2 | On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left) |
wrap_y | 1 << 3 | ImGuiNavMoveFlags_WrapY = 1 << 3 | This is not super useful but provided for completeness |
wrap_mask_ | NavMoveFlags_LoopX | NavMoveFlags_LoopY | NavMoveFlags_WrapX | NavMoveFlags_WrapY | ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY | |
allow_current_nav_id | 1 << 4 | ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4 | Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place) |
also_score_visible_set | 1 << 5 | ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5 | Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown) |
scroll_to_edge_y | 1 << 6 | ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6 | Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword as ImGuiScrollFlags |
forwarded | 1 << 7 | ImGuiNavMoveFlags_Forwarded = 1 << 7 | |
debug_no_result | 1 << 8 | ImGuiNavMoveFlags_DebugNoResult = 1 << 8 | Dummy scoring for debug purpose, don’t apply result |
focus_api | 1 << 9 | ImGuiNavMoveFlags_FocusApi = 1 << 9 | Requests from focus API can land/focus/activate items even if they are marked with _NoTabStop (see NavProcessItemForTabbingRequest() for details) |
is_tabbing | 1 << 10 | ImGuiNavMoveFlags_IsTabbing = 1 << 10 | == Focus + Activate if item is Inputable + DontChangeNavHighlight |
is_page_move | 1 << 11 | ImGuiNavMoveFlags_IsPageMove = 1 << 11 | Identify a PageDown/PageUp request. |
activate | 1 << 12 | ImGuiNavMoveFlags_Activate = 1 << 12 | Activate/select target item. |
no_select | 1 << 13 | ImGuiNavMoveFlags_NoSelect = 1 << 13 | Don’t trigger selection by not setting g.NavJustMovedTo |
no_set_nav_cursor_visible | 1 << 14 | ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14 | Do not alter the nav cursor visible state |
no_clear_active_id | 1 << 15 | ImGuiNavMoveFlags_NoClearActiveId = 1 << 15 | (Experimental) Do not clear active id when applying move result |
NavLayer (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
main | 0 | ImGuiNavLayer_Main = 0 | Main scrolling layer |
menu | 1 | ImGuiNavLayer_Menu = 1 | Menu layer (access with Alt) |
count | 2 | ImGuiNavLayer_COUNT |
NavItemData (class)¶
Storage for navigation query/results
| Attribute | C++ | |
|---|---|---|
window: Window | ImGuiWindow* Window; | Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window) |
id_: ID | ImGuiID ID; | Init,Move // Best candidate item ID |
focus_scope_id: ID | ImGuiID FocusScopeId; | Init,Move // Best candidate focus scope ID |
rect_rel: ImRect | ImRect RectRel; | Init,Move // Best candidate bounding box in window relative space |
item_flags: ItemFlags | ImGuiItemFlags ItemFlags; | ????,Move // Best candidate item flags |
dist_box: float | float DistBox; | Move // Best candidate box distance to current NavId |
dist_center: float | float DistCenter; | Move // Best candidate center distance to current NavId |
dist_axial: float | float DistAxial; | Move // Best candidate axial distance to current NavId |
selection_user_data: SelectionUserData | ImGuiSelectionUserData SelectionUserData; | I+Mov // Best candidate SetNextItemSelectionUserData() value. Valid if (ItemFlags & ImGuiItemFlags_HasSelectionUserData) |
NavItemData.__init__¶
def __init__(self) -> NoneImGuiNavItemData();NavItemData.clear¶
def clear(self) -> Nonevoid Clear();(private API)
FocusScopeData (class)¶
Storage for PushFocusScope(), g.FocusScopeStack[], g.NavFocusRoute[]
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
window_id: ID | ImGuiID WindowID; |
FocusScopeData.__init__¶
def __init__(self, id_: ID = ID(), window_id: ID = ID()) -> NoneAuto-generated default constructor with named params
Typing-select support¶
TypingSelectFlags_ (enum)¶
Flags for GetTypingSelectRequest()
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiTypingSelectFlags_None = 0 | |
allow_backspace | 1 << 0 | ImGuiTypingSelectFlags_AllowBackspace = 1 << 0 | Backspace to delete character inputs. If using: ensure GetTypingSelectRequest() is not called more than once per frame (filter by e.g. focus state) |
allow_single_char_mode | 1 << 1 | ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1 | Allow “single char” search mode which is activated when pressing the same character multiple times. |
TypingSelectRequest (class)¶
Returned by GetTypingSelectRequest(), designed to eventually be public.
| Attribute | C++ | |
|---|---|---|
flags: TypingSelectFlags | ImGuiTypingSelectFlags Flags; | Flags passed to GetTypingSelectRequest() |
search_buffer_len: int | int SearchBufferLen; | |
search_buffer: str | const char* SearchBuffer; | Search buffer contents (use full string. unless SingleCharMode is set, in which case use SingleCharSize). # (const) |
select_request: bool | bool SelectRequest; | Set when buffer was modified this frame, requesting a selection. |
single_char_mode: bool | bool SingleCharMode; | Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication. |
single_char_size: ImS8 | ImS8 SingleCharSize; | Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input. |
TypingSelectRequest.__init__¶
def __init__(self, flags: TypingSelectFlags = TypingSelectFlags(), search_buffer_len: int = int(), select_request: bool = bool(), single_char_mode: bool = bool(), single_char_size: ImS8 = ImS8()) -> NoneAuto-generated default constructor with named params
TypingSelectState (class)¶
Storage for GetTypingSelectRequest()
| Attribute | C++ | |
|---|---|---|
request: TypingSelectRequest | ImGuiTypingSelectRequest Request; | User-facing data |
focus_scope: ID | ImGuiID FocusScope; | |
last_request_frame: int | int LastRequestFrame = 0; | |
last_request_time: float | float LastRequestTime = 0.0f; | |
single_char_mode_lock: bool | bool SingleCharModeLock = false; | After a certain single char repeat count we lock into SingleCharMode. Two benefits: 1) buffer never fill, 2) we can provide an immediate SingleChar mode without timer elapsing. |
TypingSelectState.__init__¶
def __init__(self) -> NoneImGuiTypingSelectState();TypingSelectState.clear¶
def clear(self) -> Nonevoid Clear();(private API)
We preserve remaining data for easier debugging
Columns support¶
OldColumnFlags_ (enum)¶
Flags for internal’s BeginColumns(). This is an obsolete API. Prefer using BeginTable() nowadays!
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiOldColumnFlags_None = 0 | |
no_border | 1 << 0 | ImGuiOldColumnFlags_NoBorder = 1 << 0 | Disable column dividers |
no_resize | 1 << 1 | ImGuiOldColumnFlags_NoResize = 1 << 1 | Disable resizing columns when clicking on the dividers |
no_preserve_widths | 1 << 2 | ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2 | Disable column width preservation when adjusting columns |
no_force_within_window | 1 << 3 | ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3 | Disable forcing columns to fit within window |
grow_parent_contents_size | 1 << 4 | ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4 | Restore pre-1.51 behavior of extending the parent window contents size but without affecting the columns width at all. Will eventually remove. |
Obsolete names (will be removed)¶
OldColumnData (class)¶
| Attribute | C++ | |
|---|---|---|
offset_norm: float | float OffsetNorm; | Column start offset, normalized 0.0 (far left) -> 1.0 (far right) |
offset_norm_before_resize: float | float OffsetNormBeforeResize; | |
flags: OldColumnFlags | ImGuiOldColumnFlags Flags; | Not exposed |
clip_rect: ImRect | ImRect ClipRect; |
OldColumnData.__init__¶
def __init__(self) -> NoneImGuiOldColumnData();OldColumns (class)¶
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
flags: OldColumnFlags | ImGuiOldColumnFlags Flags; | |
is_first_frame: bool | bool IsFirstFrame; | |
is_being_resized: bool | bool IsBeingResized; | |
current: int | int Current; | |
count: int | int Count; | |
off_min_x: float | float OffMinX, | Offsets from HostWorkRect.Min.x |
off_max_x: float | OffMaxX; | Offsets from HostWorkRect.Min.x |
line_min_y: float | float LineMinY, | |
line_max_y: float | LineMaxY; | |
host_cursor_pos_y: float | float HostCursorPosY; | Backup of CursorPos at the time of BeginColumns() |
host_cursor_max_pos_x: float | float HostCursorMaxPosX; | Backup of CursorMaxPos at the time of BeginColumns() |
host_initial_clip_rect: ImRect | ImRect HostInitialClipRect; | Backup of ClipRect at the time of BeginColumns() |
host_backup_clip_rect: ImRect | ImRect HostBackupClipRect; | Backup of ClipRect during PushColumnsBackground()/PopColumnsBackground() |
host_backup_parent_work_rect: ImRect | ImRect HostBackupParentWorkRect; | Backup of WorkRect at the time of BeginColumns() |
columns: ImVector_OldColumnData | ImVector<ImGuiOldColumnData> Columns; | |
splitter: ImDrawListSplitter | ImDrawListSplitter Splitter; |
OldColumns.__init__¶
def __init__(self) -> NoneImGuiOldColumns();Box-select support¶
BoxSelectState (class)¶
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
is_active: bool | bool IsActive; | |
is_starting: bool | bool IsStarting; | |
is_started_from_void: bool | bool IsStartedFromVoid; | Starting click was not from an item. |
is_started_set_nav_id_once: bool | bool IsStartedSetNavIdOnce; | |
request_clear: bool | bool RequestClear; | |
start_pos_rel: ImVec2 | ImVec2 StartPosRel; | Start position in window-contents relative space (to support scrolling) |
end_pos_rel: ImVec2 | ImVec2 EndPosRel; | End position in window-contents relative space |
scroll_accum: ImVec2 | ImVec2 ScrollAccum; | Scrolling accumulator (to behave at high-frame spaces) |
window: Window | ImGuiWindow* Window; | |
unclip_mode: bool | bool UnclipMode; | (Temp/Transient, here in hot area). Set/cleared by the BeginMultiSelect()/EndMultiSelect() owning active box-select. |
unclip_rect: ImRect | ImRect UnclipRect; | Rectangle where ItemAdd() clipping may be temporarily disabled. Need support by multi-select supporting widgets. |
box_select_rect_prev: ImRect | ImRect BoxSelectRectPrev; | Selection rectangle in absolute coordinates (derived every frame from BoxSelectStartPosRel and MousePos) |
box_select_rect_curr: ImRect | ImRect BoxSelectRectCurr; |
BoxSelectState.__init__¶
def __init__(self) -> NoneImGuiBoxSelectState();Multi-select support¶
MultiSelectTempData (class)¶
Temporary storage for multi-select
| Attribute | C++ | |
|---|---|---|
io: MultiSelectIO | ImGuiMultiSelectIO IO; | MUST BE FIRST FIELD. Requests are set and returned by BeginMultiSelect()/EndMultiSelect() + written to by user during the loop. |
storage: MultiSelectState | ImGuiMultiSelectState* Storage; | |
focus_scope_id: ID | ImGuiID FocusScopeId; | Copied from g.CurrentFocusScopeId (unless another selection scope was pushed manually) |
flags: MultiSelectFlags | ImGuiMultiSelectFlags Flags; | |
scope_rect_min: ImVec2 | ImVec2 ScopeRectMin; | |
backup_cursor_max_pos: ImVec2 | ImVec2 BackupCursorMaxPos; | |
box_select_id: ID | ImGuiID BoxSelectId; | |
key_mods: KeyChord | ImGuiKeyChord KeyMods; | |
loop_request_set_all: ImS8 | ImS8 LoopRequestSetAll; | -1: no operation, 0: clear all, 1: select all. |
is_end_io: bool | bool IsEndIO; | Set when switching IO from BeginMultiSelect() to EndMultiSelect() state. |
is_focused: bool | bool IsFocused; | Set if currently focusing the selection scope (any item of the selection). May be used if you have custom shortcut associated to selection. |
is_keyboard_set_range: bool | bool IsKeyboardSetRange; | Set by BeginMultiSelect() when using Shift+Navigation. Because scrolling may be affected we can’t afford a frame of lag with Shift+Navigation. |
nav_id_passed_by: bool | bool NavIdPassedBy; | |
range_src_passed_by: bool | bool RangeSrcPassedBy; | Set by the item that matches RangeSrcItem. |
range_dst_passed_by: bool | bool RangeDstPassedBy; | Set by the item that matches NavJustMovedToId when IsSetRange is set. |
is_sole_or_unknown_selection_size: bool | bool IsSoleOrUnknownSelectionSize; |
MultiSelectTempData.__init__¶
def __init__(self) -> NoneImGuiMultiSelectTempData();MultiSelectTempData.clear¶
def clear(self) -> Nonevoid Clear();(private API)
Zero-clear except IO as we preserve IO.Requests[] buffer allocation.
MultiSelectTempData.clear_io¶
def clear_io(self) -> Nonevoid ClearIO();(private API)
MultiSelectState (class)¶
Persistent storage for multi-select (as long as selection is alive)
| Attribute | C++ | |
|---|---|---|
window: Window | ImGuiWindow* Window; | |
id_: ID | ImGuiID ID; | |
last_frame_active: int | int LastFrameActive; | Last used frame-count, for GC. |
last_selection_size: int | int LastSelectionSize; | Set by BeginMultiSelect() based on optional info provided by user. May be -1 if unknown. |
range_selected: ImS8 | ImS8 RangeSelected; | -1 (don’t have) or True/False |
nav_id_selected: ImS8 | ImS8 NavIdSelected; | -1 (don’t have) or True/False |
range_src_item: SelectionUserData | ImGuiSelectionUserData RangeSrcItem; | |
nav_id_item: SelectionUserData | ImGuiSelectionUserData NavIdItem; | SetNextItemSelectionUserData() value for NavId (if part of submitted items) |
MultiSelectState.__init__¶
def __init__(self) -> NoneImGuiMultiSelectState();Docking support¶
DockNodeFlagsPrivate_ (enum)¶
Extend ImGuiDockNodeFlags_
| Member | Value | C++ | |
|---|---|---|---|
dock_space | 1 << 10 | ImGuiDockNodeFlags_DockSpace = 1 << 10 | Saved // A dockspace is a node that occupy space within an existing user window. Otherwise the node is floating and create its own window. |
central_node | 1 << 11 | ImGuiDockNodeFlags_CentralNode = 1 << 11 | Saved // The central node has 2 main properties: stay visible when empty, only use “remaining” spaces from its neighbor. |
no_tab_bar | 1 << 12 | ImGuiDockNodeFlags_NoTabBar = 1 << 12 | Saved // Tab bar is completely unavailable. No triangle in the corner to enable it back. |
hidden_tab_bar | 1 << 13 | ImGuiDockNodeFlags_HiddenTabBar = 1 << 13 | Saved // Tab bar is hidden, with a triangle in the corner to show it again (NB: actual tab-bar instance may be destroyed as this is only used for single-window tab bar) |
no_window_menu_button | 1 << 14 | ImGuiDockNodeFlags_NoWindowMenuButton = 1 << 14 | Saved // Disable window/docking menu (that one that appears instead of the collapse button) |
no_close_button | 1 << 15 | ImGuiDockNodeFlags_NoCloseButton = 1 << 15 | Saved // Disable close button |
no_resize_x | 1 << 16 | ImGuiDockNodeFlags_NoResizeX = 1 << 16 | // |
no_resize_y | 1 << 17 | ImGuiDockNodeFlags_NoResizeY = 1 << 17 | // |
docked_windows_in_focus_route | 1 << 18 | ImGuiDockNodeFlags_DockedWindowsInFocusRoute= 1 << 18 | // Any docked window will be automatically be focus-route chained (window->ParentWindowForFocusRoute set to this) so Shortcut() in this window can run when any docked window is focused. |
no_docking_split_other | 1 << 19 | ImGuiDockNodeFlags_NoDockingSplitOther = 1 << 19 | // Disable this node from splitting other windows/nodes. |
no_docking_over_me | 1 << 20 | ImGuiDockNodeFlags_NoDockingOverMe = 1 << 20 | // Disable other windows/nodes from being docked over this node. |
no_docking_over_other | 1 << 21 | ImGuiDockNodeFlags_NoDockingOverOther = 1 << 21 | // Disable this node from being docked over another window or non-empty node. |
no_docking_over_empty | 1 << 22 | ImGuiDockNodeFlags_NoDockingOverEmpty = 1 << 22 | // Disable this node from being docked over an empty node (e.g. DockSpace with no other windows) |
no_docking | DockNodeFlags_NoDockingOverMe | DockNodeFlags_NoDockingOverOther | DockNodeFlags_NoDockingOverEmpty | DockNodeFlags_NoDockingSplit | DockNodeFlags_NoDockingSplitOther | ImGuiDockNodeFlags_NoDocking = ImGuiDockNodeFlags_NoDockingOverMe | ImGuiDockNodeFlags_NoDockingOverOther | ImGuiDockNodeFlags_NoDockingOverEmpty | ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoDockingSplitOther | |
shared_flags_inherit_mask_ | ~0 | ImGuiDockNodeFlags_SharedFlagsInheritMask_ = ~0 | |
no_resize_flags_mask_ | (int | ImGuiDockNodeFlags_NoResizeFlagsMask_ = (int)ImGuiDockNodeFlags_NoResize | ImGuiDockNodeFlags_NoResizeX | ImGuiDockNodeFlags_NoResizeY | DockNodeFlags_NoResize | DockNodeFlags_NoResizeX | DockNodeFlags_NoResizeY) |
local_flags_transfer_mask_ | (int | ImGuiDockNodeFlags_LocalFlagsTransferMask_ = (int)ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoResizeFlagsMask_ | (int)ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton | DockNodeFlags_NoDockingSplit | DockNodeFlags_NoResizeFlagsMask_ | (int)DockNodeFlags_AutoHideTabBar | DockNodeFlags_CentralNode | DockNodeFlags_NoTabBar | DockNodeFlags_HiddenTabBar | DockNodeFlags_NoWindowMenuButton | DockNodeFlags_NoCloseButton) |
saved_flags_mask_ | DockNodeFlags_NoResizeFlagsMask_ | DockNodeFlags_DockSpace | DockNodeFlags_CentralNode | DockNodeFlags_NoTabBar | DockNodeFlags_HiddenTabBar | DockNodeFlags_NoWindowMenuButton | DockNodeFlags_NoCloseButton | ImGuiDockNodeFlags_SavedFlagsMask_ = ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton, } |
DataAuthority_ (enum)¶
Store the source authority (dock node vs window) of a field
| Member | Value | C++ | |
|---|---|---|---|
auto | 0 | ImGuiDataAuthority_Auto | |
dock_node | 1 | ImGuiDataAuthority_DockNode | |
window | 2 | ImGuiDataAuthority_Window, } |
DockNodeState (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
unknown | 0 | ImGuiDockNodeState_Unknown | |
host_window_hidden_because_single_window | 1 | ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow | |
host_window_hidden_because_windows_are_resizing | 2 | ImGuiDockNodeState_HostWindowHiddenBecauseWindowsAreResizing | |
host_window_visible | 3 | ImGuiDockNodeState_HostWindowVisible, } |
DockNode (class)¶
sizeof() 176~216
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
shared_flags: DockNodeFlags | ImGuiDockNodeFlags SharedFlags; | (Write) Flags shared by all nodes of a same dockspace hierarchy (inherited from the root node) |
local_flags: DockNodeFlags | ImGuiDockNodeFlags LocalFlags; | (Write) Flags specific to this node |
local_flags_in_windows: DockNodeFlags | ImGuiDockNodeFlags LocalFlagsInWindows; | (Write) Flags specific to this node, applied from windows |
merged_flags: DockNodeFlags | ImGuiDockNodeFlags MergedFlags; | (Read) Effective flags (== SharedFlags | LocalFlagsInNode | LocalFlagsInWindows) |
state: DockNodeState | ImGuiDockNodeState State; | |
parent_node: DockNode | ImGuiDockNode* ParentNode; | |
windows: ImVector_Window_ptr | ImVector<ImGuiWindow*> Windows; | Note: unordered list! Iterate TabBar->Tabs for user-order. |
tab_bar: TabBar | ImGuiTabBar* TabBar; | |
pos: ImVec2 | ImVec2 Pos; | Current position |
size: ImVec2 | ImVec2 Size; | Current size |
size_ref: ImVec2 | ImVec2 SizeRef; | [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size. |
split_axis: Axis | ImGuiAxis SplitAxis; | [Split node only] Split axis (X or Y) |
last_bg_color: ImU32 | ImU32 LastBgColor; | |
window_class: WindowClass | ImGuiWindowClass WindowClass; | [Root node only] |
host_window: Window | ImGuiWindow* HostWindow; | |
visible_window: Window | ImGuiWindow* VisibleWindow; | Generally point to window which is ID is == SelectedTabID, but when CTRL+Tabbing this can be a different window. |
central_node: DockNode | ImGuiDockNode* CentralNode; | [Root node only] Pointer to central node. |
only_node_with_windows: DockNode | ImGuiDockNode* OnlyNodeWithWindows; | [Root node only] Set when there is a single visible node within the hierarchy. |
count_node_with_windows: int | int CountNodeWithWindows; | [Root node only] |
last_frame_alive: int | int LastFrameAlive; | Last frame number the node was updated or kept alive explicitly with DockSpace() + ImGuiDockNodeFlags_KeepAliveOnly |
last_frame_active: int | int LastFrameActive; | Last frame number the node was updated. |
last_frame_focused: int | int LastFrameFocused; | Last frame number the node was focused. |
last_focused_node_id: ID | ImGuiID LastFocusedNodeId; | [Root node only] Which of our child docking node (any ancestor in the hierarchy) was last focused. |
selected_tab_id: ID | ImGuiID SelectedTabId; | [Leaf node only] Which of our tab/window is selected. |
want_close_tab_id: ID | ImGuiID WantCloseTabId; | [Leaf node only] Set when closing a specific tab/window. |
ref_viewport_id: ID | ImGuiID RefViewportId; | Reference viewport ID from visible window when HostWindow == None. |
DockNode.__init__¶
def __init__(self, id_: ID) -> NoneImGuiDockNode(ImGuiID id);DockNode.is_root_node¶
def is_root_node(self) -> boolbool IsRootNode() const;(private API)
DockNode.is_dock_space¶
def is_dock_space(self) -> boolbool IsDockSpace() const;(private API)
DockNode.is_floating_node¶
def is_floating_node(self) -> boolbool IsFloatingNode() const;(private API)
DockNode.is_central_node¶
def is_central_node(self) -> boolbool IsCentralNode() const;(private API)
DockNode.is_hidden_tab_bar¶
def is_hidden_tab_bar(self) -> boolbool IsHiddenTabBar() const;(private API)
Hidden tab bar can be shown back by clicking the small triangle
DockNode.is_no_tab_bar¶
def is_no_tab_bar(self) -> boolbool IsNoTabBar() const;(private API)
Never show a tab bar
DockNode.is_split_node¶
def is_split_node(self) -> boolbool IsSplitNode() const;(private API)
DockNode.is_leaf_node¶
def is_leaf_node(self) -> boolbool IsLeafNode() const;(private API)
DockNode.is_empty¶
def is_empty(self) -> boolbool IsEmpty() const;(private API)
DockNode.rect¶
def rect(self) -> ImRectImRect Rect() const;(private API)
DockNode.set_local_flags¶
def set_local_flags(self, flags: DockNodeFlags) -> Nonevoid SetLocalFlags(ImGuiDockNodeFlags flags);(private API)
DockNode.update_merged_flags¶
def update_merged_flags(self) -> Nonevoid UpdateMergedFlags();(private API)
WindowDockStyleCol (enum)¶
List of colors that are stored at the time of Begin() into Docked Windows.
We currently store the packed colors in a simple array window->DockStyle.Colors[].
A better solution may involve appending into a log of colors in ImGuiContext + store offsets into those arrays in ImGuiWindow,
but it would be more complex as we’d need to double-buffer both as e.g. drop target may refer to window from last frame.
| Member | Value | C++ | |
|---|---|---|---|
text | 0 | ImGuiWindowDockStyleCol_Text | |
tab_hovered | 1 | ImGuiWindowDockStyleCol_TabHovered | |
tab_focused | 2 | ImGuiWindowDockStyleCol_TabFocused | |
tab_selected | 3 | ImGuiWindowDockStyleCol_TabSelected | |
tab_selected_overline | 4 | ImGuiWindowDockStyleCol_TabSelectedOverline | |
tab_dimmed | 5 | ImGuiWindowDockStyleCol_TabDimmed | |
tab_dimmed_selected | 6 | ImGuiWindowDockStyleCol_TabDimmedSelected | |
tab_dimmed_selected_overline | 7 | ImGuiWindowDockStyleCol_TabDimmedSelectedOverline | |
unsaved_marker | 8 | ImGuiWindowDockStyleCol_UnsavedMarker | |
count | 9 | ImGuiWindowDockStyleCol_COUNT |
WindowDockStyle (class)¶
We don’t store style.Alpha: dock_node->LastBgColor embeds it and otherwise it would only affect the docking tab, which intuitively I would say we don’t want to.
WindowDockStyle.__init__¶
def __init__(self) -> NoneAuto-generated default constructor
DockContext (class)¶
| Attribute | C++ | |
|---|---|---|
nodes: Storage | ImGuiStorage Nodes; | Map ID -> ImGuiDockNode*: Active nodes |
want_full_rebuild: bool | bool WantFullRebuild; |
DockContext.__init__¶
def __init__(self) -> NoneImGuiDockContext();Viewport support¶
ViewportP (class)¶
ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!)
Every instance of ImGuiViewport is in fact a ImGuiViewportP.
| Attribute | C++ | |
|---|---|---|
window: Window | ImGuiWindow* Window; | Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set) |
idx: int | int Idx; | |
last_frame_active: int | int LastFrameActive; | Last frame number this viewport was activated by a window |
last_focused_stamp_count: int | int LastFocusedStampCount; | Last stamp number from when a window hosted by this viewport was focused (by comparing this value between two viewport we have an implicit viewport z-order we use as fallback) |
last_name_hash: ID | ImGuiID LastNameHash; | |
last_pos: ImVec2 | ImVec2 LastPos; | |
last_size: ImVec2 | ImVec2 LastSize; | |
alpha: float | float Alpha; | Window opacity (when dragging dockable windows/viewports we make them transparent) |
last_alpha: float | float LastAlpha; | |
last_focused_had_nav_window: bool | bool LastFocusedHadNavWindow; | Instead of maintaining a LastFocusedWindow (which may harder to correctly maintain), we merely store weither NavWindow != None last time the viewport was focused. |
platform_monitor: int | short PlatformMonitor; | |
bg_fg_draw_lists_last_frame_active: np.ndarray | int BgFgDrawListsLastFrameActive[2]; | ndarray[type=int, size=2] # Last frame the background (0) and foreground (1) draw lists were used. |
bg_fg_draw_lists_last_time_active: np.ndarray | float BgFgDrawListsLastTimeActive[2]; | ndarray[type=float, size=2] # Timestamps for Gc. |
draw_data_p: ImDrawData | ImDrawData DrawDataP; | |
draw_data_builder: ImDrawDataBuilder | ImDrawDataBuilder DrawDataBuilder; | Temporary data while building final ImDrawData |
last_platform_pos: ImVec2 | ImVec2 LastPlatformPos; | |
last_platform_size: ImVec2 | ImVec2 LastPlatformSize; | |
last_renderer_size: ImVec2 | ImVec2 LastRendererSize; | |
work_inset_min: ImVec2 | ImVec2 WorkInsetMin; | Work Area inset locked for the frame. GetWorkRect() always fits within GetMainRect(). |
work_inset_max: ImVec2 | ImVec2 WorkInsetMax; | " |
build_work_inset_min: ImVec2 | ImVec2 BuildWorkInsetMin; | Work Area inset accumulator for current frame, to become next frame’s WorkInset |
build_work_inset_max: ImVec2 | ImVec2 BuildWorkInsetMax; | " |
ViewportP.__init__¶
def __init__(self) -> NoneImGuiViewportP();ViewportP.clear_request_flags¶
def clear_request_flags(self) -> Nonevoid ClearRequestFlags();(private API)
ViewportP.calc_work_rect_pos¶
def calc_work_rect_pos(self, inset_min: ImVec2Like) -> ImVec2ImVec2 CalcWorkRectPos(const ImVec2& inset_min) const;(private API)
Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect)
ViewportP.calc_work_rect_size¶
def calc_work_rect_size(self, inset_min: ImVec2Like, inset_max: ImVec2Like) -> ImVec2ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const;(private API)
ViewportP.update_work_rect¶
def update_work_rect(self) -> Nonevoid UpdateWorkRect();(private API)
Update public fields
ViewportP.get_main_rect¶
def get_main_rect(self) -> ImRectImRect GetMainRect() const;(private API)
Helpers to retrieve ImRect (we don’t need to store BuildWorkRect as every access tend to change it, hence the code asymmetry)
ViewportP.get_work_rect¶
def get_work_rect(self) -> ImRectImRect GetWorkRect() const;(private API)
ViewportP.get_build_work_rect¶
def get_build_work_rect(self) -> ImRectImRect GetBuildWorkRect() const;(private API)
Settings support¶
WindowSettings (class)¶
Windows data saved in imgui.ini file
Because we never destroy or rename ImGuiWindowSettings, we can store the names in a separate buffer easily.
(this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure)
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
pos: ImVec2ih | ImVec2ih Pos; | NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions. |
size: ImVec2ih | ImVec2ih Size; | |
viewport_pos: ImVec2ih | ImVec2ih ViewportPos; | |
viewport_id: ID | ImGuiID ViewportId; | |
dock_id: ID | ImGuiID DockId; | ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none. |
class_id: ID | ImGuiID ClassId; | ID of window class if specified |
dock_order: int | short DockOrder; | Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible. |
last_used_date: PackedDate | ImGuiPackedDate LastUsedDate; |
WindowSettings.__init__¶
def __init__(self) -> NoneImGuiWindowSettings();WindowSettings.get_name_str¶
def get_name_str(self) -> strSettingsCleanupArgs (class)¶
| Attribute | C++ | |
|---|---|---|
type_hash_filter: ID | ImGuiID TypeHashFilter = 0; | Set to restrict cleanup to a given .ini type, e.g. == ImHashStr(“Window”), ImHashStr(“Table”). Otherwise every types supporting Cleanup will be affected. |
discard_older_than_months: int | int DiscardOlderThanMonths = 0; | Enable to discard entries older than XX months. |
discard_when_missing_date: bool | bool DiscardWhenMissingDate = false; | Enable to discard entries missing a date. |
discard_all: bool | bool DiscardAll = false; | Enable to discard all entries = same as calling ClearIniSettings() except it may be filtered. |
set_current_session_date_to_all: bool | bool SetCurrentSessionDateToAll = false; | Enable to write current SessionDate to all supporting entries. // Let us know in #9460 if you use this. |
set_current_session_date_when_missing_date: bool | bool SetCurrentSessionDateWhenMissingDate = false; | Enable to write current SessionDate to all supporting entries missing a date. // Let us know in #9460 if you use this. |
_discard_older_than_date: int | int _DiscardOlderThanDate = 0; | [Internal] |
SettingsCleanupArgs.__init__¶
def __init__(self, type_hash_filter: ID = 0, discard_older_than_months: int = 0, discard_when_missing_date: bool = False, discard_all: bool = False, set_current_session_date_to_all: bool = False, set_current_session_date_when_missing_date: bool = False, _discard_older_than_date: int = 0) -> NoneAuto-generated default constructor with named params
SettingsHandler (class)¶
| Attribute | C++ | |
|---|---|---|
type_name: str | const char* TypeName; | Short description stored in .ini file. Disallowed characters: ‘[’ ‘]’ # (const) |
type_hash: ID | ImGuiID TypeHash; | == ImHashStr(TypeName) |
user_data: Any | void* UserData; |
SettingsHandler.__init__¶
def __init__(self) -> NoneImGuiSettingsHandler();Localization support¶
LocKey (enum)¶
This is experimental and not officially supported, it’ll probably fall short of features, if/when it does we may backtrack.
| Member | Value | C++ | |
|---|---|---|---|
version_str | 0 | ImGuiLocKey_VersionStr | |
table_size_one | 1 | ImGuiLocKey_TableSizeOne | |
table_size_all_fit | 2 | ImGuiLocKey_TableSizeAllFit | |
table_size_all_default | 3 | ImGuiLocKey_TableSizeAllDefault | |
table_reset | 4 | ImGuiLocKey_TableReset | |
table_reset_order | 5 | ImGuiLocKey_TableResetOrder | |
table_reset_visibility | 6 | ImGuiLocKey_TableResetVisibility | |
windowing_main_menu_bar | 7 | ImGuiLocKey_WindowingMainMenuBar | |
windowing_popup | 8 | ImGuiLocKey_WindowingPopup | |
windowing_untitled | 9 | ImGuiLocKey_WindowingUntitled | |
open_link_s | 10 | ImGuiLocKey_OpenLink_s | |
copy_link | 11 | ImGuiLocKey_CopyLink | |
docking_hide_tab_bar | 12 | ImGuiLocKey_DockingHideTabBar | |
docking_hold_shift_to_dock | 13 | ImGuiLocKey_DockingHoldShiftToDock | |
docking_drag_to_undock_or_move_node | 14 | ImGuiLocKey_DockingDragToUndockOrMoveNode | |
count | 15 | ImGuiLocKey_COUNT |
LocEntry (class)¶
| Attribute | C++ | |
|---|---|---|
key: LocKey | ImGuiLocKey Key; | |
text: str | const char* Text; | (const) |
LocEntry.__init__¶
def __init__(self, key: LocKey = LocKey()) -> NoneAuto-generated default constructor with named params
Metrics, Debug Tools¶
DebugLogFlags_ (enum)¶
See IMGUI_DEBUG_LOG() and IMGUI_DEBUG_LOG_XXX() macros.
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiDebugLogFlags_None = 0 | |
event_error | 1 << 0 | ImGuiDebugLogFlags_EventError = 1 << 0 | Error submitted by IM_ASSERT_USER_ERROR() |
event_active_id | 1 << 1 | ImGuiDebugLogFlags_EventActiveId = 1 << 1 | |
event_focus | 1 << 2 | ImGuiDebugLogFlags_EventFocus = 1 << 2 | |
event_popup | 1 << 3 | ImGuiDebugLogFlags_EventPopup = 1 << 3 | |
event_nav | 1 << 4 | ImGuiDebugLogFlags_EventNav = 1 << 4 | |
event_clipper | 1 << 5 | ImGuiDebugLogFlags_EventClipper = 1 << 5 | |
event_selection | 1 << 6 | ImGuiDebugLogFlags_EventSelection = 1 << 6 | |
event_io | 1 << 7 | ImGuiDebugLogFlags_EventIO = 1 << 7 | |
event_font | 1 << 8 | ImGuiDebugLogFlags_EventFont = 1 << 8 | |
event_input_routing | 1 << 9 | ImGuiDebugLogFlags_EventInputRouting = 1 << 9 | |
event_docking | 1 << 10 | ImGuiDebugLogFlags_EventDocking = 1 << 10 | |
event_viewport | 1 << 11 | ImGuiDebugLogFlags_EventViewport = 1 << 11 | |
event_table | 1 << 12 | ImGuiDebugLogFlags_EventTable = 1 << 12 | |
event_mask_ | DebugLogFlags_EventError | DebugLogFlags_EventActiveId | DebugLogFlags_EventFocus | DebugLogFlags_EventPopup | DebugLogFlags_EventNav | DebugLogFlags_EventClipper | DebugLogFlags_EventSelection | DebugLogFlags_EventTable | DebugLogFlags_EventIO | DebugLogFlags_EventFont | DebugLogFlags_EventInputRouting | DebugLogFlags_EventDocking | DebugLogFlags_EventViewport | ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventTable | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport | |
output_to_tty | 1 << 20 | ImGuiDebugLogFlags_OutputToTTY = 1 << 20 | Also send output to TTY |
output_to_debugger | 1 << 21 | ImGuiDebugLogFlags_OutputToDebugger = 1 << 21 | Also send output to Debugger Console [Windows only] |
output_to_test_engine | 1 << 22 | ImGuiDebugLogFlags_OutputToTestEngine = 1 << 22 | Also send output to Dear ImGui Test Engine |
DebugAllocEntry (class)¶
| Attribute | C++ | |
|---|---|---|
frame_count: int | int FrameCount; | |
alloc_count: ImS16 | ImS16 AllocCount; | |
free_count: ImS16 | ImS16 FreeCount; |
DebugAllocEntry.__init__¶
def __init__(self, frame_count: int = int(), alloc_count: ImS16 = ImS16(), free_count: ImS16 = ImS16()) -> NoneAuto-generated default constructor with named params
DebugAllocInfo (class)¶
| Attribute | C++ | |
|---|---|---|
total_alloc_count: int | int TotalAllocCount; | Number of call to MemAlloc(). |
total_free_count: int | int TotalFreeCount; | |
last_entries_idx: ImS16 | ImS16 LastEntriesIdx; | Current index in buffer |
DebugAllocInfo.__init__¶
def __init__(self) -> NoneImGuiDebugAllocInfo();MetricsConfig (class)¶
| Attribute | C++ | |
|---|---|---|
show_debug_log: bool | bool ShowDebugLog = false; | |
show_id_stack_tool: bool | bool ShowIDStackTool = false; | |
show_windows_rects: bool | bool ShowWindowsRects = false; | |
show_windows_begin_order: bool | bool ShowWindowsBeginOrder = false; | |
show_tables_rects: bool | bool ShowTablesRects = false; | |
show_draw_cmd_mesh: bool | bool ShowDrawCmdMesh = true; | |
show_draw_cmd_bounding_boxes: bool | bool ShowDrawCmdBoundingBoxes = true; | |
show_text_encoding_viewer: bool | bool ShowTextEncodingViewer = false; | |
show_texture_used_rect: bool | bool ShowTextureUsedRect = false; | |
show_docking_nodes: bool | bool ShowDockingNodes = false; | |
show_windows_rects_type: int | int ShowWindowsRectsType = -1; | |
show_tables_rects_type: int | int ShowTablesRectsType = -1; | |
highlight_monitor_idx: int | int HighlightMonitorIdx = -1; | |
highlight_viewport_id: ID | ImGuiID HighlightViewportID = 0; | |
settings_discard_months: int | int SettingsDiscardMonths = 6; | |
settings_highlight_old_entries: bool | bool SettingsHighlightOldEntries = false; | |
show_font_preview: bool | bool ShowFontPreview = true; |
MetricsConfig.__init__¶
def __init__(self, show_debug_log: bool = False, show_id_stack_tool: bool = False, show_windows_rects: bool = False, show_windows_begin_order: bool = False, show_tables_rects: bool = False, show_draw_cmd_mesh: bool = True, show_draw_cmd_bounding_boxes: bool = True, show_text_encoding_viewer: bool = False, show_texture_used_rect: bool = False, show_docking_nodes: bool = False, show_windows_rects_type: int = -1, show_tables_rects_type: int = -1, highlight_monitor_idx: int = -1, highlight_viewport_id: ID = 0, settings_discard_months: int = 6, settings_highlight_old_entries: bool = False, show_font_preview: bool = True) -> NoneAuto-generated default constructor with named params
StackLevelInfo (class)¶
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
query_frame_count: ImS8 | ImS8 QueryFrameCount; | >= 1: Sub-query in progress |
query_success: bool | bool QuerySuccess; | Sub-query obtained result from DebugHookIdInfo() |
data_type: ImS8 | ImS8 DataType; | ImGuiDataType |
desc_offset: int | int DescOffset; | -1 or offset into parent’s ResultsPathsBuf |
StackLevelInfo.__init__¶
def __init__(self) -> NoneImGuiStackLevelInfo();DebugItemPathQuery (class)¶
| Attribute | C++ | |
|---|---|---|
main_id: ID | ImGuiID MainID; | ID to query details for. |
active: bool | bool Active; | Used to disambiguate the case when ID == 0 and e.g. some code calls PushOverrideID(0). |
complete: bool | bool Complete; | All sub-queries are finished (some may have failed). |
step: ImS8 | ImS8 Step; | -1: query stack + init Results, >= 0: filling individual stack level. |
results: ImVector_StackLevelInfo | ImVector<ImGuiStackLevelInfo> Results; | |
results_desc_buf: TextBuffer | ImGuiTextBuffer ResultsDescBuf; | |
result_path_buf: TextBuffer | ImGuiTextBuffer ResultPathBuf; |
DebugItemPathQuery.__init__¶
def __init__(self) -> NoneImGuiDebugItemPathQuery();IDStackTool (class)¶
State for ID Stack tool queries
| Attribute | C++ | |
|---|---|---|
opt_hex_encode_non_ascii_chars: bool | bool OptHexEncodeNonAsciiChars; | |
opt_copy_to_clipboard_on_ctrl_c: bool | bool OptCopyToClipboardOnCtrlC; | |
last_active_frame: int | int LastActiveFrame; | |
copy_to_clipboard_last_time: float | float CopyToClipboardLastTime; |
IDStackTool.__init__¶
def __init__(self) -> NoneImGuiIDStackTool();Generic context hooks¶
ContextHookType (enum)¶
[ADAPT_IMGUI_BUNDLE]: added ImGuiContextHookType_BeginWindow, ImGuiContextHookType_EndWindow (called at the start of Begin() and at the end of End())
They let a library that changes the coordinate space (e.g. the zoomable canvas of imgui-node-editor) know when a window is begun from inside it.
cf thedmd
| Member | Value | C++ | |
|---|---|---|---|
new_frame_pre | 0 | ImGuiContextHookType_NewFramePre | |
new_frame_post | 1 | ImGuiContextHookType_NewFramePost | |
end_frame_pre | 2 | ImGuiContextHookType_EndFramePre | |
end_frame_post | 3 | ImGuiContextHookType_EndFramePost | |
render_pre | 4 | ImGuiContextHookType_RenderPre | |
render_post | 5 | ImGuiContextHookType_RenderPost | |
shutdown | 6 | ImGuiContextHookType_Shutdown | |
pending_removal_ | 7 | ImGuiContextHookType_PendingRemoval_ | |
begin_window | 8 | ImGuiContextHookType_BeginWindow | |
end_window | 9 | ImGuiContextHookType_EndWindow } |
ContextHook (class)¶
| Attribute | C++ | |
|---|---|---|
hook_id: ID | ImGuiID HookId; | A unique ID assigned by AddContextHook() |
type: ContextHookType | ImGuiContextHookType Type; | |
owner: ID | ImGuiID Owner; | |
user_data: Any | void* UserData; |
ContextHook.__init__¶
def __init__(self) -> NoneImGuiContextHook();ImGuiContext¶
Context (class)¶
| Attribute | C++ | |
|---|---|---|
initialized: bool | bool Initialized; | |
within_frame_scope: bool | bool WithinFrameScope; | Set by NewFrame(), cleared by EndFrame() |
within_frame_scope_with_implicit_window: bool | bool WithinFrameScopeWithImplicitWindow; | Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed |
test_engine_hook_items: bool | bool TestEngineHookItems; | Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log() |
frame_count: int | int FrameCount; | |
frame_count_ended: int | int FrameCountEnded; | |
frame_count_platform_ended: int | int FrameCountPlatformEnded; | |
frame_count_rendered: int | int FrameCountRendered; | |
time: float | double Time; | |
io: IO | ImGuiIO IO; | |
platform_io: PlatformIO | ImGuiPlatformIO PlatformIO; | |
style: Style | ImGuiStyle Style; | |
config_flags_curr_frame: ConfigFlags | ImGuiConfigFlags ConfigFlagsCurrFrame; | = g.IO.ConfigFlags at the time of NewFrame() |
config_flags_last_frame: ConfigFlags | ImGuiConfigFlags ConfigFlagsLastFrame; | |
font_atlases: ImVector_ImFontAtlas_ptr | ImVector<ImFontAtlas*> FontAtlases; | List of font atlases used by the context (generally only contains g.IO.Fonts aka the main font atlas) |
font: ImFont | ImFont* Font; | Currently bound font. (== FontStack.back().Font) |
font_baked: ImFontBaked | ImFontBaked* FontBaked; | Currently bound font at currently bound size. (== Font->GetFontBaked(FontSize)) |
font_size: float | float FontSize; | Currently bound font size == line height (== FontSizeBase + externals scales applied in the UpdateCurrentFontSize() function). |
font_size_base: float | float FontSizeBase; | Font size before scaling == style.FontSizeBase == value passed to PushFont() when specified. |
font_baked_scale: float | float FontBakedScale; | == FontBaked->Size / FontSize. Scale factor over baked size. Rarely used nowadays, very often == 1.0. |
current_pixel_density: float | float CurrentPixelDensity; | Current font density. Used by all calls to GetFontBaked(). |
current_dpi_scale: float | float CurrentDpiScale; | Current window/viewport DpiScale == CurrentViewport->DpiScale |
draw_list_shared_data: ImDrawListSharedData | ImDrawListSharedData DrawListSharedData; | |
within_end_child_id: ID | ImGuiID WithinEndChildID; | Set within EndChild() |
within_end_popup_id: ID | ImGuiID WithinEndPopupID; | Set within EndPopup() |
test_engine: Any | void* TestEngine; | Test engine user data |
input_events_queue: ImVector_InputEvent | ImVector<ImGuiInputEvent> InputEventsQueue; | Input events which will be trickled/written into IO structure. |
input_events_trail: ImVector_InputEvent | ImVector<ImGuiInputEvent> InputEventsTrail; | Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail. |
input_events_next_mouse_source: MouseSource | ImGuiMouseSource InputEventsNextMouseSource; | |
input_events_next_event_id: ImU32 | ImU32 InputEventsNextEventId; | |
windows: ImVector_Window_ptr | ImVector<ImGuiWindow*> Windows; | Windows, sorted in display order, back to front |
windows_focus_order: ImVector_Window_ptr | ImVector<ImGuiWindow*> WindowsFocusOrder; | Root windows, sorted in focus order, back to front. |
windows_temp_sort_buffer: ImVector_Window_ptr | ImVector<ImGuiWindow*> WindowsTempSortBuffer; | Temporary buffer used in EndFrame() to reorder windows so parents are kept before their child |
current_window_stack: ImVector_WindowStackData | ImVector<ImGuiWindowStackData> CurrentWindowStack; | |
windows_by_id: Storage | ImGuiStorage WindowsById; | Map window’s ImGuiID to ImGuiWindow* |
windows_active_count: int | int WindowsActiveCount; | Number of unique windows submitted by frame |
windows_border_hover_padding: float | float WindowsBorderHoverPadding; | Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, style.WindowBorderHoverPadding). This isn’t so multi-dpi friendly. |
debug_break_in_window: ID | ImGuiID DebugBreakInWindow; | Set to break in Begin() call. |
current_window: Window | ImGuiWindow* CurrentWindow; | Window being drawn into |
hovered_window: Window | ImGuiWindow* HoveredWindow; | Window the mouse is hovering. Will typically catch mouse inputs. |
hovered_window_under_moving_window: Window | ImGuiWindow* HoveredWindowUnderMovingWindow; | Hovered window ignoring MovingWindow. Only set if MovingWindow is set. |
hovered_window_before_clear: Window | ImGuiWindow* HoveredWindowBeforeClear; | Window the mouse is hovering. Filled even with _NoMouse. This is currently useful for multi-context compositors. |
moving_window: Window | ImGuiWindow* MovingWindow; | Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindowDockTree. |
wheeling_window: Window | ImGuiWindow* WheelingWindow; | Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window. |
wheeling_window_ref_mouse_pos: ImVec2 | ImVec2 WheelingWindowRefMousePos; | |
wheeling_window_start_frame: int | int WheelingWindowStartFrame; | This may be set one frame before WheelingWindow is != None |
wheeling_window_scrolled_frame: int | int WheelingWindowScrolledFrame; | |
wheeling_window_release_timer: float | float WheelingWindowReleaseTimer; | |
wheeling_window_wheel_remainder: ImVec2 | ImVec2 WheelingWindowWheelRemainder; | |
wheeling_axis_avg: ImVec2 | ImVec2 WheelingAxisAvg; | |
mixed_value_label: str | const char* MixedValueLabel; | Value replacement when displaying a mixed value. Default to “-” (Unreal uses “Multiple values”, Unity uses “---”). May be interpreted as a format: must not contain single %. Set to None to display original value. # (const) |
debug_draw_id_conflicts_id: ID | ImGuiID DebugDrawIdConflictsId; | Set when we detect multiple items with the same identifier |
debug_hook_id_info_id: ID | ImGuiID DebugHookIdInfoId; | Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line] |
hovered_id: ID | ImGuiID HoveredId; | Hovered widget, filled during the frame |
hovered_id_previous_frame: ID | ImGuiID HoveredIdPreviousFrame; | |
hovered_id_previous_frame_item_count: int | int HoveredIdPreviousFrameItemCount; | Count numbers of items using the same ID as last frame’s hovered id |
hovered_id_timer: float | float HoveredIdTimer; | Measure contiguous hovering time |
hovered_id_not_active_timer: float | float HoveredIdNotActiveTimer; | Measure contiguous hovering time where the item has not been active |
hovered_id_allow_overlap: bool | bool HoveredIdAllowOverlap; | |
hovered_id_is_disabled: bool | bool HoveredIdIsDisabled; | At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be True even if HoveredId == 0. |
item_unclip_by_log: bool | bool ItemUnclipByLog; | Disable ItemAdd() clipping, essentially a memory-locality friendly copy of LogEnabled |
any_id_has_been_edited_this_frame: bool | bool AnyIdHasBeenEditedThisFrame; | |
active_id: ID | ImGuiID ActiveId; | Active widget |
active_id_is_alive: ID | ImGuiID ActiveIdIsAlive; | Active widget has been seen this frame (we can’t use a bool as the ActiveId may change within the frame) |
active_id_timer: float | float ActiveIdTimer; | |
active_id_is_just_activated: bool | bool ActiveIdIsJustActivated; | Set at the time of activation for one frame |
active_id_was_selected: bool | bool ActiveIdWasSelected; | Active ID was selected at the time of activating |
active_id_was_sole_selected: bool | bool ActiveIdWasSoleSelected; | Active ID was sole selection at the time of activating |
active_id_allow_overlap: bool | bool ActiveIdAllowOverlap; | Active widget allows another widget to steal active id (generally for overlapping widgets, but not always) |
active_id_no_clear_on_focus_loss: bool | bool ActiveIdNoClearOnFocusLoss; | Disable losing active id if the active id window gets unfocused. |
active_id_has_been_pressed_before: bool | bool ActiveIdHasBeenPressedBefore; | Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch. |
active_id_has_been_edited_before: bool | bool ActiveIdHasBeenEditedBefore; | Was the value associated to the widget Edited over the course of the Active state. |
active_id_has_been_edited_this_frame: bool | bool ActiveIdHasBeenEditedThisFrame; | |
active_id_from_shortcut: bool | bool ActiveIdFromShortcut; | |
active_id_mouse_button: ImS8 | ImS8 ActiveIdMouseButton; | |
active_id_disabled_id: ID | ImGuiID ActiveIdDisabledId; | When clicking a disabled item we set ActiveId=window->MoveId to avoid interference with widget code. Actual item ID is stored here. |
active_id_click_offset: ImVec2 | ImVec2 ActiveIdClickOffset; | Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior) |
active_id_source: InputSource | ImGuiInputSource ActiveIdSource; | Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad |
active_id_window: Window | ImGuiWindow* ActiveIdWindow; | |
active_id_previous_frame: ID | ImGuiID ActiveIdPreviousFrame; | |
deactivated_item_data: DeactivatedItemData | ImGuiDeactivatedItemData DeactivatedItemData; | |
active_id_value_on_activation: DataTypeStorage | ImGuiDataTypeStorage ActiveIdValueOnActivation; | Backup of initial value at the time of activation. ONLY SET BY SPECIFIC WIDGETS: DragXXX and SliderXXX. |
last_active_id: ID | ImGuiID LastActiveId; | Store the last non-zero ActiveId, useful for animation. |
last_active_id_timer: float | float LastActiveIdTimer; | Store the last non-zero ActiveId timer since the beginning of activation, useful for animation. |
last_active_id_was_selected: bool | bool LastActiveIdWasSelected; | |
last_active_id_was_sole_selected: bool | bool LastActiveIdWasSoleSelected; | |
last_key_mods_change_time: float | double LastKeyModsChangeTime; | Record the last time key mods changed (affect repeat delay when using shortcut logic) |
last_key_mods_change_from_none_time: float | double LastKeyModsChangeFromNoneTime; | Record the last time key mods changed away from being 0 (affect repeat delay when using shortcut logic) |
last_keyboard_key_press_time: float | double LastKeyboardKeyPressTime; | Record the last time a keyboard key (ignore mouse/gamepad ones) was pressed. |
keys_routing_table: KeyRoutingTable | ImGuiKeyRoutingTable KeysRoutingTable; | |
active_id_using_nav_dir_mask: ImU32 | ImU32 ActiveIdUsingNavDirMask; | Active widget will want to read those nav move requests (e.g. can activate a button and move away from it) |
active_id_using_all_keyboard_keys: bool | bool ActiveIdUsingAllKeyboardKeys; | Active widget will want to read all keyboard keys inputs. (this is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations) |
debug_break_in_shortcut_routing: KeyChord | ImGuiKeyChord DebugBreakInShortcutRouting; | Set to break in SetShortcutRouting()/Shortcut() calls. |
current_focus_scope_id: ID | ImGuiID CurrentFocusScopeId; | Value for currently appending items == g.FocusScopeStack.back(). Not to be mistaken with g.NavFocusScopeId. |
current_item_flags: ItemFlags | ImGuiItemFlags CurrentItemFlags; | Value for currently appending items == g.ItemFlagsStack.back() |
debug_locate_id: ID | ImGuiID DebugLocateId; | Storage for DebugLocateItemOnHover() feature: this is read by ItemAdd() so we keep it in a hot/cached location |
next_item_data: NextItemData | ImGuiNextItemData NextItemData; | Storage for SetNextItem** functions |
last_item_data: LastItemData | ImGuiLastItemData LastItemData; | Storage for last submitted item (setup by ItemAdd) |
next_window_data: NextWindowData | ImGuiNextWindowData NextWindowData; | Storage for SetNextWindow** functions |
debug_show_group_rects: bool | bool DebugShowGroupRects; | |
gc_compact_all: bool | bool GcCompactAll; | Request full GC |
debug_flash_style_color_idx: Col | ImGuiCol DebugFlashStyleColorIdx; | (Keep close to ColorStack to share cache line) |
color_stack: ImVector_ColorMod | ImVector<ImGuiColorMod> ColorStack; | Stack for PushStyleColor()/PopStyleColor() - inherited by Begin() |
style_var_stack: ImVector_StyleMod | ImVector<ImGuiStyleMod> StyleVarStack; | Stack for PushStyleVar()/PopStyleVar() - inherited by Begin() |
focus_scope_stack: ImVector_FocusScopeData | ImVector<ImGuiFocusScopeData> FocusScopeStack; | Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin() |
item_flags_stack: ImVector_ItemFlags | ImVector<ImGuiItemFlags> ItemFlagsStack; | Stack for PushItemFlag()/PopItemFlag() - inherited by Begin() |
group_stack: ImVector_GroupData | ImVector<ImGuiGroupData> GroupStack; | Stack for BeginGroup()/EndGroup() - not inherited by Begin() |
open_popup_stack: ImVector_PopupData | ImVector<ImGuiPopupData> OpenPopupStack; | Which popups are open (persistent) |
begin_popup_stack: ImVector_PopupData | ImVector<ImGuiPopupData> BeginPopupStack; | Which level of BeginPopup() we are in (reset every frame) |
tree_node_stack: ImVector_TreeNodeStackData | ImVector<ImGuiTreeNodeStackData>TreeNodeStack; | Stack for TreeNode() |
viewports: ImVector_ViewportP_ptr | ImVector<ImGuiViewportP*> Viewports; | Active viewports (always 1+, and generally 1 unless multi-viewports are enabled). Each viewports hold their copy of ImDrawData. |
current_viewport: ViewportP | ImGuiViewportP* CurrentViewport; | We track changes of viewport (happening in Begin) so we can call Platform_OnChangedViewport() |
mouse_viewport: ViewportP | ImGuiViewportP* MouseViewport; | |
mouse_last_hovered_viewport: ViewportP | ImGuiViewportP* MouseLastHoveredViewport; | Last known viewport that was hovered by mouse (even if we are not hovering any viewport any more) + honoring the _NoInputs flag. |
platform_last_focused_viewport_id: ID | ImGuiID PlatformLastFocusedViewportId; | |
fallback_monitor: PlatformMonitor | ImGuiPlatformMonitor FallbackMonitor; | Virtual monitor used as fallback if backend doesn’t provide monitor information. |
platform_monitors_full_work_rect: ImRect | ImRect PlatformMonitorsFullWorkRect; | Bounding box of all platform monitors |
viewport_created_count: int | int ViewportCreatedCount; | Unique sequential creation counter (mostly for testing/debugging) |
platform_windows_created_count: int | int PlatformWindowsCreatedCount; | Unique sequential creation counter (mostly for testing/debugging) |
viewport_focused_stamp_count: int | int ViewportFocusedStampCount; | Every time the front-most window changes, we stamp its viewport with an incrementing counter |
nav_cursor_visible: bool | bool NavCursorVisible; | Nav focus cursor/rectangle is visible? We hide it after a mouse click. We show it after a nav move. |
nav_highlight_item_under_nav: bool | bool NavHighlightItemUnderNav; | Disable mouse hovering highlight. Highlight navigation focused item instead of mouse hovered item. |
nav_mouse_pos_dirty: bool | bool NavMousePosDirty; | When set we will update mouse position if io.ConfigNavMoveSetMousePos is set (not enabled by default) |
nav_id_is_alive: bool | bool NavIdIsAlive; | Nav widget has been seen this frame ~~ NavRectRel is valid |
nav_id: ID | ImGuiID NavId; | Focused item for navigation |
nav_window: Window | ImGuiWindow* NavWindow; | Focused window for navigation. Could be called ‘FocusedWindow’ |
nav_focus_scope_id: ID | ImGuiID NavFocusScopeId; | Focused focus scope (e.g. selection code often wants to “clear other items” when landing on an item of the same scope) |
nav_layer: NavLayer | ImGuiNavLayer NavLayer; | Focused layer (main scrolling layer, or menu/title bar layer) |
nav_id_item_flags: ItemFlags | ImGuiItemFlags NavIdItemFlags; | |
nav_activate_id: ID | ImGuiID NavActivateId; | ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItemByID() |
nav_activate_down_id: ID | ImGuiID NavActivateDownId; | ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0 |
nav_activate_pressed_id: ID | ImGuiID NavActivatePressedId; | ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat) |
nav_activate_flags: ActivateFlags | ImGuiActivateFlags NavActivateFlags; | |
nav_focus_route: ImVector_FocusScopeData | ImVector<ImGuiFocusScopeData> NavFocusRoute; | Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain. |
nav_highlight_activated_id: ID | ImGuiID NavHighlightActivatedId; | |
nav_highlight_activated_timer: float | float NavHighlightActivatedTimer; | |
nav_open_context_menu_item_id: ID | ImGuiID NavOpenContextMenuItemId; | |
nav_open_context_menu_window_id: ID | ImGuiID NavOpenContextMenuWindowId; | |
nav_next_activate_id: ID | ImGuiID NavNextActivateId; | Set by ActivateItemByID(), queued until next frame. |
nav_next_activate_flags: ActivateFlags | ImGuiActivateFlags NavNextActivateFlags; | |
nav_input_source: InputSource | ImGuiInputSource NavInputSource; | Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Gamepad |
nav_last_valid_selection_user_data: SelectionUserData | ImGuiSelectionUserData NavLastValidSelectionUserData; | Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn’t have selection data. |
nav_cursor_hide_frames: ImS8 | ImS8 NavCursorHideFrames; | |
nav_any_request: bool | bool NavAnyRequest; | ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd() |
nav_init_request: bool | bool NavInitRequest; | Init request for appearing window to select first item |
nav_init_request_from_move: bool | bool NavInitRequestFromMove; | |
nav_init_result: NavItemData | ImGuiNavItemData NavInitResult; | Init request result (first item of the window, or one for which SetItemDefaultFocus() was called) |
nav_move_submitted: bool | bool NavMoveSubmitted; | Move request submitted, will process result on next NewFrame() |
nav_move_scoring_items: bool | bool NavMoveScoringItems; | Move request submitted, still scoring incoming items |
nav_move_forward_to_next_frame: bool | bool NavMoveForwardToNextFrame; | |
nav_move_flags: NavMoveFlags | ImGuiNavMoveFlags NavMoveFlags; | |
nav_move_scroll_flags: ScrollFlags | ImGuiScrollFlags NavMoveScrollFlags; | |
nav_move_key_mods: KeyChord | ImGuiKeyChord NavMoveKeyMods; | |
nav_move_dir: Dir | ImGuiDir NavMoveDir; | Direction of the move request (left/right/up/down) |
nav_move_dir_for_debug: Dir | ImGuiDir NavMoveDirForDebug; | |
nav_move_clip_dir: Dir | ImGuiDir NavMoveClipDir; | FIXME-NAV: Describe the purpose of this better. Might want to rename? |
nav_scoring_rect: ImRect | ImRect NavScoringRect; | Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring. |
nav_scoring_no_clip_rect: ImRect | ImRect NavScoringNoClipRect; | Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted. Unset/invalid if inverted. |
nav_scoring_debug_count: int | int NavScoringDebugCount; | Metrics for debugging |
nav_tabbing_dir: int | int NavTabbingDir; | Generally -1 or +1, 0 when tabbing without a nav id |
nav_tabbing_counter: int | int NavTabbingCounter; | >0 when counting items for tabbing |
nav_move_result_local: NavItemData | ImGuiNavItemData NavMoveResultLocal; | Best move request candidate within NavWindow |
nav_move_result_local_visible: NavItemData | ImGuiNavItemData NavMoveResultLocalVisible; | Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag) |
nav_move_result_other: NavItemData | ImGuiNavItemData NavMoveResultOther; | Best move request candidate within NavWindow’s flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag) |
nav_tabbing_result_first: NavItemData | ImGuiNavItemData NavTabbingResultFirst; | First tabbing request candidate within NavWindow and flattened hierarchy |
nav_just_moved_from_focus_scope_id: ID | ImGuiID NavJustMovedFromFocusScopeId; | Just navigated from this focus scope id (result of a successfully MoveRequest). |
nav_just_moved_to_id: ID | ImGuiID NavJustMovedToId; | Just navigated to this id (result of a successfully MoveRequest). |
nav_just_moved_to_focus_scope_id: ID | ImGuiID NavJustMovedToFocusScopeId; | Just navigated to this focus scope id (result of a successfully MoveRequest). |
nav_just_moved_to_key_mods: KeyChord | ImGuiKeyChord NavJustMovedToKeyMods; | |
nav_just_moved_to_is_tabbing: bool | bool NavJustMovedToIsTabbing; | Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags. |
nav_just_moved_to_has_selection_data: bool | bool NavJustMovedToHasSelectionData; | Copy of move result’s ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData. |
config_nav_enable_tabbing: bool | bool ConfigNavEnableTabbing; | = True. Enable tabbing (Tab, Shift+Tab). PLEASE LET ME KNOW IF YOU USE THIS. |
config_nav_windowing_with_gamepad: bool | bool ConfigNavWindowingWithGamepad; | = True. Enable Ctrl+Tab by holding ImGuiKey_GamepadFaceLeft (== ImGuiKey_NavGamepadMenu). When False, the button may still be used to toggle Menu layer. |
config_nav_windowing_key_next: KeyChord | ImGuiKeyChord ConfigNavWindowingKeyNext; | = ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). Set to 0 to disable. For reconfiguration (see #4828) |
config_nav_windowing_key_prev: KeyChord | ImGuiKeyChord ConfigNavWindowingKeyPrev; | = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab on OS X) |
nav_windowing_target: Window | ImGuiWindow* NavWindowingTarget; | Target window when doing Ctrl+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most! |
nav_windowing_target_anim: Window | ImGuiWindow* NavWindowingTargetAnim; | Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0, so the fade-out can stay on it. |
nav_windowing_list_window: Window | ImGuiWindow* NavWindowingListWindow; | Internal window actually listing the Ctrl+Tab contents |
nav_windowing_timer: float | float NavWindowingTimer; | |
nav_windowing_highlight_alpha: float | float NavWindowingHighlightAlpha; | |
nav_windowing_input_source: InputSource | ImGuiInputSource NavWindowingInputSource; | |
nav_windowing_toggle_layer: bool | bool NavWindowingToggleLayer; | Set while Alt or GamepadMenu is held, may be cleared by other operations, and processed when releasing the key. |
nav_windowing_toggle_key: Key | ImGuiKey NavWindowingToggleKey; | Keyboard/gamepad key used when toggling to menu layer. |
nav_windowing_accum_delta_pos: ImVec2 | ImVec2 NavWindowingAccumDeltaPos; | |
nav_windowing_accum_delta_size: ImVec2 | ImVec2 NavWindowingAccumDeltaSize; | |
dim_bg_ratio: float | float DimBgRatio; | 0.0..1.0 animation when fading in a dimming background (for modal window and Ctrl+Tab list) |
drag_drop_active: bool | bool DragDropActive; | |
drag_drop_within_source: bool | bool DragDropWithinSource; | Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag source. |
drag_drop_within_target: bool | bool DragDropWithinTarget; | Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag target. |
drag_drop_source_flags: DragDropFlags | ImGuiDragDropFlags DragDropSourceFlags; | |
drag_drop_source_frame_count: int | int DragDropSourceFrameCount; | |
drag_drop_mouse_button: int | int DragDropMouseButton; | |
drag_drop_payload: Payload | ImGuiPayload DragDropPayload; | |
drag_drop_target_rect: ImRect | ImRect DragDropTargetRect; | Store rectangle of current target candidate (we favor small targets when overlapping) |
drag_drop_target_clip_rect: ImRect | ImRect DragDropTargetClipRect; | Store ClipRect at the time of item’s drawing |
drag_drop_target_id: ID | ImGuiID DragDropTargetId; | |
drag_drop_target_full_viewport: ID | ImGuiID DragDropTargetFullViewport; | |
drag_drop_accept_flags_curr: DragDropFlags | ImGuiDragDropFlags DragDropAcceptFlagsCurr; | |
drag_drop_accept_flags_prev: DragDropFlags | ImGuiDragDropFlags DragDropAcceptFlagsPrev; | |
drag_drop_accept_id_curr_rect_surface: float | float DragDropAcceptIdCurrRectSurface; | Target item surface (we resolve overlapping targets by prioritizing the smaller surface) |
drag_drop_accept_id_curr: ID | ImGuiID DragDropAcceptIdCurr; | Target item id (set at the time of accepting the payload) |
drag_drop_accept_id_prev: ID | ImGuiID DragDropAcceptIdPrev; | Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets) |
drag_drop_accept_frame_count: int | int DragDropAcceptFrameCount; | Last time a target expressed a desire to accept the source |
drag_drop_hold_just_pressed_id: ID | ImGuiID DragDropHoldJustPressedId; | Set when holding a payload just made ButtonBehavior() return a press. |
drag_drop_payload_buf_heap: ImVector_uchar | ImVector<uchar> DragDropPayloadBufHeap; | We don’t expose the ImVector<> directly, ImGuiPayload only holds pointer+size |
clipper_temp_data_stacked: int | int ClipperTempDataStacked; | |
clipper_temp_data: ImVector_ListClipperData | ImVector<ImGuiListClipperData> ClipperTempData; | |
current_table: Table | ImGuiTable* CurrentTable; | |
debug_break_in_table: ID | ImGuiID DebugBreakInTable; | Set to break in BeginTable() call. |
tables_temp_data_stacked: int | int TablesTempDataStacked; | Temporary table data size (because we leave previous instances undestructed, we generally don’t use TablesTempData.Size) |
tables_temp_data: ImVector_TableTempData | ImVector<ImGuiTableTempData> TablesTempData; | Temporary table data (buffers reused/shared across instances, support nesting) |
tables_last_time_active: ImVector_float | ImVector<float> TablesLastTimeActive; | Last used timestamp of each tables (SOA, for efficient GC) |
draw_channels_temp_merge_buffer: ImVector_ImDrawChannel | ImVector<ImDrawChannel> DrawChannelsTempMergeBuffer; | |
current_tab_bar: TabBar | ImGuiTabBar* CurrentTabBar; | |
current_tab_bar_stack: ImVector_PtrOrIndex | ImVector<ImGuiPtrOrIndex> CurrentTabBarStack; | |
shrink_width_buffer: ImVector_ShrinkWidthItem | ImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer; | |
box_select_state: BoxSelectState | ImGuiBoxSelectState BoxSelectState; | |
current_multi_select: MultiSelectTempData | ImGuiMultiSelectTempData* CurrentMultiSelect; | |
multi_select_temp_data_stacked: int | int MultiSelectTempDataStacked; | Temporary multi-select data size (because we leave previous instances undestructed, we generally don’t use MultiSelectTempData.Size) |
multi_select_temp_data: ImVector_MultiSelectTempData | ImVector<ImGuiMultiSelectTempData> MultiSelectTempData; | |
hover_item_delay_id: ID | ImGuiID HoverItemDelayId; | |
hover_item_delay_id_previous_frame: ID | ImGuiID HoverItemDelayIdPreviousFrame; | |
hover_item_delay_timer: float | float HoverItemDelayTimer; | Currently used by IsItemHovered() |
hover_item_delay_clear_timer: float | float HoverItemDelayClearTimer; | Currently used by IsItemHovered(): grace time before g.TooltipHoverTimer gets cleared. |
hover_item_unlocked_stationary_id: ID | ImGuiID HoverItemUnlockedStationaryId; | Mouse has once been stationary on this item. Only reset after departing the item. |
hover_window_unlocked_stationary_id: ID | ImGuiID HoverWindowUnlockedStationaryId; | Mouse has once been stationary on this window. Only reset after departing the window. |
mouse_cursor: MouseCursor | ImGuiMouseCursor MouseCursor; | |
mouse_stationary_timer: float | float MouseStationaryTimer; | Time the mouse has been stationary (with some loose heuristic) |
mouse_last_valid_pos: ImVec2 | ImVec2 MouseLastValidPos; | |
input_text_state: InputTextState | ImGuiInputTextState InputTextState; | |
input_text_line_index: TextIndex | ImGuiTextIndex InputTextLineIndex; | Temporary storage |
input_text_deactivated_state: InputTextDeactivatedState | ImGuiInputTextDeactivatedState InputTextDeactivatedState; | |
input_text_password_font_backup_baked: ImFontBaked | ImFontBaked InputTextPasswordFontBackupBaked; | |
input_text_password_font_backup_flags: ImFontFlags | ImFontFlags InputTextPasswordFontBackupFlags; | |
input_text_reactivate_id: ID | ImGuiID InputTextReactivateId; | ID of InputText to reactivate on next frame (for io.ConfigInputTextEnterKeepActive behavior) |
temp_input_id: ID | ImGuiID TempInputId; | Temporary text input when using Ctrl+Click on a slider, etc. |
data_type_zero_value: DataTypeStorage | ImGuiDataTypeStorage DataTypeZeroValue; | 0 for all data types |
begin_menu_depth: int | int BeginMenuDepth; | |
begin_combo_depth: int | int BeginComboDepth; | |
color_edit_current_id: ID | ImGuiID ColorEditCurrentID; | Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others). |
color_edit_saved_id: ID | ImGuiID ColorEditSavedID; | ID we are saving/restoring HS for |
color_edit_saved_hue: float | float ColorEditSavedHue; | Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips |
color_edit_saved_sat: float | float ColorEditSavedSat; | Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips |
color_edit_saved_color: ImU32 | ImU32 ColorEditSavedColor; | RGB value with alpha set to 0. |
color_picker_ref: ImVec4 | ImVec4 ColorPickerRef; | Initial/reference color at the time of opening the color picker. |
combo_preview_data: ComboPreviewData | ImGuiComboPreviewData ComboPreviewData; | |
window_resize_border_expected_rect: ImRect | ImRect WindowResizeBorderExpectedRect; | Expected border rect, switch to relative edit if moving |
window_resize_relative_mode: bool | bool WindowResizeRelativeMode; | |
scrollbar_seek_mode: int | short ScrollbarSeekMode; | 0: scroll to clicked location, -1/+1: prev/next page. |
scrollbar_click_delta_to_grab_center: float | float ScrollbarClickDeltaToGrabCenter; | When scrolling to mouse location: distance between mouse and center of grab box, normalized in parent space. |
slider_grab_click_offset: float | float SliderGrabClickOffset; | |
slider_current_accum: float | float SliderCurrentAccum; | Accumulated slider delta when using navigation controls. |
slider_current_accum_dirty: bool | bool SliderCurrentAccumDirty; | Has the accumulated slider delta changed since last time we tried to apply it? |
drag_current_accum_dirty: bool | bool DragCurrentAccumDirty; | |
drag_current_accum: float | float DragCurrentAccum; | Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings |
drag_speed_default_ratio: float | float DragSpeedDefaultRatio; | If speed == 0.0, uses (max-min) * DragSpeedDefaultRatio |
disabled_alpha_backup: float | float DisabledAlphaBackup; | Backup for style.Alpha for BeginDisabled() |
disabled_stack_size: int | short DisabledStackSize; | |
tooltip_override_count: int | short TooltipOverrideCount; | |
tooltip_previous_window: Window | ImGuiWindow* TooltipPreviousWindow; | Window of last tooltip submitted during the frame |
clipboard_handler_data: ImVector_char | ImVector<char> ClipboardHandlerData; | If no custom clipboard handler is defined |
menus_id_submitted_this_frame: ImVector_ID | ImVector<ImGuiID> MenusIdSubmittedThisFrame; | A list of menu IDs that were rendered at least once |
typing_select_state: TypingSelectState | ImGuiTypingSelectState TypingSelectState; | State for GetTypingSelectRequest() |
platform_ime_data: PlatformImeData | ImGuiPlatformImeData PlatformImeData; | Data updated by current frame. Will be applied at end of the frame. For some backends, this is required to have WantVisible=True in order to receive text message. |
platform_ime_data_prev: PlatformImeData | ImGuiPlatformImeData PlatformImeDataPrev; | Previous frame data. When changed we call the platform_io.Platform_SetImeDataFn() handler. |
user_textures: ImVector_ImTextureData_ptr | ImVector<ImTextureData*> UserTextures; | List of textures created/managed by user or third-party extension. Automatically appended into platform_io.Textures[]. |
dock_context: DockContext | ImGuiDockContext DockContext; | |
session_date: PackedDate | ImGuiPackedDate SessionDate; | Packed copy of platform_io.Platform_SessionDate, when valid. |
settings_loaded: bool | bool SettingsLoaded; | |
settings_dirty_timer: float | float SettingsDirtyTimer; | Save .ini Settings to memory when time reaches zero |
settings_ini_data: TextBuffer | ImGuiTextBuffer SettingsIniData; | In memory .ini settings |
settings_handlers: ImVector_SettingsHandler | ImVector<ImGuiSettingsHandler> SettingsHandlers; | List of .ini settings handlers |
hook_id_next: ID | ImGuiID HookIdNext; | Next available HookId |
log_enabled: bool | bool LogEnabled; | Currently capturing |
log_line_first_item: bool | bool LogLineFirstItem; | |
log_flags: LogFlags | ImGuiLogFlags LogFlags; | Capture flags/type |
log_window: Window | ImGuiWindow* LogWindow; | |
log_buffer: TextBuffer | ImGuiTextBuffer LogBuffer; | Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn’t call heap allocators. |
log_next_prefix: str | const char* LogNextPrefix; | See comment in LogSetNextTextDecoration(): doesn’t copy underlying data, use carefully! # (const) |
log_next_suffix: str | const char* LogNextSuffix; | (const) |
log_line_pos_y: float | float LogLinePosY; | |
log_depth_ref: int | int LogDepthRef; | |
log_depth_to_expand: int | int LogDepthToExpand; | |
log_depth_to_expand_default: int | int LogDepthToExpandDefault; | Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call. |
error_callback_user_data: Any | void* ErrorCallbackUserData; | = None |
error_tooltip_locked_pos: ImVec2 | ImVec2 ErrorTooltipLockedPos; | |
error_first: bool | bool ErrorFirst; | |
error_count_current_frame: int | int ErrorCountCurrentFrame; | [Internal] Number of errors submitted this frame. |
stack_sizes_in_new_frame: ErrorRecoveryState | ImGuiErrorRecoveryState StackSizesInNewFrame; | [Internal] |
stack_sizes_in_begin_for_current_window: ErrorRecoveryState | ImGuiErrorRecoveryState*StackSizesInBeginForCurrentWindow; | [Internal] |
debug_draw_id_conflicts_count: int | int DebugDrawIdConflictsCount; | Locked count (preserved when holding Ctrl) |
debug_log_flags: DebugLogFlags | ImGuiDebugLogFlags DebugLogFlags; | |
debug_log_buf: TextBuffer | ImGuiTextBuffer DebugLogBuf; | |
debug_log_index: TextIndex | ImGuiTextIndex DebugLogIndex; | |
debug_log_skipped_errors: int | int DebugLogSkippedErrors; | |
debug_log_auto_disable_flags: DebugLogFlags | ImGuiDebugLogFlags DebugLogAutoDisableFlags; | |
debug_log_auto_disable_frames: ImU8 | ImU8 DebugLogAutoDisableFrames; | |
debug_locate_frames: ImU8 | ImU8 DebugLocateFrames; | For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above. |
debug_break_in_locate_id: bool | bool DebugBreakInLocateId; | Debug break in ItemAdd() call for g.DebugLocateId. |
debug_break_key_chord: KeyChord | ImGuiKeyChord DebugBreakKeyChord; | = ImGuiKey_Pause |
debug_begin_return_value_cull_depth: ImS8 | ImS8 DebugBeginReturnValueCullDepth; | Cycle between 0..9 then wrap around. |
debug_item_picker_active: bool | bool DebugItemPickerActive; | Item picker is active (started with DebugStartItemPicker()) |
debug_item_picker_mouse_button: ImU8 | ImU8 DebugItemPickerMouseButton; | |
debug_item_picker_break_id: ID | ImGuiID DebugItemPickerBreakId; | Will call IM_DEBUG_BREAK() when encountering this ID |
debug_flash_style_color_time: float | float DebugFlashStyleColorTime; | |
debug_flash_style_color_backup: ImVec4 | ImVec4 DebugFlashStyleColorBackup; | |
debug_metrics_config: MetricsConfig | ImGuiMetricsConfig DebugMetricsConfig; | |
debug_item_path_query: DebugItemPathQuery | ImGuiDebugItemPathQuery DebugItemPathQuery; | |
debug_id_stack_tool: IDStackTool | ImGuiIDStackTool DebugIDStackTool; | |
debug_alloc_info: DebugAllocInfo | ImGuiDebugAllocInfo DebugAllocInfo; | |
debug_hovered_dock_node: DockNode | ImGuiDockNode* DebugHoveredDockNode; | Hovered dock node. |
framerate_sec_per_frame: np.ndarray | float FramerateSecPerFrame[60]; | ndarray[type=float, size=60] # Calculate estimate of framerate for user over the last 60 frames.. |
framerate_sec_per_frame_idx: int | int FramerateSecPerFrameIdx; | |
framerate_sec_per_frame_count: int | int FramerateSecPerFrameCount; | |
framerate_sec_per_frame_accum: float | float FramerateSecPerFrameAccum; | |
want_capture_mouse_next_frame: int | int WantCaptureMouseNextFrame; | Explicit capture override via SetNextFrameWantCaptureMouse()/SetNextFrameWantCaptureKeyboard(). Default to -1. |
want_capture_keyboard_next_frame: int | int WantCaptureKeyboardNextFrame; | " |
want_text_input_next_frame: int | int WantTextInputNextFrame; | Copied in EndFrame() from g.PlatformImeData.WantTextInput. Needs to be set for some backends (SDL3) to emit character inputs. |
temp_buffer: ImVector_char | ImVector<char> TempBuffer; | Temporary text buffer |
Context.__init__¶
def __init__(self, shared_font_atlas: ImFontAtlas) -> NoneImGuiContext(ImFontAtlas* shared_font_atlas);ImGuiWindowTempData, ImGuiWindow¶
WindowTempData (class)¶
Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow. (That’s theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered..) (This doesn’t need a constructor because we zero-clear it as part of ImGuiWindow and all frame-temporary data are setup on Begin)
| Attribute | C++ | |
|---|---|---|
cursor_pos: ImVec2 | ImVec2 CursorPos; | Current emitting position, in absolute coordinates. |
cursor_pos_prev_line: ImVec2 | ImVec2 CursorPosPrevLine; | |
cursor_start_pos: ImVec2 | ImVec2 CursorStartPos; | Initial position after Begin(), generally ~ window position + WindowPadding. |
cursor_max_pos: ImVec2 | ImVec2 CursorMaxPos; | Used to implicitly calculate ContentSize at the beginning of next frame, for scrolling range and auto-resize. Always growing during the frame. |
ideal_max_pos: ImVec2 | ImVec2 IdealMaxPos; | Used to implicitly calculate ContentSizeIdeal at the beginning of next frame, for auto-resize only. Always growing during the frame. |
curr_line_size: ImVec2 | ImVec2 CurrLineSize; | |
prev_line_size: ImVec2 | ImVec2 PrevLineSize; | |
curr_line_text_base_offset: float | float CurrLineTextBaseOffset; | Baseline offset (0.0 by default on a new line, generally == style.FramePadding.y when a framed item has been added). |
prev_line_text_base_offset: float | float PrevLineTextBaseOffset; | |
is_same_line: bool | bool IsSameLine; | |
is_set_pos: bool | bool IsSetPos; | |
indent: ImVec1 | ImVec1 Indent; | Indentation / start position from left of window (increased by TreePush/TreePop, etc.) |
columns_offset: ImVec1 | ImVec1 ColumnsOffset; | Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API. |
group_offset: ImVec1 | ImVec1 GroupOffset; | |
cursor_start_pos_lossyness: ImVec2 | ImVec2 CursorStartPosLossyness; | Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensate and fix the most common use case of large scroll area. |
nav_layer_current: NavLayer | ImGuiNavLayer NavLayerCurrent; | Current layer, 0..31 (we currently only use 0..1) |
nav_layers_active_mask: int | short NavLayersActiveMask; | Which layers have been written to (result from previous frame) |
nav_layers_active_mask_next: int | short NavLayersActiveMaskNext; | Which layers have been written to (accumulator for current frame) |
nav_is_scroll_pushable_x: bool | bool NavIsScrollPushableX; | Set when current work location may be scrolled horizontally when moving left / right. This is generally always True UNLESS within a column. |
nav_hide_highlight_one_frame: bool | bool NavHideHighlightOneFrame; | |
nav_window_has_scroll_y: bool | bool NavWindowHasScrollY; | Set per window when scrolling can be used (== ScrollMax.y > 0.0) |
menu_bar_appending: bool | bool MenuBarAppending; | FIXME: Remove this |
menu_bar_offset: ImVec2 | ImVec2 MenuBarOffset; | MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs. |
menu_columns: MenuColumns | ImGuiMenuColumns MenuColumns; | Simplified columns storage for menu items measurement |
tree_depth: int | int TreeDepth; | Current tree depth. |
tree_has_stack_data_depth_mask: ImU32 | ImU32 TreeHasStackDataDepthMask; | Store whether given depth has ImGuiTreeNodeStackData data. Could be turned into a ImU64 if necessary. Sync any changes with TREE_NODE_MAX_DEPTH/TREE_NODE_GET_DEPTH_MASK! |
tree_records_clipped_nodes_y2_mask: ImU32 | ImU32 TreeRecordsClippedNodesY2Mask; | Store whether we should keep recording Y2. Cleared when passing clip max. Equivalent TreeHasStackDataDepthMask value should always be set. |
child_windows: ImVector_Window_ptr | ImVector<ImGuiWindow*> ChildWindows; | |
state_storage: Storage | ImGuiStorage* StateStorage; | Current persistent per-window storage (store e.g. tree node open/close state) |
current_columns: OldColumns | ImGuiOldColumns* CurrentColumns; | Current columns set |
current_table_idx: int | int CurrentTableIdx; | Current table index (into g.Tables) |
layout_type: LayoutType | ImGuiLayoutType LayoutType; | |
parent_layout_type: LayoutType | ImGuiLayoutType ParentLayoutType; | Layout type of parent window at the time of Begin() |
modal_dim_bg_color: ImU32 | ImU32 ModalDimBgColor; | |
window_item_status_flags: ItemStatusFlags | ImGuiItemStatusFlags WindowItemStatusFlags; | |
child_item_status_flags: ItemStatusFlags | ImGuiItemStatusFlags ChildItemStatusFlags; | |
dock_tab_item_status_flags: ItemStatusFlags | ImGuiItemStatusFlags DockTabItemStatusFlags; | |
dock_tab_item_rect: ImRect | ImRect DockTabItemRect; | |
item_width: float | float ItemWidth; | Current item width (>0.0: width in pixels, <0.0: align xx pixels to the right of window). |
item_width_default: float | float ItemWidthDefault; | |
text_wrap_pos: float | float TextWrapPos; | Current text wrap pos. |
item_width_stack: ImVector_float | ImVector<float> ItemWidthStack; | Store item widths to restore (attention: .back() is not == ItemWidth) |
text_wrap_pos_stack: ImVector_float | ImVector<float> TextWrapPosStack; | Store text wrap pos to restore (attention: .back() is not == TextWrapPos) |
WindowTempData.__init__¶
def __init__(self, cursor_pos: Optional[ImVec2Like] = None, cursor_pos_prev_line: Optional[ImVec2Like] = None, cursor_start_pos: Optional[ImVec2Like] = None, cursor_max_pos: Optional[ImVec2Like] = None, ideal_max_pos: Optional[ImVec2Like] = None, curr_line_size: Optional[ImVec2Like] = None, prev_line_size: Optional[ImVec2Like] = None, curr_line_text_base_offset: float = float(), prev_line_text_base_offset: float = float(), is_same_line: bool = bool(), is_set_pos: bool = bool(), indent: Optional[ImVec1] = None, columns_offset: Optional[ImVec1] = None, group_offset: Optional[ImVec1] = None, cursor_start_pos_lossyness: Optional[ImVec2Like] = None, nav_layer_current: NavLayer = NavLayer(), nav_layers_active_mask: int = int(), nav_layers_active_mask_next: int = int(), nav_is_scroll_pushable_x: bool = bool(), nav_hide_highlight_one_frame: bool = bool(), nav_window_has_scroll_y: bool = bool(), menu_bar_appending: bool = bool(), menu_bar_offset: Optional[ImVec2Like] = None, menu_columns: Optional[MenuColumns] = None, tree_depth: int = int(), tree_has_stack_data_depth_mask: ImU32 = ImU32(), tree_records_clipped_nodes_y2_mask: ImU32 = ImU32(), child_windows: Optional[ImVector_Window] = None, current_table_idx: int = int(), layout_type: Optional[LayoutType] = None, parent_layout_type: Optional[LayoutType] = None, modal_dim_bg_color: ImU32 = ImU32(), window_item_status_flags: ItemStatusFlags = ItemStatusFlags(), child_item_status_flags: ItemStatusFlags = ItemStatusFlags(), dock_tab_item_status_flags: ItemStatusFlags = ItemStatusFlags(), dock_tab_item_rect: Optional[ImRect] = None, item_width: float = float(), item_width_default: float = float(), text_wrap_pos: float = float(), item_width_stack: Optional[ImVector_float] = None, text_wrap_pos_stack: Optional[ImVector_float] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* CursorPos: ImVec2()
* CursorPosPrevLine: ImVec2()
* CursorStartPos: ImVec2()
* CursorMaxPos: ImVec2()
* IdealMaxPos: ImVec2()
* CurrLineSize: ImVec2()
* PrevLineSize: ImVec2()
* Indent: ImVec1()
* ColumnsOffset: ImVec1()
* GroupOffset: ImVec1()
* CursorStartPosLossyness: ImVec2()
* MenuBarOffset: ImVec2()
* MenuColumns: MenuColumns()
* ChildWindows: ImVector_Window_ptr()
* LayoutType: LayoutType()
* ParentLayoutType: LayoutType()
* DockTabItemRect: ImRect()
* ItemWidthStack: ImVector_float()
* TextWrapPosStack: ImVector_float()
Window (class)¶
Storage for one window
| Attribute | C++ | |
|---|---|---|
ctx: Context | ImGuiContext* Ctx; | Parent UI context (needs to be set explicitly by parent). |
name: char | char* Name; | Window name, owned by the window. # (read-only) |
id_: ID | ImGuiID ID; | == ImHashStr(Name) |
flags: WindowFlags | ImGuiWindowFlags Flags, | See enum ImGuiWindowFlags_ |
flags_previous_frame: WindowFlags | FlagsPreviousFrame; | See enum ImGuiWindowFlags_ |
child_flags: ChildFlags | ImGuiChildFlags ChildFlags; | Set when window is a child window. See enum ImGuiChildFlags_ |
window_class: WindowClass | ImGuiWindowClass WindowClass; | Advanced users only. Set with SetNextWindowClass() |
viewport: ViewportP | ImGuiViewportP* Viewport; | Always set in Begin(). Inactive windows may have a None value here if their viewport was discarded. |
viewport_id: ID | ImGuiID ViewportId; | We backup the viewport id (since the viewport may disappear or never be created if the window is inactive) |
viewport_pos: ImVec2 | ImVec2 ViewportPos; | We backup the viewport position (since the viewport may disappear or never be created if the window is inactive) |
viewport_allow_platform_monitor_extend: int | int ViewportAllowPlatformMonitorExtend; | Reset to -1 every frame (index is guaranteed to be valid between NewFrame..EndFrame), only used in the Appearing frame of a tooltip/popup to enforce clamping to a given monitor |
pos: ImVec2 | ImVec2 Pos; | Position (always rounded-up to nearest pixel) |
size: ImVec2 | ImVec2 Size; | Current size (==SizeFull or collapsed title bar size) |
size_full: ImVec2 | ImVec2 SizeFull; | Size when non collapsed |
content_size: ImVec2 | ImVec2 ContentSize; | Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding. |
content_size_ideal: ImVec2 | ImVec2 ContentSizeIdeal; | |
content_size_explicit: ImVec2 | ImVec2 ContentSizeExplicit; | Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize(). |
window_padding: ImVec2 | ImVec2 WindowPadding; | Window padding at the time of Begin(). |
window_rounding: float | float WindowRounding; | Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc. |
window_border_size: float | float WindowBorderSize; | Window border size at the time of Begin(). |
title_bar_height: float | float TitleBarHeight, | Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight. |
menu_bar_height: float | MenuBarHeight; | Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight. |
deco_outer_size_x1: float | float DecoOuterSizeX1, | Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin(). |
deco_outer_size_y1: float | DecoOuterSizeY1; | Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin(). |
deco_outer_size_x2: float | float DecoOuterSizeX2, | Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y). |
deco_outer_size_y2: float | DecoOuterSizeY2; | Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y). |
deco_inner_size_x1: float | float DecoInnerSizeX1, | Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes). |
deco_inner_size_y1: float | DecoInnerSizeY1; | Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes). |
name_buf_len: int | int NameBufLen; | Size of buffer storing Name. May be larger than strlen(Name)! |
move_id: ID | ImGuiID MoveId; | == window->GetID(“#MOVE”) |
tab_id: ID | ImGuiID TabId; | == window->GetID(“#TAB”) |
child_id: ID | ImGuiID ChildId; | ID of corresponding item in parent window (for navigation to return from child window to parent window) |
popup_id: ID | ImGuiID PopupId; | ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) |
scroll: ImVec2 | ImVec2 Scroll; | |
scroll_max: ImVec2 | ImVec2 ScrollMax; | |
scroll_target: ImVec2 | ImVec2 ScrollTarget; | target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0. (FLT_MAX for no change) |
scroll_target_center_ratio: ImVec2 | ImVec2 ScrollTargetCenterRatio; | 0.0 = scroll so that target position is at top, 0.5 = scroll so that target position is centered |
scroll_target_edge_snap_dist: ImVec2 | ImVec2 ScrollTargetEdgeSnapDist; | 0.0 = no snapping, >0.0 snapping threshold |
scrollbar_sizes: ImVec2 | ImVec2 ScrollbarSizes; | Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar. |
scrollbar_x: bool | bool ScrollbarX, | Are scrollbars visible? |
scrollbar_y: bool | ScrollbarY; | Are scrollbars visible? |
scrollbar_x_stabilize_enabled: bool | bool ScrollbarXStabilizeEnabled; | Was ScrollbarX previously auto-stabilized? |
scrollbar_x_stabilize_toggled_history: ImU8 | ImU8 ScrollbarXStabilizeToggledHistory; | Used to stabilize scrollbar visibility in case of feedback loops |
viewport_owned: bool | bool ViewportOwned; | |
active: bool | bool Active; | Set to True on Begin(), unless Collapsed |
was_active: bool | bool WasActive; | |
write_accessed: bool | bool WriteAccessed; | Set to True when any widget access the current window |
collapsed: bool | bool Collapsed; | Set when collapsing window to become only title-bar |
want_collapse_toggle: bool | bool WantCollapseToggle; | |
skip_items: bool | bool SkipItems; | Set when items can safely be all clipped (e.g. window not visible or collapsed) |
skip_refresh: bool | bool SkipRefresh; | [EXPERIMENTAL] Reuse previous frame drawn contents, Begin() returns False. |
appearing: bool | bool Appearing; | Set during the frame where the window is appearing (or re-appearing) |
hidden: bool | bool Hidden; | Do not display (== HiddenFrames*** > 0) |
is_fallback_window: bool | bool IsFallbackWindow; | Set on the “Debug##Default” window. |
is_explicit_child: bool | bool IsExplicitChild; | Set when passed _ChildWindow, left to False by BeginDocked() |
has_close_button: bool | bool HasCloseButton; | Set when the window has a close button (p_open != None) |
resize_border_hovered: int | signed char ResizeBorderHovered; | Current border being hovered for resize (-1: none, otherwise 0-3) |
resize_border_held: int | signed char ResizeBorderHeld; | Current border being held for resize (-1: none, otherwise 0-3) |
begin_count: int | short BeginCount; | Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs) |
begin_count_previous_frame: int | short BeginCountPreviousFrame; | Number of Begin() during the previous frame |
begin_order_within_parent: int | short BeginOrderWithinParent; | Begin() order within immediate parent window, if we are a child window. Otherwise 0. |
begin_order_within_context: int | short BeginOrderWithinContext; | Begin() order within entire imgui context. This is mostly used for debugging submission order related issues. |
focus_order: int | short FocusOrder; | Order within WindowsFocusOrder[], altered when windows are focused. |
auto_pos_last_direction: Dir | ImGuiDir AutoPosLastDirection; | |
auto_fit_frames_x: ImS8 | ImS8 AutoFitFramesX, | |
auto_fit_frames_y: ImS8 | AutoFitFramesY; | |
auto_fit_only_grows: bool | bool AutoFitOnlyGrows; | |
hidden_frames_can_skip_items: ImS8 | ImS8 HiddenFramesCanSkipItems; | Hide the window for N frames |
hidden_frames_cannot_skip_items: ImS8 | ImS8 HiddenFramesCannotSkipItems; | Hide the window for N frames while allowing items to be submitted so we can measure their size |
hidden_frames_for_render_only: ImS8 | ImS8 HiddenFramesForRenderOnly; | Hide the window until frame N at Render() time only |
disable_inputs_frames: ImS8 | ImS8 DisableInputsFrames; | Disable window interactions for N frames |
set_window_pos_val: ImVec2 | ImVec2 SetWindowPosVal; | store window position when using a non-zero Pivot (position set needs to be processed when we know the window size) |
set_window_pos_pivot: ImVec2 | ImVec2 SetWindowPosPivot; | store window pivot for positioning. ImVec2(0, 0) when positioning from top-left corner; ImVec2(0.5, 0.5) for centering; ImVec2(1, 1) for bottom right. |
id_stack: ImVector_ID | ImVector<ImGuiID> IDStack; | ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure) |
dc: WindowTempData | ImGuiWindowTempData DC; | Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the “DC” variable name. |
outer_rect_clipped: ImRect | ImRect OuterRectClipped; | == Window->Rect() just after setup in Begin(). == window->Rect() for root window. |
inner_rect: ImRect | ImRect InnerRect; | Inner rectangle (omit title bar, menu bar, scroll bar) |
inner_clip_rect: ImRect | ImRect InnerClipRect; | == InnerRect shrunk by WindowPadding*0.5 on each side, clipped within viewport or parent clip rect. |
work_rect: ImRect | ImRect WorkRect; | Initially covers the whole scrolling region. Reduced by containers e.g columns/tables when active. Shrunk by WindowPadding*1.0 on each side. This is meant to replace ContentRegionRect over time (from 1.71+ onward). |
parent_work_rect: ImRect | ImRect ParentWorkRect; | Backup of WorkRect before entering a container such as columns/tables. Used by e.g. SpanAllColumns functions to easily access. Stacked containers are responsible for maintaining this. // FIXME-WORKRECT: Could be a stack? |
clip_rect: ImRect | ImRect ClipRect; | Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back(). |
content_region_rect: ImRect | ImRect ContentRegionRect; | FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on. |
hit_test_hole_size: ImVec2ih | ImVec2ih HitTestHoleSize; | Define an optional rectangular hole where mouse will pass-through the window. |
hit_test_hole_offset: ImVec2ih | ImVec2ih HitTestHoleOffset; | |
last_frame_active: int | int LastFrameActive; | Last frame number the window was Active. |
last_frame_just_focused: int | int LastFrameJustFocused; | Last frame number the window was made Focused. |
last_time_active: float | float LastTimeActive; | Last timestamp the window was Active (using float as we don’t need high precision there) |
state_storage: Storage | ImGuiStorage StateStorage; | |
columns_storage: ImVector_OldColumns | ImVector<ImGuiOldColumns> ColumnsStorage; | |
font_window_scale: float | float FontWindowScale; | User scale multiplier per-window, via SetWindowFontScale() |
font_window_scale_parents: float | float FontWindowScaleParents; | |
font_ref_size: float | float FontRefSize; | This is a copy of window->CalcFontSize() at the time of Begin(), trying to phase out CalcFontSize() especially as it may be called on non-current window. |
settings_offset: int | int SettingsOffset; | Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back) |
draw_list: ImDrawList | ImDrawList* DrawList; | == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer) |
draw_list_inst: ImDrawList | ImDrawList DrawListInst; | |
parent_window: Window | ImGuiWindow* ParentWindow; | If we are a child or popup or docked window, this is pointing to our parent. Otherwise None. |
parent_window_in_begin_stack: Window | ImGuiWindow* ParentWindowInBeginStack; | |
root_window: Window | ImGuiWindow* RootWindow; | Point to ourself or first ancestor that is not a child window. Doesn’t cross through popups/dock nodes. |
root_window_popup_tree: Window | ImGuiWindow* RootWindowPopupTree; | Point to ourself or first ancestor that is not a child window. Cross through popups parent<>child. |
root_window_dock_tree: Window | ImGuiWindow* RootWindowDockTree; | Point to ourself or first ancestor that is not a child window. Cross through dock nodes. |
root_window_for_title_bar_highlight: Window | ImGuiWindow* RootWindowForTitleBarHighlight; | Point to ourself or first ancestor which will display TitleBgActive color when this window is active. |
root_window_for_nav: Window | ImGuiWindow* RootWindowForNav; | Point to ourself or first ancestor which doesn’t have the NavFlattened flag. |
parent_window_for_focus_route: Window | ImGuiWindow* ParentWindowForFocusRoute; | Set to manual link a window to its logical parent so that Shortcut() chain are honored (e.g. Tool linked to Document) |
nav_last_child_nav_window: Window | ImGuiWindow* NavLastChildNavWindow; | When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.) |
nav_root_focus_scope_id: ID | ImGuiID NavRootFocusScopeId; | Focus Scope ID at the time of Begin() |
memory_draw_list_idx_capacity: int | int MemoryDrawListIdxCapacity; | Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy |
memory_draw_list_vtx_capacity: int | int MemoryDrawListVtxCapacity; | |
memory_compacted: bool | bool MemoryCompacted; | Set when window extraneous data have been garbage collected |
dock_order: int | short DockOrder; | Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible. |
dock_style: WindowDockStyle | ImGuiWindowDockStyle DockStyle; | |
dock_node: DockNode | ImGuiDockNode* DockNode; | Which node are we docked into. Important: Prefer testing DockIsActive in many cases as this will still be set when the dock node is hidden. |
dock_node_as_host: DockNode | ImGuiDockNode* DockNodeAsHost; | Which node are we owning (for parent windows) |
dock_id: ID | ImGuiID DockId; | Backup of last valid DockNode->ID, so single window remember their dock node id even when they are not bound any more |
Window.__init__¶
def __init__(self, context: Context, name: str) -> NoneImGuiWindow(ImGuiContext* context, const char* name);Window.get_id¶
@overload
def get_id(self, str: str, str_end: Optional[str] = None) -> ID
@overload
def get_id(self, ptr: Any) -> ID
@overload
def get_id(self, n: int) -> IDImGuiID GetID(const char* str, const char* str_end = NULL);
ImGuiID GetID(const void* ptr);
ImGuiID GetID(int n);(private API)
Window.get_id_from_pos¶
def get_id_from_pos(self, p_abs: ImVec2Like) -> IDImGuiID GetIDFromPos(const ImVec2& p_abs);(private API)
Window.get_id_from_rectangle¶
def get_id_from_rectangle(self, r_abs: ImRect) -> IDImGuiID GetIDFromRectangle(const ImRect& r_abs);(private API)
Window.rect¶
def rect(self) -> ImRectImRect Rect() const;(private API)
We don’t use g.FontSize because the window may be != g.CurrentWindow.
Window.title_bar_rect¶
def title_bar_rect(self) -> ImRectImRect TitleBarRect() const;(private API)
Window.menu_bar_rect¶
def menu_bar_rect(self) -> ImRectImRect MenuBarRect() const;(private API)
TabBarFlagsPrivate_ (enum)¶
Extend ImGuiTabBarFlags_
| Member | Value | C++ | |
|---|---|---|---|
dock_node | 1 << 20 | ImGuiTabBarFlags_DockNode = 1 << 20 | Part of a dock node [we don’t use this in the master branch but it facilitate branch syncing to keep this around] |
is_focused | 1 << 21 | ImGuiTabBarFlags_IsFocused = 1 << 21 | |
save_settings | 1 << 22 | ImGuiTabBarFlags_SaveSettings = 1 << 22 | FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs |
TabItemFlagsPrivate_ (enum)¶
Extend ImGuiTabItemFlags_
| Member | Value | C++ | |
|---|---|---|---|
section_mask_ | TabItemFlags_Leading | TabItemFlags_Trailing | ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing | |
no_close_button | 1 << 20 | ImGuiTabItemFlags_NoCloseButton = 1 << 20 | Track whether p_open was set or not (we’ll need this info on the next frame to recompute ContentWidth during layout) |
button | 1 << 21 | ImGuiTabItemFlags_Button = 1 << 21 | Used by TabItemButton, change the tab item behavior to mimic a button |
invisible | 1 << 22 | ImGuiTabItemFlags_Invisible = 1 << 22 | To reserve space e.g. with ImGuiTabItemFlags_Leading |
unsorted | 1 << 23 | ImGuiTabItemFlags_Unsorted = 1 << 23 | [Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window. |
TabItem (class)¶
Storage for one active tab item (sizeof() 48 bytes)
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
flags: TabItemFlags | ImGuiTabItemFlags Flags; | |
window: Window | ImGuiWindow* Window; | When TabItem is part of a DockNode’s TabBar, we hold on to a window. |
last_frame_visible: int | int LastFrameVisible; | |
last_frame_selected: int | int LastFrameSelected; | This allows us to infer an ordered list of the last activated tabs with little maintenance |
offset: float | float Offset; | Position relative to beginning of tab bar |
width: float | float Width; | Width currently displayed |
content_width: float | float ContentWidth; | Width of label + padding, stored during BeginTabItem() call (misnamed as “Content” would normally imply width of label only) |
requested_width: float | float RequestedWidth; | Width optionally requested by caller, -1.0 is unused |
name_offset: ImS32 | ImS32 NameOffset; | When Window==None, offset to name within parent ImGuiTabBar::TabsNames |
begin_order: ImS16 | ImS16 BeginOrder; | BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable |
index_during_layout: ImS16 | ImS16 IndexDuringLayout; | Index only used during TabBarLayout(). Tabs gets reordered so ‘Tabs[n].IndexDuringLayout == n’ but may mismatch during additions. |
want_close: bool | bool WantClose; | Marked as closed by SetTabItemClosed() |
TabItem.__init__¶
def __init__(self) -> NoneImGuiTabItem();TabBar (class)¶
Storage for a tab bar (sizeof() 160 bytes)
| Attribute | C++ | |
|---|---|---|
window: Window | ImGuiWindow* Window; | |
tabs: ImVector_TabItem | ImVector<ImGuiTabItem> Tabs; | |
flags: TabBarFlags | ImGuiTabBarFlags Flags; | |
id_: ID | ImGuiID ID; | Zero for tab-bars used by docking |
selected_tab_id: ID | ImGuiID SelectedTabId; | Selected tab/window |
next_selected_tab_id: ID | ImGuiID NextSelectedTabId; | Next selected tab/window. Will also trigger a scrolling animation |
next_scroll_to_tab_id: ID | ImGuiID NextScrollToTabId; | |
visible_tab_id: ID | ImGuiID VisibleTabId; | Can occasionally be != SelectedTabId (e.g. when previewing contents for Ctrl+Tab preview) |
curr_frame_visible: int | int CurrFrameVisible; | |
prev_frame_visible: int | int PrevFrameVisible; | |
bar_rect: ImRect | ImRect BarRect; | |
bar_rect_prev_width: float | float BarRectPrevWidth; | Backup of previous width. When width change we enforce keep horizontal scroll on focused tab. |
curr_tabs_contents_height: float | float CurrTabsContentsHeight; | |
prev_tabs_contents_height: float | float PrevTabsContentsHeight; | Record the height of contents submitted below the tab bar |
width_all_tabs: float | float WidthAllTabs; | Actual width of all tabs (locked during layout) |
width_all_tabs_ideal: float | float WidthAllTabsIdeal; | Ideal width if all tabs were visible and not clipped |
scrolling_anim: float | float ScrollingAnim; | |
scrolling_target: float | float ScrollingTarget; | |
scrolling_target_dist_to_visibility: float | float ScrollingTargetDistToVisibility; | |
scrolling_speed: float | float ScrollingSpeed; | |
scrolling_rect_min_x: float | float ScrollingRectMinX; | |
scrolling_rect_max_x: float | float ScrollingRectMaxX; | |
separator_min_x: float | float SeparatorMinX; | |
separator_max_x: float | float SeparatorMaxX; | |
reorder_request_tab_id: ID | ImGuiID ReorderRequestTabId; | |
reorder_request_offset: ImS16 | ImS16 ReorderRequestOffset; | |
begin_count: ImS8 | ImS8 BeginCount; | |
want_layout: bool | bool WantLayout; | |
visible_tab_was_submitted: bool | bool VisibleTabWasSubmitted; | |
tabs_added_new: bool | bool TabsAddedNew; | Set to True when a new tab item or button has been added to the tab bar during last frame |
scroll_button_enabled: bool | bool ScrollButtonEnabled; | |
tabs_active_count: ImS16 | ImS16 TabsActiveCount; | Number of tabs submitted this frame. |
last_tab_item_idx: ImS16 | ImS16 LastTabItemIdx; | Index of last BeginTabItem() tab for use by EndTabItem() |
item_spacing_y: float | float ItemSpacingY; | |
frame_padding: ImVec2 | ImVec2 FramePadding; | style.FramePadding locked at the time of BeginTabBar() |
backup_cursor_pos: ImVec2 | ImVec2 BackupCursorPos; | |
tabs_names: TextBuffer | ImGuiTextBuffer TabsNames; | For non-docking tab bar we re-append names in a contiguous buffer. |
TabBar.__init__¶
def __init__(self) -> NoneImGuiTabBar();Table support + internal API¶
TableColumn (class)¶
[Internal] sizeof() ~ 120
We use the terminology “Enabled” to refer to a column that is not Hidden by user/api.
We use the terminology “Clipped” to refer to a column that is out of sight because of scrolling/clipping.
This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use “Visible” to mean “not clipped”.
| Attribute | C++ | |
|---|---|---|
flags: TableColumnFlags | ImGuiTableColumnFlags Flags; | Flags after some patching (not directly same as provided by user). See ImGuiTableColumnFlags_ |
width_given: float | float WidthGiven; | Final/actual width visible == (MaxX - MinX), locked in TableUpdateLayout(). May be > WidthRequest to honor minimum width, may be < WidthRequest to honor shrinking columns down in tight space. |
min_x: float | float MinX; | Absolute positions |
max_x: float | float MaxX; | |
width_request: float | float WidthRequest; | Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout() |
width_auto: float | float WidthAuto; | Automatic width |
width_max: float | float WidthMax; | Maximum width (FIXME: overwritten by each instance) |
stretch_weight: float | float StretchWeight; | Master width weight when (Flags & _WidthStretch). Often around ~1.0 initially. |
init_stretch_weight_or_width: float | float InitStretchWeightOrWidth; | Value passed to TableSetupColumn(). For Width it is a content width (without padding). |
clip_rect: ImRect | ImRect ClipRect; | Clipping rectangle for the column |
id_: ID | ImGuiID ID; | Hash of column name (ignoring top of ID stack), used for .ini persistence when available. |
user_data: ID | ImGuiID UserData; | (Optional) User data value passed to TableSetupColumn() |
work_min_x: float | float WorkMinX; | Contents region min ~(MinX + CellPaddingX + CellSpacingX1) == cursor start position when entering column |
work_max_x: float | float WorkMaxX; | Contents region max ~(MaxX - CellPaddingX - CellSpacingX2) |
item_width: float | float ItemWidth; | Current item width for the column, preserved across rows |
content_max_x_frozen: float | float ContentMaxXFrozen; | Contents maximum position for frozen rows (apart from headers), from which we can infer content width. |
content_max_x_unfrozen: float | float ContentMaxXUnfrozen; | |
content_max_x_headers_used: float | float ContentMaxXHeadersUsed; | Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls |
content_max_x_headers_ideal: float | float ContentMaxXHeadersIdeal; | |
name_offset: ImS16 | ImS16 NameOffset; | Offset into parent ColumnsNames[] |
display_order: TableColumnIdx | ImGuiTableColumnIdx DisplayOrder; | Index within Table’s IndexToDisplayOrder[] (column may be reordered by users) |
index_within_enabled_set: TableColumnIdx | ImGuiTableColumnIdx IndexWithinEnabledSet; | Index within enabled/visible set (<= IndexToDisplayOrder) |
prev_enabled_column: TableColumnIdx | ImGuiTableColumnIdx PrevEnabledColumn; | Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column |
next_enabled_column: TableColumnIdx | ImGuiTableColumnIdx NextEnabledColumn; | Index of next enabled/visible column within Columns[], -1 if last enabled/visible column |
sort_order: TableColumnIdx | ImGuiTableColumnIdx SortOrder; | Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort |
draw_channel_current: TableDrawChannelIdx | ImGuiTableDrawChannelIdx DrawChannelCurrent; | Index within DrawSplitter.Channels[] |
draw_channel_frozen: TableDrawChannelIdx | ImGuiTableDrawChannelIdx DrawChannelFrozen; | Draw channels for frozen rows (often headers) |
draw_channel_unfrozen: TableDrawChannelIdx | ImGuiTableDrawChannelIdx DrawChannelUnfrozen; | Draw channels for unfrozen rows |
is_enabled: bool | bool IsEnabled; | IsUserEnabled && (Flags & ImGuiTableColumnFlags_Disabled) == 0 |
is_user_enabled: bool | bool IsUserEnabled; | Is the column not marked Hidden by the user? (unrelated to being off view, e.g. clipped by scrolling). |
is_user_enabled_next_frame: bool | bool IsUserEnabledNextFrame; | |
is_visible_x: bool | bool IsVisibleX; | Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled). |
is_visible_y: bool | bool IsVisibleY; | |
is_request_output: bool | bool IsRequestOutput; | Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not. |
is_skip_items: bool | bool IsSkipItems; | Do we want item submissions to this column to be completely ignored (no layout will happen). |
nav_layer_current: ImS8 | ImS8 NavLayerCurrent; | ImGuiNavLayer in 1 byte |
sort_directions_avail_list: ImU8 | ImU8 SortDirectionsAvailList; | Ordered list of available sort directions (2-bits each, total 8-bits) |
TableColumn.__init__¶
def __init__(self) -> NoneImGuiTableColumn();TableReconcileColumnData (class)¶
Passed to TableSetupColumn() sizeof() ~ 24+120 bytes
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
name_offset: ImS16 | ImS16 NameOffset; | |
flags: TableColumnFlags | ImGuiTableColumnFlags Flags; | |
init_width_or_weight: float | float InitWidthOrWeight; | |
user_data: ID | ImGuiID UserData; | |
column_new_idx: TableColumnIdx | ImGuiTableColumnIdx ColumnNewIdx; | Index in the current table. |
column_old_idx: TableColumnIdx | ImGuiTableColumnIdx ColumnOldIdx; | Index in the previous frame table. |
column_old_data: TableColumn | ImGuiTableColumn ColumnOldData; | Full backup of the column. Could be avoided by storing 1 of them and applying reconcile in the right order. Not worth bothering. |
TableReconcileColumnData.__init__¶
def __init__(self, id_: ID = ID(), name_offset: ImS16 = ImS16(), flags: TableColumnFlags = TableColumnFlags(), init_width_or_weight: float = float(), user_data: ID = ID(), column_new_idx: Optional[TableColumnIdx] = None, column_old_idx: Optional[TableColumnIdx] = None, column_old_data: Optional[TableColumn] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* ColumnNewIdx: TableColumnIdx()
* ColumnOldIdx: TableColumnIdx()
* ColumnOldData: TableColumn()
TableCellData (class)¶
Transient cell data stored per row. sizeof() ~ 6 bytes
| Attribute | C++ | |
|---|---|---|
bg_color: ImU32 | ImU32 BgColor; | Actual color |
column: TableColumnIdx | ImGuiTableColumnIdx Column; | Column number |
TableCellData.__init__¶
def __init__(self, bg_color: ImU32 = ImU32(), column: Optional[TableColumnIdx] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If Column is None, then its default value will be: TableColumnIdx()
TableHeaderData (class)¶
Parameters for TableAngledHeadersRowEx()
This may end up being refactored for more general purpose.
sizeof() ~ 12 bytes
| Attribute | C++ | |
|---|---|---|
index: TableColumnIdx | ImGuiTableColumnIdx Index; | Column index |
text_color: ImU32 | ImU32 TextColor; | |
bg_color0: ImU32 | ImU32 BgColor0; | |
bg_color1: ImU32 | ImU32 BgColor1; |
TableHeaderData.__init__¶
def __init__(self, index: Optional[TableColumnIdx] = None, text_color: ImU32 = ImU32(), bg_color0: ImU32 = ImU32(), bg_color1: ImU32 = ImU32()) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If Index is None, then its default value will be: TableColumnIdx()
TableInstanceData (class)¶
Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?) sizeof() ~ 24 bytes
| Attribute | C++ | |
|---|---|---|
table_instance_id: ID | ImGuiID TableInstanceID; | |
last_outer_height: float | float LastOuterHeight; | Outer height from last frame |
last_top_headers_row_height: float | float LastTopHeadersRowHeight; | Height of first consecutive header rows from last frame (FIXME: this is used assuming consecutive headers are in same frozen set) |
last_frozen_height: float | float LastFrozenHeight; | Height of frozen section from last frame |
hovered_row_last: int | int HoveredRowLast; | Index of row which was hovered last frame. |
hovered_row_next: int | int HoveredRowNext; | Index of row hovered this frame, set after encountering it. |
TableInstanceData.__init__¶
def __init__(self) -> NoneImGuiTableInstanceData();Table (class)¶
sizeof() ~ 592 bytes + heap allocs described in TableBeginInitMemory()
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
flags: TableFlags | ImGuiTableFlags Flags; | |
raw_data: Any | void* RawData; | Single allocation to hold Columns[], DisplayOrderToIndex[], and RowCellData[] |
temp_data: TableTempData | ImGuiTableTempData* TempData; | Transient data while table is active. Point within g.CurrentTableStack[] |
settings_loaded_flags: TableFlags | ImGuiTableFlags SettingsLoadedFlags; | Which data were loaded from the .ini file (e.g. when order is not altered we won’t save order) |
settings_offset: int | int SettingsOffset; | Offset in g.SettingsTables |
last_frame_active: int | int LastFrameActive; | |
columns_count: int | int ColumnsCount; | Number of columns declared in BeginTable() |
current_row: int | int CurrentRow; | |
current_column: int | int CurrentColumn; | |
instance_current: ImS16 | ImS16 InstanceCurrent; | Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple tables with the same ID are multiple tables, they are just synced. |
instance_interacted: ImS16 | ImS16 InstanceInteracted; | Mark which instance (generally 0) of the same ID is being interacted with |
row_pos_y1: float | float RowPosY1; | |
row_pos_y2: float | float RowPosY2; | |
row_min_height: float | float RowMinHeight; | Height submitted to TableNextRow() |
row_cell_padding_y: float | float RowCellPaddingY; | Top and bottom padding. Reloaded during row change. |
row_text_baseline: float | float RowTextBaseline; | |
row_indent_offset_x: float | float RowIndentOffsetX; | |
row_bg_color_counter: int | int RowBgColorCounter; | Counter for alternating background colors (can be fast-forwarded by e.g clipper), not same as CurrentRow because header rows typically don’t increase this. |
row_bg_color: np.ndarray | ImU32 RowBgColor[2]; | ndarray[type=ImU32, size=2] # Background color override for current row. |
border_color_strong: ImU32 | ImU32 BorderColorStrong; | |
border_color_light: ImU32 | ImU32 BorderColorLight; | |
border_x1: float | float BorderX1; | |
border_x2: float | float BorderX2; | |
host_indent_x: float | float HostIndentX; | |
min_column_width: float | float MinColumnWidth; | |
outer_padding_x: float | float OuterPaddingX; | |
cell_padding_x: float | float CellPaddingX; | Padding from each borders. Locked in BeginTable()/Layout. |
cell_spacing_x1: float | float CellSpacingX1; | Spacing between non-bordered cells. Locked in BeginTable()/Layout. |
cell_spacing_x2: float | float CellSpacingX2; | |
inner_width: float | float InnerWidth; | User value passed to BeginTable(), see comments at the top of BeginTable() for details. |
columns_given_width: float | float ColumnsGivenWidth; | Sum of current column width |
columns_auto_fit_width: float | float ColumnsAutoFitWidth; | Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window |
columns_stretch_sum_weights: float | float ColumnsStretchSumWeights; | Sum of weight of all enabled stretching columns |
resized_column_next_width: float | float ResizedColumnNextWidth; | |
resize_lock_min_contents_x2: float | float ResizeLockMinContentsX2; | Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table. |
ref_scale: float | float RefScale; | Reference scale to be able to rescale columns on font/dpi changes. |
angled_headers_height: float | float AngledHeadersHeight; | Set by TableAngledHeadersRow(), used in TableUpdateLayout() |
angled_headers_slope: float | float AngledHeadersSlope; | Set by TableAngledHeadersRow(), used in TableUpdateLayout() |
outer_rect: ImRect | ImRect OuterRect; | Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable(). |
inner_rect: ImRect | ImRect InnerRect; | InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is " |
work_rect: ImRect | ImRect WorkRect; | |
inner_clip_rect: ImRect | ImRect InnerClipRect; | |
bg_clip_rect: ImRect | ImRect BgClipRect; | We use this to cpu-clip cell background color fill, evolve during the frame as we cross frozen rows boundaries |
bg0_clip_rect_for_draw_cmd: ImRect | ImRect Bg0ClipRectForDrawCmd; | Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped |
bg2_clip_rect_for_draw_cmd: ImRect | ImRect Bg2ClipRectForDrawCmd; | Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect. |
host_clip_rect: ImRect | ImRect HostClipRect; | This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window. |
host_backup_inner_clip_rect: ImRect | ImRect HostBackupInnerClipRect; | Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground() |
outer_window: Window | ImGuiWindow* OuterWindow; | Parent window for the table |
inner_window: Window | ImGuiWindow* InnerWindow; | Window holding the table data (== OuterWindow or a child window) |
columns_names: TextBuffer | ImGuiTextBuffer ColumnsNames; | Contiguous buffer holding columns names |
draw_splitter: ImDrawListSplitter | ImDrawListSplitter* DrawSplitter; | Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly |
instance_data_first: TableInstanceData | ImGuiTableInstanceData InstanceDataFirst; | |
instance_data_extra: ImVector_TableInstanceData | ImVector<ImGuiTableInstanceData> InstanceDataExtra; | FIXME-OPT: Using a small-vector pattern would be good. |
sort_specs_single: TableColumnSortSpecs | ImGuiTableColumnSortSpecs SortSpecsSingle; | |
sort_specs_multi: ImVector_TableColumnSortSpecs | ImVector<ImGuiTableColumnSortSpecs> SortSpecsMulti; | FIXME-OPT: Using a small-vector pattern would be good. |
sort_specs: TableSortSpecs | ImGuiTableSortSpecs SortSpecs; | Public facing sorts specs, this is what we return in TableGetSortSpecs() |
sort_specs_count: TableColumnIdx | ImGuiTableColumnIdx SortSpecsCount; | |
columns_enabled_count: TableColumnIdx | ImGuiTableColumnIdx ColumnsEnabledCount; | Number of enabled columns (<= ColumnsCount) |
columns_enabled_fixed_count: TableColumnIdx | ImGuiTableColumnIdx ColumnsEnabledFixedCount; | Number of enabled columns using fixed width (<= ColumnsCount) |
decl_columns_count: TableColumnIdx | ImGuiTableColumnIdx DeclColumnsCount; | Count calls to TableSetupColumn() |
angled_headers_count: TableColumnIdx | ImGuiTableColumnIdx AngledHeadersCount; | Count columns with angled headers |
hovered_column_body: TableColumnIdx | ImGuiTableColumnIdx HoveredColumnBody; | Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column! |
hovered_column_border: TableColumnIdx | ImGuiTableColumnIdx HoveredColumnBorder; | Index of column whose right-border is being hovered (for resizing). |
highlight_column_header: TableColumnIdx | ImGuiTableColumnIdx HighlightColumnHeader; | Index of column which should be highlighted. |
auto_fit_single_column: TableColumnIdx | ImGuiTableColumnIdx AutoFitSingleColumn; | Index of single column requesting auto-fit. |
resized_column: TableColumnIdx | ImGuiTableColumnIdx ResizedColumn; | Index of column being resized. Reset when InstanceCurrent==0. |
last_resized_column: TableColumnIdx | ImGuiTableColumnIdx LastResizedColumn; | Index of column being resized from previous frame. |
held_header_column: TableColumnIdx | ImGuiTableColumnIdx HeldHeaderColumn; | Index of column header being held. |
last_held_header_column: TableColumnIdx | ImGuiTableColumnIdx LastHeldHeaderColumn; | Index of column header being held from previous frame. |
reorder_column: TableColumnIdx | ImGuiTableColumnIdx ReorderColumn; | Index of column being reordered. (not cleared) |
reorder_column_dst_order: TableColumnIdx | ImGuiTableColumnIdx ReorderColumnDstOrder; | Requested display order of column being reordered. |
left_most_enabled_column: TableColumnIdx | ImGuiTableColumnIdx LeftMostEnabledColumn; | Index of left-most non-hidden column. |
right_most_enabled_column: TableColumnIdx | ImGuiTableColumnIdx RightMostEnabledColumn; | Index of right-most non-hidden column. |
left_most_stretched_column: TableColumnIdx | ImGuiTableColumnIdx LeftMostStretchedColumn; | Index of left-most stretched column. |
right_most_stretched_column: TableColumnIdx | ImGuiTableColumnIdx RightMostStretchedColumn; | Index of right-most stretched column. |
context_popup_column: TableColumnIdx | ImGuiTableColumnIdx ContextPopupColumn; | Column right-clicked on, of -1 if opening context menu from a neutral/empty spot |
freeze_rows_request: TableColumnIdx | ImGuiTableColumnIdx FreezeRowsRequest; | Requested frozen rows count |
freeze_rows_count: TableColumnIdx | ImGuiTableColumnIdx FreezeRowsCount; | Actual frozen row count (== FreezeRowsRequest, or == 0 when no scrolling offset) |
freeze_columns_request: TableColumnIdx | ImGuiTableColumnIdx FreezeColumnsRequest; | Requested frozen columns count |
freeze_columns_count: TableColumnIdx | ImGuiTableColumnIdx FreezeColumnsCount; | Actual frozen columns count (== FreezeColumnsRequest, or == 0 when no scrolling offset) |
row_cell_data_current: TableColumnIdx | ImGuiTableColumnIdx RowCellDataCurrent; | Index of current RowCellData[] entry in current row |
dummy_draw_channel: TableDrawChannelIdx | ImGuiTableDrawChannelIdx DummyDrawChannel; | Redirect non-visible columns here. |
bg2_draw_channel_current: TableDrawChannelIdx | ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent; | For Selectable() and other widgets drawing across columns after the freezing line. Index within DrawSplitter.Channels[] |
bg2_draw_channel_unfrozen: TableDrawChannelIdx | ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen; | |
nav_layer: ImS8 | ImS8 NavLayer; | ImGuiNavLayer at the time of BeginTable(). |
is_layout_locked: bool | bool IsLayoutLocked; | Set by TableUpdateLayout() which is called when beginning the first row. |
is_inside_row: bool | bool IsInsideRow; | Set when inside TableBeginRow()/TableEndRow(). |
is_initializing: bool | bool IsInitializing; | |
is_reconcile_mode: bool | bool IsReconcileMode; | |
is_sort_specs_dirty: bool | bool IsSortSpecsDirty; | |
is_using_headers: bool | bool IsUsingHeaders; | Set when the first row had the ImGuiTableRowFlags_Headers flag. |
is_context_popup_open: bool | bool IsContextPopupOpen; | Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted). |
disable_default_context_menu: bool | bool DisableDefaultContextMenu; | Disable default context menu. You may submit your own using TableBeginContextMenuPopup()/EndPopup() |
is_settings_request_load: bool | bool IsSettingsRequestLoad; | |
is_settings_dirty: bool | bool IsSettingsDirty; | Set when table settings have changed and needs to be reported into ImGuiTableSettings data. |
is_default_display_order: bool | bool IsDefaultDisplayOrder; | Set when display order is unchanged from default (DisplayOrder contains 0...Count-1) |
is_default_visibility: bool | bool IsDefaultVisibility; | Set when enabled/visibility is unchanged from default |
is_reset_all_request: bool | bool IsResetAllRequest; | Set to queue a call to TableResetSettings() in BeginTable() |
is_reset_display_order_request: bool | bool IsResetDisplayOrderRequest; | |
is_reset_visibility_request: bool | bool IsResetVisibilityRequest; | |
is_unfrozen_rows: bool | bool IsUnfrozenRows; | Set when we got past the frozen row. |
is_default_sizing_policy: bool | bool IsDefaultSizingPolicy; | Set if user didn’t explicitly set a sizing policy in BeginTable() |
is_active_id_alive_before_table: bool | bool IsActiveIdAliveBeforeTable; | |
is_active_id_in_table: bool | bool IsActiveIdInTable; | |
has_scrollbar_y_curr: bool | bool HasScrollbarYCurr; | Whether ANY instance of this table had a vertical scrollbar during the current frame. |
has_scrollbar_y_prev: bool | bool HasScrollbarYPrev; | Whether ANY instance of this table had a vertical scrollbar during the previous. |
memory_compacted: bool | bool MemoryCompacted; | |
host_skip_items: bool | bool HostSkipItems; | Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis |
Table.__init__¶
def __init__(self) -> NoneImGuiTable();TableTempData (class)¶
Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs. sizeof() ~ 176 bytes.
| Attribute | C++ | |
|---|---|---|
window_id: ID | ImGuiID WindowID; | Shortcut to g.Tables[TableIndex]->OuterWindow->ID. |
table_index: int | int TableIndex; | Index in g.Tables.Buf[] pool |
last_time_active: float | float LastTimeActive; | Last timestamp this structure was used |
angled_headers_extra_width: float | float AngledHeadersExtraWidth; | Used in EndTable() |
angled_headers_requests: ImVector_TableHeaderData | ImVector<ImGuiTableHeaderData> AngledHeadersRequests; | Used in TableAngledHeadersRow() // FIXME: Single instance is enough? |
old_columns_raw_data: Any | void* OldColumnsRawData; | Used in BeginTable() -> TableUpdateLayout() when resizing. |
user_outer_size: ImVec2 | ImVec2 UserOuterSize; | outer_size.x passed to BeginTable() |
draw_splitter: ImDrawListSplitter | ImDrawListSplitter DrawSplitter; | |
host_backup_work_rect: ImRect | ImRect HostBackupWorkRect; | Backup of InnerWindow->WorkRect at the end of BeginTable() |
host_backup_parent_work_rect: ImRect | ImRect HostBackupParentWorkRect; | Backup of InnerWindow->ParentWorkRect at the end of BeginTable() |
host_backup_prev_line_size: ImVec2 | ImVec2 HostBackupPrevLineSize; | Backup of InnerWindow->DC.PrevLineSize at the end of BeginTable() |
host_backup_curr_line_size: ImVec2 | ImVec2 HostBackupCurrLineSize; | Backup of InnerWindow->DC.CurrLineSize at the end of BeginTable() |
host_backup_cursor_max_pos: ImVec2 | ImVec2 HostBackupCursorMaxPos; | Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable() |
host_backup_columns_offset: ImVec1 | ImVec1 HostBackupColumnsOffset; | Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable() |
host_backup_item_width: float | float HostBackupItemWidth; | Backup of OuterWindow->DC.ItemWidth at the end of BeginTable() |
host_backup_item_width_stack_size: int | int HostBackupItemWidthStackSize; | Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable() |
TableTempData.__init__¶
def __init__(self) -> NoneImGuiTableTempData();TableColumnSettings (class)¶
sizeof() ~ 16
| Attribute | C++ | |
|---|---|---|
width_or_weight: float | float WidthOrWeight; | |
id_: ID | ImGuiID ID; | |
index: TableColumnIdx | ImGuiTableColumnIdx Index; | |
display_order: TableColumnIdx | ImGuiTableColumnIdx DisplayOrder; | |
sort_order: TableColumnIdx | ImGuiTableColumnIdx SortOrder; |
TableColumnSettings.__init__¶
def __init__(self) -> NoneImGuiTableColumnSettings();TableSettings (class)¶
This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | Set to 0 to invalidate/delete the setting |
save_flags: TableFlags | ImGuiTableFlags SaveFlags; | Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..) |
ref_scale: float | float RefScale; | Reference scale to be able to rescale columns on font/dpi changes. |
columns_count: TableColumnIdx | ImGuiTableColumnIdx ColumnsCount; | |
columns_count_max: TableColumnIdx | ImGuiTableColumnIdx ColumnsCountMax; | Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher |
last_used_date: PackedDate | ImGuiPackedDate LastUsedDate; |
TableSettings.__init__¶
def __init__(self) -> NoneImGuiTableSettings();TableSettings.get_column_settings¶
def get_column_settings(self) -> TableColumnSettingsImGuiTableColumnSettings* GetColumnSettings();(private API)
Tables: Candidates for public API¶
table_open_context_menu¶
def table_open_context_menu(column_n: int = -1) -> NoneIMGUI_API void TableOpenContextMenu(int column_n = -1);table_set_column_width¶
def table_set_column_width(column_n: int, width: float) -> NoneIMGUI_API void TableSetColumnWidth(int column_n, float width);table_set_column_sort_direction¶
def table_set_column_sort_direction(column_n: int, sort_direction: SortDirection, append_to_sort_specs: bool) -> NoneIMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs);table_get_hovered_row¶
def table_get_hovered_row() -> intIMGUI_API int TableGetHoveredRow();Retrieve PREVIOUS FRAME hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.
table_get_header_row_height¶
def table_get_header_row_height() -> floatIMGUI_API float TableGetHeaderRowHeight();table_get_header_angled_max_label_width¶
def table_get_header_angled_max_label_width() -> floatIMGUI_API float TableGetHeaderAngledMaxLabelWidth();table_push_background_channel¶
def table_push_background_channel() -> NoneIMGUI_API void TablePushBackgroundChannel();table_pop_background_channel¶
def table_pop_background_channel() -> NoneIMGUI_API void TablePopBackgroundChannel();table_push_column_channel¶
def table_push_column_channel(column_n: int) -> NoneIMGUI_API void TablePushColumnChannel(int column_n);table_pop_column_channel¶
def table_pop_column_channel() -> NoneIMGUI_API void TablePopColumnChannel();table_angled_headers_row_ex¶
def table_angled_headers_row_ex(row_id: ID, angle: float, max_label_width: float, data: TableHeaderData, data_count: int) -> NoneIMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count);get_current_table¶
def get_current_table() -> Tableinline ImGuiTable* GetCurrentTable();Tables: Internals (private API)
table_find_by_id¶
def table_find_by_id(id_: ID) -> TableIMGUI_API ImGuiTable* TableFindByID(ImGuiID id);begin_table_ex¶
def begin_table_ex(name: str, id_: ID, columns_count: int, flags: TableFlags = 0, outer_size: Optional[ImVec2Like] = None, inner_width: float = 0.0) -> boolIMGUI_API bool BeginTableEx(const char* name, ImGuiID id, int columns_count, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0, 0), float inner_width = 0.0f);Python bindings defaults:
If outer_size is None, then its default value will be: ImVec2(0, 0)
table_begin_init_memory¶
def table_begin_init_memory(table: Table, columns_count: int) -> NoneIMGUI_API void TableBeginInitMemory(ImGuiTable* table, int columns_count);table_apply_queued_requests¶
def table_apply_queued_requests(table: Table) -> NoneIMGUI_API void TableApplyQueuedRequests(ImGuiTable* table);table_setup_draw_channels¶
def table_setup_draw_channels(table: Table) -> NoneIMGUI_API void TableSetupDrawChannels(ImGuiTable* table);table_reconcile_columns¶
def table_reconcile_columns(table: Table) -> NoneIMGUI_API void TableReconcileColumns(ImGuiTable* table);table_update_layout¶
def table_update_layout(table: Table) -> NoneIMGUI_API void TableUpdateLayout(ImGuiTable* table);table_update_borders¶
def table_update_borders(table: Table) -> NoneIMGUI_API void TableUpdateBorders(ImGuiTable* table);table_update_columns_weight_from_width¶
def table_update_columns_weight_from_width(table: Table) -> NoneIMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);table_apply_external_unclip_rect¶
def table_apply_external_unclip_rect(table: Table, rect: ImRect) -> NoneIMGUI_API void TableApplyExternalUnclipRect(ImGuiTable* table, ImRect& rect);table_draw_borders¶
def table_draw_borders(table: Table) -> NoneIMGUI_API void TableDrawBorders(ImGuiTable* table);table_draw_default_context_menu¶
def table_draw_default_context_menu(table: Table, flags_for_section_to_display: TableFlags) -> NoneIMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);table_begin_context_menu_popup¶
def table_begin_context_menu_popup(table: Table) -> boolIMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);table_merge_draw_channels¶
def table_merge_draw_channels(table: Table) -> NoneIMGUI_API void TableMergeDrawChannels(ImGuiTable* table);table_get_instance_data¶
def table_get_instance_data(table: Table, instance_no: int) -> TableInstanceDatainline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no);(private API)
table_get_instance_id¶
def table_get_instance_id(table: Table, instance_no: int) -> IDinline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no);(private API)
table_fix_display_order¶
def table_fix_display_order(table: Table) -> NoneIMGUI_API void TableFixDisplayOrder(ImGuiTable* table);table_sort_specs_sanitize¶
def table_sort_specs_sanitize(table: Table) -> NoneIMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);table_sort_specs_build¶
def table_sort_specs_build(table: Table) -> NoneIMGUI_API void TableSortSpecsBuild(ImGuiTable* table);table_init_column_defaults¶
def table_init_column_defaults(table: Table, column: TableColumn, init_mask: TableColumnFlags) -> NoneIMGUI_API void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask);table_get_column_next_sort_direction¶
def table_get_column_next_sort_direction(column: TableColumn) -> SortDirectionIMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);table_fix_column_sort_direction¶
def table_fix_column_sort_direction(table: Table, column: TableColumn) -> NoneIMGUI_API void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);table_get_column_width_auto¶
def table_get_column_width_auto(table: Table, column: TableColumn) -> floatIMGUI_API float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);table_begin_row¶
def table_begin_row(table: Table) -> NoneIMGUI_API void TableBeginRow(ImGuiTable* table);table_end_row¶
def table_end_row(table: Table) -> NoneIMGUI_API void TableEndRow(ImGuiTable* table);table_begin_cell¶
def table_begin_cell(table: Table, column_n: int) -> NoneIMGUI_API void TableBeginCell(ImGuiTable* table, int column_n);table_end_cell¶
def table_end_cell(table: Table) -> NoneIMGUI_API void TableEndCell(ImGuiTable* table);table_get_cell_bg_rect¶
def table_get_cell_bg_rect(table: Table, column_n: int) -> ImRectIMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);table_get_column_name¶
def table_get_column_name(table: Table, column_n: int) -> strIMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);table_get_column_resize_id¶
def table_get_column_resize_id(table: Table, column_n: int, instance_no: int = 0) -> IDIMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);table_calc_max_column_width¶
def table_calc_max_column_width(table: Table, column_n: int) -> floatIMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n);table_set_column_width_auto_single¶
def table_set_column_width_auto_single(table: Table, column_n: int) -> NoneIMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);table_set_column_width_auto_all¶
def table_set_column_width_auto_all(table: Table) -> NoneIMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);table_set_column_display_order¶
def table_set_column_display_order(table: Table, column_n: int, dst_order: int) -> NoneIMGUI_API void TableSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);table_queue_set_column_display_order¶
def table_queue_set_column_display_order(table: Table, column_n: int, dst_order: int) -> NoneIMGUI_API void TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);table_remove¶
def table_remove(table: Table) -> NoneIMGUI_API void TableRemove(ImGuiTable* table);table_gc_compact_transient_buffers¶
@overload
def table_gc_compact_transient_buffers(table: Table) -> None
@overload
def table_gc_compact_transient_buffers(table: TableTempData) -> NoneIMGUI_API void TableGcCompactTransientBuffers(ImGuiTable* table);
IMGUI_API void TableGcCompactTransientBuffers(ImGuiTableTempData* table);table_gc_compact_settings¶
def table_gc_compact_settings() -> NoneIMGUI_API void TableGcCompactSettings();Tables: Settings¶
table_load_settings¶
def table_load_settings(table: Table) -> NoneIMGUI_API void TableLoadSettings(ImGuiTable* table);table_load_settings_for_columns¶
def table_load_settings_for_columns(table: Table) -> NoneIMGUI_API void TableLoadSettingsForColumns(ImGuiTable* table);table_load_settings_for_column¶
def table_load_settings_for_column(column: TableColumn, column_settings: TableColumnSettings, load_flags: TableFlags) -> NoneIMGUI_API void TableLoadSettingsForColumn(ImGuiTableColumn* column, ImGuiTableColumnSettings* column_settings, ImGuiTableFlags load_flags);table_save_settings¶
def table_save_settings(table: Table) -> NoneIMGUI_API void TableSaveSettings(ImGuiTable* table);table_reset_settings¶
def table_reset_settings(table: Table) -> NoneIMGUI_API void TableResetSettings(ImGuiTable* table);table_get_bound_settings¶
def table_get_bound_settings(table: Table) -> TableSettingsIMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);table_settings_add_settings_handler¶
def table_settings_add_settings_handler() -> NoneIMGUI_API void TableSettingsAddSettingsHandler();table_settings_create¶
def table_settings_create(id_: ID, columns_count: int) -> TableSettingsIMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID id, int columns_count);table_settings_find_by_id¶
def table_settings_find_by_id(id_: ID) -> TableSettingsIMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);set_window_clip_rect_before_set_channel¶
def set_window_clip_rect_before_set_channel(window: Window, clip_rect: ImRect) -> NoneIMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);Legacy Columns API (this is not exposed because we will encourage transitioning to the Tables API)
begin_columns¶
def begin_columns(str_id: str, count: int, flags: OldColumnFlags = 0) -> NoneIMGUI_API void BeginColumns(const char* str_id, int count, ImGuiOldColumnFlags flags = 0);setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
end_columns¶
def end_columns() -> NoneIMGUI_API void EndColumns();close columns
push_column_clip_rect¶
def push_column_clip_rect(column_index: int) -> NoneIMGUI_API void PushColumnClipRect(int column_index);push_columns_background¶
def push_columns_background() -> NoneIMGUI_API void PushColumnsBackground();pop_columns_background¶
def pop_columns_background() -> NoneIMGUI_API void PopColumnsBackground();get_columns_id¶
def get_columns_id(str_id: str, count: int) -> IDIMGUI_API ImGuiID GetColumnsID(const char* str_id, int count);find_or_create_columns¶
def find_or_create_columns(window: Window, id_: ID) -> OldColumnsIMGUI_API ImGuiOldColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID id);get_column_offset_from_norm¶
def get_column_offset_from_norm(columns: OldColumns, offset_norm: float) -> floatIMGUI_API float GetColumnOffsetFromNorm(const ImGuiOldColumns* columns, float offset_norm);get_column_norm_from_offset¶
def get_column_norm_from_offset(columns: OldColumns, offset: float) -> floatIMGUI_API float GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offset);ImGui internal API¶
No guarantee of forward compatibility here!¶
Windows
We should always have a CurrentWindow in the stack (there is an implicit “Debug” window)
If this ever crashes because g.CurrentWindow is None, it means that either:
ImGui::NewFrame() has never been called, which is illegal.
You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
get_io¶
def get_io(ctx: Context) -> IOIMGUI_API ImGuiIO& GetIO(ImGuiContext* ctx);get_platform_io¶
def get_platform_io(ctx: Context) -> PlatformIOIMGUI_API ImGuiPlatformIO& GetPlatformIO(ImGuiContext* ctx);get_scale¶
def get_scale() -> floatinline float GetScale();(private API)
FIXME-DPI: I don’t want to formalize this just yet. Because reasons. Please don’t use.
get_current_window_read¶
def get_current_window_read() -> Windowinline ImGuiWindow* GetCurrentWindowRead();(private API)
find_window_by_id¶
def find_window_by_id(id_: ID) -> WindowIMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id);find_window_by_name¶
def find_window_by_name(name: str) -> WindowIMGUI_API ImGuiWindow* FindWindowByName(const char* name);update_window_parent_and_root_links¶
def update_window_parent_and_root_links(window: Window, flags: WindowFlags, parent_window: Window) -> NoneIMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);update_window_skip_refresh¶
def update_window_skip_refresh(window: Window) -> NoneIMGUI_API void UpdateWindowSkipRefresh(ImGuiWindow* window);calc_window_next_auto_fit_size¶
def calc_window_next_auto_fit_size(window: Window) -> ImVec2IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window);is_window_child_of¶
def is_window_child_of(window: Window, potential_parent: Window, popup_hierarchy: bool, dock_hierarchy: bool) -> boolIMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool popup_hierarchy, bool dock_hierarchy);is_window_in_begin_stack¶
def is_window_in_begin_stack(window: Window) -> boolIMGUI_API bool IsWindowInBeginStack(ImGuiWindow* window);is_window_within_begin_stack_of¶
def is_window_within_begin_stack_of(window: Window, potential_parent: Window) -> boolIMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent);is_window_above¶
def is_window_above(potential_above: Window, potential_below: Window) -> boolIMGUI_API bool IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below);is_window_nav_focusable¶
def is_window_nav_focusable(window: Window) -> boolIMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window);set_window_pos¶
def set_window_pos(window: Window, pos: ImVec2Like, cond: Cond = 0) -> NoneIMGUI_API void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond = 0);set_window_size¶
def set_window_size(window: Window, size: ImVec2Like, cond: Cond = 0) -> NoneIMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0);set_window_collapsed¶
def set_window_collapsed(window: Window, collapsed: bool, cond: Cond = 0) -> NoneIMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0);set_window_hit_test_hole¶
def set_window_hit_test_hole(window: Window, pos: ImVec2Like, size: ImVec2Like) -> NoneIMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size);set_window_hidden_and_skip_items_for_current_frame¶
def set_window_hidden_and_skip_items_for_current_frame(window: Window) -> NoneIMGUI_API void SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window);set_window_parent_window_for_focus_route¶
def set_window_parent_window_for_focus_route(window: Window, parent_window: Window) -> Noneinline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window);(private API)
You may also use SetNextWindowClass()'s FocusRouteParentWindowId field.
window_rect_abs_to_rel¶
def window_rect_abs_to_rel(window: Window, r: ImRect) -> ImRectinline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r);(private API)
window_rect_rel_to_abs¶
def window_rect_rel_to_abs(window: Window, r: ImRect) -> ImRectinline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r);(private API)
window_pos_abs_to_rel¶
def window_pos_abs_to_rel(window: Window, p: ImVec2Like) -> ImVec2inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window, const ImVec2& p);(private API)
window_pos_rel_to_abs¶
def window_pos_rel_to_abs(window: Window, p: ImVec2Like) -> ImVec2inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p);(private API)
set_next_window_flags¶
def set_next_window_flags(flags: WindowFlags, enabled: bool) -> NoneIMGUI_API void SetNextWindowFlags(ImGuiWindowFlags flags, bool enabled);set_next_window_child_flags¶
def set_next_window_child_flags(flags: ChildFlags, enabled: bool) -> NoneIMGUI_API void SetNextWindowChildFlags(ImGuiChildFlags flags, bool enabled);Windows: Display Order and Focus Order¶
focus_window¶
def focus_window(window: Window, flags: FocusRequestFlags = 0) -> NoneIMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);focus_top_most_window_under_one¶
def focus_top_most_window_under_one(under_this_window: Window, ignore_window: Window, filter_viewport: Viewport, flags: FocusRequestFlags) -> NoneIMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags);bring_window_to_focus_front¶
def bring_window_to_focus_front(window: Window) -> NoneIMGUI_API void BringWindowToFocusFront(ImGuiWindow* window);bring_window_to_display_front¶
def bring_window_to_display_front(window: Window) -> NoneIMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window);bring_window_to_display_back¶
def bring_window_to_display_back(window: Window) -> NoneIMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window);bring_window_to_display_behind¶
def bring_window_to_display_behind(window: Window, above_window: Window) -> NoneIMGUI_API void BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* above_window);find_window_display_index¶
def find_window_display_index(window: Window) -> intIMGUI_API int FindWindowDisplayIndex(ImGuiWindow* window);find_bottom_most_visible_window_within_begin_stack¶
def find_bottom_most_visible_window_within_begin_stack(window: Window) -> WindowIMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window);set_next_window_refresh_policy¶
def set_next_window_refresh_policy(flags: WindowRefreshFlags) -> NoneIMGUI_API void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);Windows: Idle, Refresh Policies [EXPERIMENTAL]
Fonts, drawing¶
register_user_texture¶
def register_user_texture(tex: ImTextureData) -> NoneIMGUI_API void RegisterUserTexture(ImTextureData* tex);Register external texture. EXPERIMENTAL.
unregister_user_texture¶
def unregister_user_texture(tex: ImTextureData) -> NoneIMGUI_API void UnregisterUserTexture(ImTextureData* tex);register_font_atlas¶
def register_font_atlas(atlas: ImFontAtlas) -> NoneIMGUI_API void RegisterFontAtlas(ImFontAtlas* atlas);unregister_font_atlas¶
def unregister_font_atlas(atlas: ImFontAtlas) -> NoneIMGUI_API void UnregisterFontAtlas(ImFontAtlas* atlas);set_current_font¶
def set_current_font(font: ImFont, font_size_before_scaling: float, font_size_after_scaling: float) -> NoneIMGUI_API void SetCurrentFont(ImFont* font, float font_size_before_scaling, float font_size_after_scaling);update_current_font_size¶
def update_current_font_size(restore_font_size_after_scaling: float) -> NoneIMGUI_API void UpdateCurrentFontSize(float restore_font_size_after_scaling);set_pixel_density¶
def set_pixel_density(pixel_density: float) -> NoneIMGUI_API void SetPixelDensity(float pixel_density);was SetFontRasterizerDensity()
get_pixel_density¶
def get_pixel_density() -> floatinline float GetPixelDensity();(private API)
get_rounded_font_size¶
def get_rounded_font_size(size: float) -> floatinline float GetRoundedFontSize(float size);(private API)
get_default_font¶
def get_default_font() -> ImFontIMGUI_API ImFont* GetDefaultFont();push_password_font¶
def push_password_font() -> NoneIMGUI_API void PushPasswordFont();pop_password_font¶
def pop_password_font() -> NoneIMGUI_API void PopPasswordFont();get_foreground_draw_list¶
def get_foreground_draw_list(window: Window) -> ImDrawListinline ImDrawList* GetForegroundDrawList(ImGuiWindow* window);(private API)
add_draw_list_to_draw_data_ex¶
def add_draw_list_to_draw_data_ex(draw_data: ImDrawData, out_list: ImVector_ImDrawList_ptr, draw_list: ImDrawList) -> NoneIMGUI_API void AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list);Init¶
initialize¶
def initialize() -> NoneIMGUI_API void Initialize();shutdown¶
def shutdown() -> NoneIMGUI_API void Shutdown();Since 1.60 this is a private function. You can call DestroyContext() to destroy the context created by CreateContext().
Context name & generic context hooks¶
set_context_name¶
def set_context_name(ctx: Context, name: str) -> NoneIMGUI_API void SetContextName(ImGuiContext* ctx, const char* name);add_context_hook¶
def add_context_hook(ctx: Context, hook: ContextHook) -> IDIMGUI_API ImGuiID AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook);remove_context_hook¶
def remove_context_hook(ctx: Context, hook_to_remove: ID) -> NoneIMGUI_API void RemoveContextHook(ImGuiContext* ctx, ImGuiID hook_to_remove);call_context_hooks¶
def call_context_hooks(ctx: Context, type: ContextHookType) -> NoneIMGUI_API void CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType type);NewFrame¶
update_input_events¶
def update_input_events(trickle_fast_inputs: bool) -> NoneIMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);update_hovered_window_and_capture_flags¶
def update_hovered_window_and_capture_flags(mouse_pos: ImVec2Like) -> NoneIMGUI_API void UpdateHoveredWindowAndCaptureFlags(const ImVec2& mouse_pos);start_mouse_moving_window¶
def start_mouse_moving_window(window: Window) -> NoneIMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);start_mouse_moving_window_or_node¶
def start_mouse_moving_window_or_node(window: Window, node: DockNode, undock: bool) -> NoneIMGUI_API void StartMouseMovingWindowOrNode(ImGuiWindow* window, ImGuiDockNode* node, bool undock);stop_mouse_moving_window¶
def stop_mouse_moving_window() -> NoneIMGUI_API void StopMouseMovingWindow();update_mouse_moving_window_new_frame¶
def update_mouse_moving_window_new_frame() -> NoneIMGUI_API void UpdateMouseMovingWindowNewFrame();update_mouse_moving_window_end_frame¶
def update_mouse_moving_window_end_frame() -> NoneIMGUI_API void UpdateMouseMovingWindowEndFrame();Viewports¶
translate_windows_in_viewport¶
def translate_windows_in_viewport(viewport: ViewportP, old_pos: ImVec2Like, new_pos: ImVec2Like, old_size: ImVec2Like, new_size: ImVec2Like) -> NoneIMGUI_API void TranslateWindowsInViewport(ImGuiViewportP* viewport, const ImVec2& old_pos, const ImVec2& new_pos, const ImVec2& old_size, const ImVec2& new_size);scale_windows_in_viewport¶
def scale_windows_in_viewport(viewport: ViewportP, scale: float) -> NoneIMGUI_API void ScaleWindowsInViewport(ImGuiViewportP* viewport, float scale);destroy_platform_window¶
def destroy_platform_window(viewport: ViewportP) -> NoneIMGUI_API void DestroyPlatformWindow(ImGuiViewportP* viewport);set_window_viewport¶
def set_window_viewport(window: Window, viewport: ViewportP) -> NoneIMGUI_API void SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport);set_current_viewport¶
def set_current_viewport(window: Window, viewport: ViewportP) -> NoneIMGUI_API void SetCurrentViewport(ImGuiWindow* window, ImGuiViewportP* viewport);get_viewport_platform_monitor¶
def get_viewport_platform_monitor(viewport: Viewport) -> PlatformMonitorIMGUI_API const ImGuiPlatformMonitor* GetViewportPlatformMonitor(ImGuiViewport* viewport);find_hovered_viewport_from_platform_window_stack¶
def find_hovered_viewport_from_platform_window_stack(mouse_platform_pos: ImVec2Like) -> ViewportPIMGUI_API ImGuiViewportP* FindHoveredViewportFromPlatformWindowStack(const ImVec2& mouse_platform_pos);Settings¶
mark_ini_settings_dirty¶
@overload
def mark_ini_settings_dirty() -> None
@overload
def mark_ini_settings_dirty(window: Window) -> NoneIMGUI_API void MarkIniSettingsDirty();
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);clear_ini_settings¶
def clear_ini_settings() -> NoneIMGUI_API void ClearIniSettings();cleanup_ini_settings¶
def cleanup_ini_settings(args: SettingsCleanupArgs) -> NoneIMGUI_API void CleanupIniSettings(ImGuiSettingsCleanupArgs* args);[BETA] Expected to turn into a public API. Please report if you are using this!
add_settings_handler¶
def add_settings_handler(handler: SettingsHandler) -> NoneIMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler);remove_settings_handler¶
def remove_settings_handler(type_name: str) -> NoneIMGUI_API void RemoveSettingsHandler(const char* type_name);find_settings_handler¶
def find_settings_handler(type_name: str) -> SettingsHandlerIMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);Settings - Windows¶
create_new_window_settings¶
def create_new_window_settings(name: str) -> WindowSettingsIMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);find_window_settings_by_id¶
def find_window_settings_by_id(id_: ID) -> WindowSettingsIMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID id);find_window_settings_by_window¶
def find_window_settings_by_window(window: Window) -> WindowSettingsIMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window);clear_window_settings¶
def clear_window_settings(name: str) -> NoneIMGUI_API void ClearWindowSettings(const char* name);localize_register_entries¶
def localize_register_entries(entries: LocEntry, count: int) -> NoneIMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count);Localization
localize_get_msg¶
def localize_get_msg(key: LocKey) -> strinline const char* LocalizeGetMsg(ImGuiLocKey key);(private API)
Scrolling¶
set_scroll_x¶
def set_scroll_x(window: Window, scroll_x: float) -> NoneIMGUI_API void SetScrollX(ImGuiWindow* window, float scroll_x);set_scroll_y¶
def set_scroll_y(window: Window, scroll_y: float) -> NoneIMGUI_API void SetScrollY(ImGuiWindow* window, float scroll_y);set_scroll_from_pos_x¶
def set_scroll_from_pos_x(window: Window, local_x: float, center_x_ratio: float) -> NoneIMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio);set_scroll_from_pos_y¶
def set_scroll_from_pos_y(window: Window, local_y: float, center_y_ratio: float) -> NoneIMGUI_API void SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio);scroll_to_item¶
def scroll_to_item(flags: ScrollFlags = 0) -> NoneIMGUI_API void ScrollToItem(ImGuiScrollFlags flags = 0);Early work-in-progress API (ScrollToItem() will become public)
scroll_to_rect¶
def scroll_to_rect(window: Window, rect: ImRect, flags: ScrollFlags = 0) -> NoneIMGUI_API void ScrollToRect(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);scroll_to_rect_ex¶
def scroll_to_rect_ex(window: Window, rect: ImRect, flags: ScrollFlags = 0) -> ImVec2IMGUI_API ImVec2 ScrollToRectEx(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);scroll_to_bring_rect_into_view¶
def scroll_to_bring_rect_into_view(window: Window, rect: ImRect) -> Noneinline void ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& rect);#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS (private API)
Basic Accessors¶
get_item_status_flags¶
def get_item_status_flags() -> ItemStatusFlagsinline ImGuiItemStatusFlags GetItemStatusFlags();(private API)
get_active_id¶
def get_active_id() -> IDinline ImGuiID GetActiveID();(private API)
get_focus_id¶
def get_focus_id() -> IDinline ImGuiID GetFocusID();(private API)
set_active_id¶
def set_active_id(id_: ID, window: Window) -> NoneIMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);set_focus_id¶
def set_focus_id(id_: ID, window: Window) -> NoneIMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window);clear_active_id¶
def clear_active_id() -> NoneIMGUI_API void ClearActiveID();get_hovered_id¶
def get_hovered_id() -> IDIMGUI_API ImGuiID GetHoveredID();set_hovered_id¶
def set_hovered_id(id_: ID) -> NoneIMGUI_API void SetHoveredID(ImGuiID id);keep_alive_id¶
def keep_alive_id(id_: ID) -> NoneIMGUI_API void KeepAliveID(ImGuiID id);mark_item_edited¶
def mark_item_edited(id_: ID) -> NoneIMGUI_API void MarkItemEdited(ImGuiID id);Mark data associated to given item as “edited”, used by IsItemDeactivatedAfterEdit() function.
push_override_id¶
def push_override_id(id_: ID) -> NoneIMGUI_API void PushOverrideID(ImGuiID id);Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
get_id_with_seed¶
@overload
def get_id_with_seed(str_id_begin: str, str_id_end: str, seed: ID) -> ID
@overload
def get_id_with_seed(n: int, seed: ID) -> IDIMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed);item_size¶
@overload
def item_size(size: ImVec2Like, text_baseline_y: float = -1.0) -> None
@overload
def item_size(bb: ImRect, text_baseline_y: float = -1.0) -> NoneIMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
inline void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f);Basic Helpers for widget code
item_add¶
def item_add(bb: ImRect, id_: ID, nav_bb: Optional[ImRect] = None, extra_flags: ItemFlags = 0) -> boolIMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);item_hoverable¶
def item_hoverable(bb: ImRect, id_: ID, item_flags: ItemFlags) -> boolIMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags);is_window_content_hoverable¶
def is_window_content_hoverable(window: Window, flags: HoveredFlags = 0) -> boolIMGUI_API bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0);is_clipped_ex¶
def is_clipped_ex(bb: ImRect, id_: ID) -> boolIMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id);set_last_item_data¶
def set_last_item_data(item_id: ID, item_flags: ItemFlags, status_flags: ItemStatusFlags, item_rect: ImRect) -> NoneIMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags item_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect);calc_item_size¶
def calc_item_size(size: ImVec2Like, default_w: float, default_h: float) -> ImVec2IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h);calc_wrap_width_for_pos¶
def calc_wrap_width_for_pos(pos: ImVec2Like, wrap_pos_x: float) -> floatIMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);push_multi_items_widths¶
def push_multi_items_widths(components: int, width_full: float) -> NoneIMGUI_API void PushMultiItemsWidths(int components, float width_full);shrink_widths¶
def shrink_widths(items: ShrinkWidthItem, count: int, width_excess: float, width_min: float) -> NoneIMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess, float width_min);calc_clip_rect_visible_items_y¶
def calc_clip_rect_visible_items_y(clip_rect: ImRect, pos: ImVec2Like, items_height: float, out_visible_start: int, out_visible_end: int) -> Tuple[int, int]IMGUI_API void CalcClipRectVisibleItemsY(const ImRect& clip_rect, const ImVec2& pos, float items_height, int* out_visible_start, int* out_visible_end);Parameter stacks (shared)¶
get_style_var_info¶
def get_style_var_info(idx: StyleVar) -> StyleVarInfoIMGUI_API const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx);begin_disabled_override_reenable¶
def begin_disabled_override_reenable() -> NoneIMGUI_API void BeginDisabledOverrideReenable();end_disabled_override_reenable¶
def end_disabled_override_reenable() -> NoneIMGUI_API void EndDisabledOverrideReenable();Logging/Capture¶
log_begin¶
def log_begin(flags: LogFlags, auto_open_depth: int) -> NoneIMGUI_API void LogBegin(ImGuiLogFlags flags, int auto_open_depth);-> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
log_to_buffer¶
def log_to_buffer(auto_open_depth: int = -1) -> NoneIMGUI_API void LogToBuffer(int auto_open_depth = -1);Start logging/capturing to internal buffer
log_rendered_text¶
def log_rendered_text(ref_pos: ImVec2Like, text: str, text_end: Optional[str] = None) -> NoneIMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL);log_set_next_text_decoration¶
def log_set_next_text_decoration(prefix: str, suffix: str) -> NoneIMGUI_API void LogSetNextTextDecoration(const char* prefix, const char* suffix);Childs¶
begin_child_ex¶
def begin_child_ex(name: str, id_: ID, size_arg: ImVec2Like, child_flags: ChildFlags, window_flags: WindowFlags) -> boolIMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);find_front_most_visible_child_window¶
def find_front_most_visible_child_window(window: Window) -> WindowIMGUI_API ImGuiWindow* FindFrontMostVisibleChildWindow(ImGuiWindow* window);Popups, Modals¶
begin_popup_ex¶
def begin_popup_ex(id_: ID, extra_window_flags: WindowFlags) -> boolIMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags);begin_popup_menu_ex¶
def begin_popup_menu_ex(id_: ID, label: str, extra_window_flags: WindowFlags) -> boolIMGUI_API bool BeginPopupMenuEx(ImGuiID id, const char* label, ImGuiWindowFlags extra_window_flags);open_popup_ex¶
def open_popup_ex(id_: ID, popup_flags: PopupFlags = PopupFlags_None) -> boolIMGUI_API bool OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);close_popup_to_level¶
def close_popup_to_level(remaining: int, restore_focus_to_window_under_popup: bool) -> NoneIMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup);close_popups_over_window¶
def close_popups_over_window(ref_window: Window, restore_focus_to_window_under_popup: bool) -> NoneIMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup);close_popups_except_modals¶
def close_popups_except_modals() -> NoneIMGUI_API void ClosePopupsExceptModals();is_popup_open¶
def is_popup_open(id_: ID, popup_flags: PopupFlags) -> boolIMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags);get_popup_allowed_extent_rect¶
def get_popup_allowed_extent_rect(window: Window) -> ImRectIMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);get_top_most_popup_modal¶
def get_top_most_popup_modal() -> WindowIMGUI_API ImGuiWindow* GetTopMostPopupModal();get_top_most_and_visible_popup_modal¶
def get_top_most_and_visible_popup_modal() -> WindowIMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();find_blocking_modal¶
def find_blocking_modal(window: Window) -> WindowIMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window);find_best_window_pos_for_popup¶
def find_best_window_pos_for_popup(window: Window) -> ImVec2IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);find_best_window_pos_for_popup_ex¶
def find_best_window_pos_for_popup_ex(ref_pos: ImVec2Like, size: ImVec2Like, last_dir: Dir, r_outer: ImRect, r_avoid: ImRect, policy: PopupPositionPolicy) -> ImVec2IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);get_mouse_button_from_popup_flags¶
def get_mouse_button_from_popup_flags(flags: PopupFlags) -> MouseButtonIMGUI_API ImGuiMouseButton GetMouseButtonFromPopupFlags(ImGuiPopupFlags flags);is_popup_open_request_for_item¶
def is_popup_open_request_for_item(flags: PopupFlags, id_: ID) -> boolIMGUI_API bool IsPopupOpenRequestForItem(ImGuiPopupFlags flags, ImGuiID id);is_popup_open_request_for_window¶
def is_popup_open_request_for_window(flags: PopupFlags) -> boolIMGUI_API bool IsPopupOpenRequestForWindow(ImGuiPopupFlags flags);Tooltips¶
begin_tooltip_ex¶
def begin_tooltip_ex(tooltip_flags: TooltipFlags, extra_window_flags: WindowFlags) -> boolIMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);begin_tooltip_hidden¶
def begin_tooltip_hidden() -> boolIMGUI_API bool BeginTooltipHidden();Menus¶
begin_viewport_side_bar¶
def begin_viewport_side_bar(name: str, viewport: Viewport, dir: Dir, size: float, window_flags: WindowFlags) -> boolIMGUI_API bool BeginViewportSideBar(const char* name, ImGuiViewport* viewport, ImGuiDir dir, float size, ImGuiWindowFlags window_flags);begin_menu_ex¶
def begin_menu_ex(label: str, icon: str, enabled: bool = True) -> boolIMGUI_API bool BeginMenuEx(const char* label, const char* icon, bool enabled = true);menu_item_ex¶
def menu_item_ex(label: str, icon: str, shortcut: Optional[str] = None, selected: bool = False, enabled: bool = True) -> boolIMGUI_API bool MenuItemEx(const char* label, const char* icon, const char* shortcut = NULL, bool selected = false, bool enabled = true);Combos¶
begin_combo_popup¶
def begin_combo_popup(popup_id: ID, bb: ImRect, flags: ComboFlags) -> boolIMGUI_API bool BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags flags);begin_combo_preview¶
def begin_combo_preview() -> boolIMGUI_API bool BeginComboPreview();Submit preview contents a combo. Call this after EndCombo() to display contents that’s more than just a text label.
end_combo_preview¶
def end_combo_preview() -> NoneIMGUI_API void EndComboPreview();Keyboard/Gamepad Navigation¶
nav_init_window¶
def nav_init_window(window: Window, force_reinit: bool) -> NoneIMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);nav_init_request_apply_result¶
def nav_init_request_apply_result() -> NoneIMGUI_API void NavInitRequestApplyResult();nav_move_request_but_no_result_yet¶
def nav_move_request_but_no_result_yet() -> boolIMGUI_API bool NavMoveRequestButNoResultYet();nav_move_request_submit¶
def nav_move_request_submit(move_dir: Dir, clip_dir: Dir, move_flags: NavMoveFlags, scroll_flags: ScrollFlags) -> NoneIMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);nav_move_request_forward¶
def nav_move_request_forward(move_dir: Dir, clip_dir: Dir, move_flags: NavMoveFlags, scroll_flags: ScrollFlags) -> NoneIMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);nav_move_request_resolve_with_last_item¶
def nav_move_request_resolve_with_last_item(result: NavItemData) -> NoneIMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result);nav_move_request_resolve_with_past_tree_node¶
def nav_move_request_resolve_with_past_tree_node(result: NavItemData, tree_node_data: TreeNodeStackData) -> NoneIMGUI_API void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, const ImGuiTreeNodeStackData* tree_node_data);nav_move_request_cancel¶
def nav_move_request_cancel() -> NoneIMGUI_API void NavMoveRequestCancel();nav_move_request_apply_result¶
def nav_move_request_apply_result() -> NoneIMGUI_API void NavMoveRequestApplyResult();nav_move_request_try_wrapping¶
def nav_move_request_try_wrapping(window: Window, move_flags: NavMoveFlags) -> NoneIMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);nav_highlight_activated¶
def nav_highlight_activated(id_: ID) -> NoneIMGUI_API void NavHighlightActivated(ImGuiID id);nav_clear_preferred_pos_for_axis¶
def nav_clear_preferred_pos_for_axis(axis: Axis) -> NoneIMGUI_API void NavClearPreferredPosForAxis(ImGuiAxis axis);set_nav_cursor_visible_after_move¶
def set_nav_cursor_visible_after_move() -> NoneIMGUI_API void SetNavCursorVisibleAfterMove();nav_update_current_window_is_scroll_pushable_x¶
def nav_update_current_window_is_scroll_pushable_x() -> NoneIMGUI_API void NavUpdateCurrentWindowIsScrollPushableX();set_nav_window¶
def set_nav_window(window: Window) -> NoneIMGUI_API void SetNavWindow(ImGuiWindow* window);set_nav_id¶
def set_nav_id(id_: ID, nav_layer: NavLayer, focus_scope_id: ID, rect_rel: ImRect) -> NoneIMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel);set_nav_focus_scope¶
def set_nav_focus_scope(focus_scope_id: ID) -> NoneIMGUI_API void SetNavFocusScope(ImGuiID focus_scope_id);Focus/Activation¶
This should be part of a larger set of API: FocusItem(offset = -1), FocusItemByID(id), ActivateItem(offset = -1), ActivateItemByID(id) etc. which are much harder to design and implement than expected. I have a couple of private branches on this matter but it’s not simple. For now implementing the easy ones.
focus_item¶
def focus_item() -> NoneIMGUI_API void FocusItem();Focus last item (no selection/activation).
activate_item_by_id¶
def activate_item_by_id(id_: ID) -> NoneIMGUI_API void ActivateItemByID(ImGuiID id);Activate an item by ID (button, checkbox, tree node etc.). Activation is queued and processed on the next frame when the item is encountered again. Was called ‘ActivateItem()’ before 1.89.7.
Inputs¶
FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
is_named_key¶
def is_named_key(key: Key) -> boolinline bool IsNamedKey(ImGuiKey key);(private API)
is_named_key_or_mod¶
def is_named_key_or_mod(key: Key) -> boolinline bool IsNamedKeyOrMod(ImGuiKey key);(private API)
is_legacy_key¶
def is_legacy_key(key: Key) -> boolinline bool IsLegacyKey(ImGuiKey key);(private API)
is_keyboard_key¶
def is_keyboard_key(key: Key) -> boolinline bool IsKeyboardKey(ImGuiKey key);(private API)
is_gamepad_key¶
def is_gamepad_key(key: Key) -> boolinline bool IsGamepadKey(ImGuiKey key);(private API)
is_mouse_key¶
def is_mouse_key(key: Key) -> boolinline bool IsMouseKey(ImGuiKey key);(private API)
is_alias_key¶
def is_alias_key(key: Key) -> boolinline bool IsAliasKey(ImGuiKey key);(private API)
is_lr_mod_key¶
def is_lr_mod_key(key: Key) -> boolinline bool IsLRModKey(ImGuiKey key);(private API)
fixup_key_chord¶
def fixup_key_chord(key_chord: KeyChord) -> KeyChordImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);(private API)
convert_single_mod_flag_to_key¶
def convert_single_mod_flag_to_key(key: Key) -> Keyinline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key);(private API)
get_key_data¶
@overload
def get_key_data(ctx: Context, key: Key) -> KeyData
@overload
def get_key_data(key: Key) -> KeyDataIMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key);
inline ImGuiKeyData* GetKeyData(ImGuiKey key);(private API)
mouse_button_to_key¶
def mouse_button_to_key(button: MouseButton) -> Keyinline ImGuiKey MouseButtonToKey(ImGuiMouseButton button);(private API)
is_mouse_drag_past_threshold¶
def is_mouse_drag_past_threshold(button: MouseButton, lock_threshold: float = -1.0) -> boolIMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f);get_key_magnitude2d¶
def get_key_magnitude2d(key_left: Key, key_right: Key, key_up: Key, key_down: Key) -> ImVec2IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);get_nav_tweak_pressed_amount¶
def get_nav_tweak_pressed_amount(axis: Axis) -> floatIMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis);calc_typematic_repeat_amount¶
def calc_typematic_repeat_amount(t0: float, t1: float, repeat_delay: float, repeat_rate: float) -> intIMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);get_typematic_repeat_rate¶
def get_typematic_repeat_rate(flags: InputFlags, repeat_delay: float, repeat_rate: float) -> Tuple[float, float]IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate);teleport_mouse_pos¶
def teleport_mouse_pos(pos: ImVec2Like) -> NoneIMGUI_API void TeleportMousePos(const ImVec2& pos);set_active_id_using_all_keyboard_keys¶
def set_active_id_using_all_keyboard_keys() -> NoneIMGUI_API void SetActiveIdUsingAllKeyboardKeys();is_active_id_using_nav_dir¶
def is_active_id_using_nav_dir(dir: Dir) -> boolinline bool IsActiveIdUsingNavDir(ImGuiDir dir);(private API)
[EXPERIMENTAL] Low-Level: Key/Input Ownership¶
The idea is that instead of “eating” a given input, we can link to an owner id.
Ownership is most often claimed as a result of reacting to a press/down event (but occasionally may be claimed ahead).
Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID.
Legacy input queries (without specifying an owner or _Any or _None) are equivalent to using ImGuiKeyOwner_Any (== 0).
Input ownership is automatically released on the frame after a key is released. Therefore:
for ownership registration happening as a result of a down/press event, the SetKeyOwner() call may be done once (common case).
for ownership registration happening ahead of a down/press event, the SetKeyOwner() call needs to be made every frame (happens if e.g. claiming ownership on hover).
SetItemKeyOwner() is a shortcut for common simple case. A custom widget will probably want to call SetKeyOwner() multiple times directly based on its interaction state.
This is marked experimental because not all widgets are fully honoring the Set/Test idioms. We will need to move forward step by step.
Please open a GitHub Issue to submit your usage scenario or if there’s a use case you need solved.
get_key_owner¶
def get_key_owner(key: Key) -> IDIMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);set_key_owner¶
def set_key_owner(key: Key, owner_id: ID, flags: InputFlags = 0) -> NoneIMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);set_key_owners_for_key_chord¶
def set_key_owners_for_key_chord(key: KeyChord, owner_id: ID, flags: InputFlags = 0) -> NoneIMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);set_item_key_owner¶
def set_item_key_owner(key: Key, flags: InputFlags) -> boolIMGUI_API bool SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);test_key_owner¶
def test_key_owner(key: Key, owner_id: ID) -> boolIMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);Test that key is either not owned, either owned by ‘owner_id’
get_key_owner_data¶
def get_key_owner_data(ctx: Context, key: Key) -> KeyOwnerDatainline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key);(private API)
is_key_down¶
def is_key_down(key: Key, owner_id: ID) -> boolIMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);[EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership
Important: legacy IsKeyPressed(ImGuiKey, bool repeat=True) DEFAULTS to repeat, new IsKeyPressed() requires EXPLICIT ImGuiInputFlags_Repeat flag.
Expected to be later promoted to public API, the prototypes are designed to replace existing ones (since owner_id can default to Any == 0)
Specifying a value for ‘ImGuiID owner’ will test that EITHER the key is NOT owned (UNLESS locked), EITHER the key is owned by ‘owner’.
Legacy functions use ImGuiKeyOwner_Any meaning that they typically ignore ownership, unless a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.Binding generators may want to ignore those for now, or suffix them with Ex() until we decide if this gets moved into public API.
is_key_pressed¶
def is_key_pressed(key: Key, flags: InputFlags, owner_id: ID = 0) -> boolIMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);Important: when transitioning from old to new IsKeyPressed(): old API has “bool repeat = True”, so would default to repeat. New API requires explicit ImGuiInputFlags_Repeat.
is_key_released¶
def is_key_released(key: Key, owner_id: ID) -> boolIMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);is_key_chord_pressed¶
def is_key_chord_pressed(key_chord: KeyChord, flags: InputFlags, owner_id: ID = 0) -> boolIMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);is_mouse_down¶
def is_mouse_down(button: MouseButton, owner_id: ID) -> boolIMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);is_mouse_clicked¶
def is_mouse_clicked(button: MouseButton, flags: InputFlags, owner_id: ID = 0) -> boolIMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);is_mouse_released¶
def is_mouse_released(button: MouseButton, owner_id: ID) -> boolIMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);is_mouse_double_clicked¶
def is_mouse_double_clicked(button: MouseButton, owner_id: ID) -> boolIMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);Shortcut Testing & Routing¶
Set Shortcut() and SetNextItemShortcut() in imgui.h
When a policy (except for ImGuiInputFlags_RouteAlways ) is set, Shortcut() will register itself with SetShortcutRouting(), allowing the system to decide where to route the input among other route-aware calls. ( using ImGuiInputFlags_RouteAlways is roughly equivalent to calling IsKeyChordPressed(key) and bypassing route registration and check)
When using one of the routing option:
The default route is ImGuiInputFlags_RouteFocused (accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window.)
Routes are requested given a chord (key + modifiers) and a routing policy.
Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame.
Each route may be granted to a single owner. When multiple requests are made we have policies to select the winning route (e.g. deep most window).
Multiple read sites may use the same owner id can all access the granted route.
When owner_id is 0 we use the current Focus Scope ID as a owner ID in order to identify our location.
You can chain two unrelated windows in the focus stack using SetWindowParentWindowForFocusRoute() e.g. if you have a tool window associated to a document, and you want document shortcuts to run when the tool is focused.
shortcut¶
def shortcut(key_chord: KeyChord, flags: InputFlags, owner_id: ID) -> boolIMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);set_shortcut_routing¶
def set_shortcut_routing(key_chord: KeyChord, flags: InputFlags, owner_id: ID) -> boolIMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);owner_id needs to be explicit and cannot be 0
test_shortcut_routing¶
def test_shortcut_routing(key_chord: KeyChord, owner_id: ID) -> boolIMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);get_shortcut_routing_data¶
def get_shortcut_routing_data(key_chord: KeyChord) -> KeyRoutingDataIMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord);Docking¶
(some functions are only declared in imgui.cpp, see Docking section)
dock_context_initialize¶
def dock_context_initialize(ctx: Context) -> NoneIMGUI_API void DockContextInitialize(ImGuiContext* ctx);dock_context_shutdown¶
def dock_context_shutdown(ctx: Context) -> NoneIMGUI_API void DockContextShutdown(ImGuiContext* ctx);dock_context_clear_nodes¶
def dock_context_clear_nodes(ctx: Context, root_id: ID, clear_settings_refs: bool) -> NoneIMGUI_API void DockContextClearNodes(ImGuiContext* ctx, ImGuiID root_id, bool clear_settings_refs);Use root_id==0 to clear all
dock_context_rebuild_nodes¶
def dock_context_rebuild_nodes(ctx: Context) -> NoneIMGUI_API void DockContextRebuildNodes(ImGuiContext* ctx);dock_context_new_frame_update_undocking¶
def dock_context_new_frame_update_undocking(ctx: Context) -> NoneIMGUI_API void DockContextNewFrameUpdateUndocking(ImGuiContext* ctx);dock_context_new_frame_update_docking¶
def dock_context_new_frame_update_docking(ctx: Context) -> NoneIMGUI_API void DockContextNewFrameUpdateDocking(ImGuiContext* ctx);dock_context_end_frame¶
def dock_context_end_frame(ctx: Context) -> NoneIMGUI_API void DockContextEndFrame(ImGuiContext* ctx);dock_context_gen_node_id¶
def dock_context_gen_node_id(ctx: Context) -> IDIMGUI_API ImGuiID DockContextGenNodeID(ImGuiContext* ctx);dock_context_queue_dock¶
def dock_context_queue_dock(ctx: Context, target: Window, target_node: DockNode, payload: Window, split_dir: Dir, split_ratio: float, split_outer: bool) -> NoneIMGUI_API void DockContextQueueDock(ImGuiContext* ctx, ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload, ImGuiDir split_dir, float split_ratio, bool split_outer);dock_context_queue_undock_window¶
def dock_context_queue_undock_window(ctx: Context, window: Window) -> NoneIMGUI_API void DockContextQueueUndockWindow(ImGuiContext* ctx, ImGuiWindow* window);dock_context_queue_undock_node¶
def dock_context_queue_undock_node(ctx: Context, node: DockNode) -> NoneIMGUI_API void DockContextQueueUndockNode(ImGuiContext* ctx, ImGuiDockNode* node);dock_context_process_undock_window¶
def dock_context_process_undock_window(ctx: Context, window: Window, clear_persistent_docking_ref: bool = True) -> NoneIMGUI_API void DockContextProcessUndockWindow(ImGuiContext* ctx, ImGuiWindow* window, bool clear_persistent_docking_ref = true);dock_context_process_undock_node¶
def dock_context_process_undock_node(ctx: Context, node: DockNode) -> NoneIMGUI_API void DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node);dock_context_calc_drop_pos_for_docking¶
def dock_context_calc_drop_pos_for_docking(target: Window, target_node: DockNode, payload_window: Window, payload_node: DockNode, split_dir: Dir, split_outer: bool, out_pos: ImVec2Like) -> boolIMGUI_API bool DockContextCalcDropPosForDocking(ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload_window, ImGuiDockNode* payload_node, ImGuiDir split_dir, bool split_outer, ImVec2* out_pos);dock_context_find_node_by_id¶
def dock_context_find_node_by_id(ctx: Context, id_: ID) -> DockNodeIMGUI_API ImGuiDockNode*DockContextFindNodeByID(ImGuiContext* ctx, ImGuiID id);dock_node_window_menu_handler_default¶
def dock_node_window_menu_handler_default(ctx: Context, node: DockNode, tab_bar: TabBar) -> NoneIMGUI_API void DockNodeWindowMenuHandler_Default(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar);dock_node_begin_amend_tab_bar¶
def dock_node_begin_amend_tab_bar(node: DockNode) -> boolIMGUI_API bool DockNodeBeginAmendTabBar(ImGuiDockNode* node);dock_node_end_amend_tab_bar¶
def dock_node_end_amend_tab_bar() -> NoneIMGUI_API void DockNodeEndAmendTabBar();dock_node_get_root_node¶
def dock_node_get_root_node(node: DockNode) -> DockNodeinline ImGuiDockNode* DockNodeGetRootNode(ImGuiDockNode* node);(private API)
dock_node_is_in_hierarchy_of¶
def dock_node_is_in_hierarchy_of(node: DockNode, parent: DockNode) -> boolinline bool DockNodeIsInHierarchyOf(ImGuiDockNode* node, ImGuiDockNode* parent);(private API)
dock_node_get_depth¶
def dock_node_get_depth(node: DockNode) -> intinline int DockNodeGetDepth(const ImGuiDockNode* node);(private API)
dock_node_get_window_menu_button_id¶
def dock_node_get_window_menu_button_id(node: DockNode) -> IDinline ImGuiID DockNodeGetWindowMenuButtonId(const ImGuiDockNode* node);(private API)
get_window_dock_node¶
def get_window_dock_node() -> DockNodeinline ImGuiDockNode* GetWindowDockNode();(private API)
get_window_always_want_own_tab_bar¶
def get_window_always_want_own_tab_bar(window: Window) -> boolIMGUI_API bool GetWindowAlwaysWantOwnTabBar(ImGuiWindow* window);begin_docked¶
def begin_docked(window: Window, p_open: bool) -> boolIMGUI_API void BeginDocked(ImGuiWindow* window, bool* p_open);begin_dockable_drag_drop_source¶
def begin_dockable_drag_drop_source(window: Window) -> NoneIMGUI_API void BeginDockableDragDropSource(ImGuiWindow* window);begin_dockable_drag_drop_target¶
def begin_dockable_drag_drop_target(window: Window) -> NoneIMGUI_API void BeginDockableDragDropTarget(ImGuiWindow* window);set_window_dock¶
def set_window_dock(window: Window, dock_id: ID, cond: Cond) -> NoneIMGUI_API void SetWindowDock(ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond);dock_builder_dock_window¶
def dock_builder_dock_window(window_name: str, node_id: ID) -> NoneIMGUI_API void DockBuilderDockWindow(const char* window_name, ImGuiID node_id);Docking - Builder function needs to be generally called before the node is used/submitted.
The DockBuilderXXX functions are designed to eventually become a public API, but it is too early to expose it and guarantee stability.
Do not hold on ImGuiDockNode* pointers! They may be invalidated by any split/merge/remove operation and every frame.
To create a DockSpace() node, make sure to set the ImGuiDockNodeFlags_DockSpace flag when calling DockBuilderAddNode().
You can create dockspace nodes (attached to a window) or floating nodes (carry its own window) with this API.DockBuilderSplitNode() create 2 child nodes within 1 node. The initial node becomes a parent node.
If you intend to split the node immediately after creation using DockBuilderSplitNode(), make sure to call DockBuilderSetNodeSize() beforehand. If you don’t, the resulting split sizes may not be reliable.
Call DockBuilderFinish() after you are done.
dock_builder_get_node¶
def dock_builder_get_node(node_id: ID) -> DockNodeIMGUI_API ImGuiDockNode*DockBuilderGetNode(ImGuiID node_id);dock_builder_get_central_node¶
def dock_builder_get_central_node(node_id: ID) -> DockNodeinline ImGuiDockNode* DockBuilderGetCentralNode(ImGuiID node_id);(private API)
dock_builder_add_node¶
def dock_builder_add_node(node_id: ID = 0, flags: DockNodeFlags = 0) -> IDIMGUI_API ImGuiID DockBuilderAddNode(ImGuiID node_id = 0, ImGuiDockNodeFlags flags = 0);dock_builder_remove_node¶
def dock_builder_remove_node(node_id: ID) -> NoneIMGUI_API void DockBuilderRemoveNode(ImGuiID node_id);Remove node and all its child, undock all windows
dock_builder_remove_node_docked_windows¶
def dock_builder_remove_node_docked_windows(node_id: ID, clear_settings_refs: bool = True) -> NoneIMGUI_API void DockBuilderRemoveNodeDockedWindows(ImGuiID node_id, bool clear_settings_refs = true);dock_builder_remove_node_child_nodes¶
def dock_builder_remove_node_child_nodes(node_id: ID) -> NoneIMGUI_API void DockBuilderRemoveNodeChildNodes(ImGuiID node_id);Remove all split/hierarchy. All remaining docked windows will be re-docked to the remaining root node (node_id).
dock_builder_set_node_pos¶
def dock_builder_set_node_pos(node_id: ID, pos: ImVec2Like) -> NoneIMGUI_API void DockBuilderSetNodePos(ImGuiID node_id, ImVec2 pos);dock_builder_set_node_size¶
def dock_builder_set_node_size(node_id: ID, size: ImVec2Like) -> NoneIMGUI_API void DockBuilderSetNodeSize(ImGuiID node_id, ImVec2 size);dock_builder_copy_node¶
def dock_builder_copy_node(src_node_id: ID, dst_node_id: ID, out_node_remap_pairs: ImVector_ID) -> NoneIMGUI_API void DockBuilderCopyNode(ImGuiID src_node_id, ImGuiID dst_node_id, ImVector<ImGuiID>* out_node_remap_pairs);dock_builder_copy_window_settings¶
def dock_builder_copy_window_settings(src_name: str, dst_name: str) -> NoneIMGUI_API void DockBuilderCopyWindowSettings(const char* src_name, const char* dst_name);dock_builder_finish¶
def dock_builder_finish(node_id: ID) -> NoneIMGUI_API void DockBuilderFinish(ImGuiID node_id);[EXPERIMENTAL] Focus Scope¶
This is generally used to identify a unique input location (for e.g. a selection set)
There is one per window (automatically set in Begin), but:
Selection patterns generally need to react (e.g. clear a selection) when landing on one item of the set.
So in order to identify a set multiple lists in same window may each need a focus scope.
If you imagine an hypothetical BeginSelectionGroup()/EndSelectionGroup() api, it would likely call PushFocusScope()/EndFocusScope()Shortcut routing also use focus scope as a default location identifier if an owner is not provided.
We don’t use the ID Stack for this as it is common to want them separate.
push_focus_scope¶
def push_focus_scope(id_: ID) -> NoneIMGUI_API void PushFocusScope(ImGuiID id);pop_focus_scope¶
def pop_focus_scope() -> NoneIMGUI_API void PopFocusScope();is_in_nav_focus_route¶
def is_in_nav_focus_route(focus_scope_id: ID) -> boolIMGUI_API bool IsInNavFocusRoute(ImGuiID focus_scope_id);get_current_focus_scope¶
def get_current_focus_scope() -> IDinline ImGuiID GetCurrentFocusScope();(private API)
Focus scope we are outputting into, set by PushFocusScope()
Drag and Drop¶
is_drag_drop_active¶
def is_drag_drop_active() -> boolIMGUI_API bool IsDragDropActive();begin_drag_drop_target_custom¶
def begin_drag_drop_target_custom(bb: ImRect, id_: ID) -> boolIMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);begin_drag_drop_target_viewport¶
def begin_drag_drop_target_viewport(viewport: Viewport, p_bb: Optional[ImRect] = None) -> boolIMGUI_API bool BeginDragDropTargetViewport(ImGuiViewport* viewport, const ImRect* p_bb = NULL);clear_drag_drop¶
def clear_drag_drop() -> NoneIMGUI_API void ClearDragDrop();is_drag_drop_payload_being_accepted¶
def is_drag_drop_payload_being_accepted() -> boolIMGUI_API bool IsDragDropPayloadBeingAccepted();render_drag_drop_target_rect_for_item¶
def render_drag_drop_target_rect_for_item(bb: ImRect) -> NoneIMGUI_API void RenderDragDropTargetRectForItem(const ImRect& bb);render_drag_drop_target_rect_ex¶
def render_drag_drop_target_rect_ex(draw_list: ImDrawList, bb: ImRect, rounding: float) -> NoneIMGUI_API void RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb, float rounding);Typing-Select API¶
(provide Windows Explorer style “select items by typing partial name” + “cycle through items by typing same letter” feature) (this is currently not documented nor used by main library, but should work. See “widgets_typingselect” in imgui_test_suite for usage code. Please let us know if you use this!)
get_typing_select_request¶
def get_typing_select_request(flags: TypingSelectFlags = TypingSelectFlags_None) -> TypingSelectRequestIMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);Box-Select API¶
begin_box_select¶
def begin_box_select(scope_rect: ImRect, window: Window, box_select_id: ID, ms_flags: MultiSelectFlags) -> boolIMGUI_API bool BeginBoxSelect(const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);end_box_select¶
def end_box_select(scope_rect: ImRect, ms_flags: MultiSelectFlags) -> NoneIMGUI_API void EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);Multi-Select API¶
multi_select_item_header¶
def multi_select_item_header(id_: ID, p_selected: bool, p_button_flags: ButtonFlags) -> boolIMGUI_API void MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags);multi_select_item_footer¶
def multi_select_item_footer(id_: ID, p_selected: bool, p_pressed: bool, extra_flags: MultiSelectFlags = 0) -> Tuple[bool, bool]IMGUI_API void MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed, ImGuiMultiSelectFlags extra_flags = 0);multi_select_add_set_all¶
def multi_select_add_set_all(ms: MultiSelectTempData, selected: bool) -> NoneIMGUI_API void MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected);multi_select_add_set_range¶
def multi_select_add_set_range(ms: MultiSelectTempData, selected: bool, range_dir: int, first_item: SelectionUserData, last_item: SelectionUserData) -> NoneIMGUI_API void MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);get_box_select_state¶
def get_box_select_state(id_: ID) -> BoxSelectStateinline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID id);(private API)
get_multi_select_state¶
def get_multi_select_state(id_: ID) -> MultiSelectStateinline ImGuiMultiSelectState* GetMultiSelectState(ImGuiID id);(private API)
get_current_tab_bar¶
def get_current_tab_bar() -> TabBarinline ImGuiTabBar* GetCurrentTabBar();Tab Bars (private API)
tab_bar_find_by_id¶
def tab_bar_find_by_id(id_: ID) -> TabBarIMGUI_API ImGuiTabBar* TabBarFindByID(ImGuiID id);tab_bar_remove¶
def tab_bar_remove(tab_bar: TabBar) -> NoneIMGUI_API void TabBarRemove(ImGuiTabBar* tab_bar);begin_tab_bar_ex¶
def begin_tab_bar_ex(tab_bar: TabBar, bb: ImRect, flags: TabBarFlags) -> boolIMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags);tab_bar_find_tab_by_id¶
def tab_bar_find_tab_by_id(tab_bar: TabBar, tab_id: ID) -> TabItemIMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id);tab_bar_find_tab_by_order¶
def tab_bar_find_tab_by_order(tab_bar: TabBar, order: int) -> TabItemIMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order);tab_bar_find_most_recently_selected_tab_for_active_window¶
def tab_bar_find_most_recently_selected_tab_for_active_window(tab_bar: TabBar) -> TabItemIMGUI_API ImGuiTabItem* TabBarFindMostRecentlySelectedTabForActiveWindow(ImGuiTabBar* tab_bar);tab_bar_get_current_tab¶
def tab_bar_get_current_tab(tab_bar: TabBar) -> TabItemIMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar);tab_bar_get_tab_order¶
def tab_bar_get_tab_order(tab_bar: TabBar, tab: TabItem) -> intinline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);(private API)
tab_bar_get_tab_name¶
def tab_bar_get_tab_name(tab_bar: TabBar, tab: TabItem) -> strIMGUI_API const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);tab_bar_add_tab¶
def tab_bar_add_tab(tab_bar: TabBar, tab_flags: TabItemFlags, window: Window) -> NoneIMGUI_API void TabBarAddTab(ImGuiTabBar* tab_bar, ImGuiTabItemFlags tab_flags, ImGuiWindow* window);tab_bar_remove_tab¶
def tab_bar_remove_tab(tab_bar: TabBar, tab_id: ID) -> NoneIMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);tab_bar_close_tab¶
def tab_bar_close_tab(tab_bar: TabBar, tab: TabItem) -> NoneIMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);tab_bar_queue_focus¶
@overload
def tab_bar_queue_focus(tab_bar: TabBar, tab: TabItem) -> None
@overload
def tab_bar_queue_focus(tab_bar: TabBar, tab_name: str) -> NoneIMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name);tab_bar_queue_reorder¶
def tab_bar_queue_reorder(tab_bar: TabBar, tab: TabItem, offset: int) -> NoneIMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset);tab_bar_queue_reorder_from_mouse_pos¶
def tab_bar_queue_reorder_from_mouse_pos(tab_bar: TabBar, tab: TabItem, mouse_pos: ImVec2Like) -> NoneIMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);tab_bar_process_reorder¶
def tab_bar_process_reorder(tab_bar: TabBar) -> boolIMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar);tab_item_ex¶
def tab_item_ex(tab_bar: TabBar, label: str, p_open: bool, flags: TabItemFlags, docked_window: Window) -> Tuple[bool, bool]IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window);tab_item_spacing¶
def tab_item_spacing(str_id: str, flags: TabItemFlags, width: float) -> NoneIMGUI_API void TabItemSpacing(const char* str_id, ImGuiTabItemFlags flags, float width);tab_item_calc_size¶
@overload
def tab_item_calc_size(label: str, has_close_button_or_unsaved_marker: bool) -> ImVec2
@overload
def tab_item_calc_size(window: Window) -> ImVec2IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker);
IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window);tab_item_background¶
def tab_item_background(draw_list: ImDrawList, bb: ImRect, flags: TabItemFlags, col: ImU32) -> NoneIMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);tab_item_label_and_close_button¶
def tab_item_label_and_close_button(draw_list: ImDrawList, bb: ImRect, flags: TabItemFlags, frame_padding: ImVec2Like, label: str, tab_id: ID, close_button_id: ID, is_contents_visible: bool, out_just_closed: bool, out_text_clipped: bool) -> Tuple[bool, bool]IMGUI_API void TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id, bool is_contents_visible, bool* out_just_closed, bool* out_text_clipped);Render helpers¶
AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
render_text¶
def render_text(pos: ImVec2Like, text: str, text_end: Optional[str] = None, hide_text_after_hash: bool = True) -> NoneIMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);render_text_wrapped¶
def render_text_wrapped(pos: ImVec2Like, text: str, text_end: str, wrap_width: float) -> NoneIMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);render_text_clipped¶
def render_text_clipped(pos_min: ImVec2Like, pos_max: ImVec2Like, text: str, text_end: str, text_size_if_known: ImVec2Like, align: Optional[ImVec2Like] = None, clip_rect: Optional[ImRect] = None) -> NoneIMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);Python bindings defaults:
If align is None, then its default value will be: ImVec2(0, 0)
render_text_clipped_ex¶
def render_text_clipped_ex(draw_list: ImDrawList, pos_min: ImVec2Like, pos_max: ImVec2Like, text: str, text_end: str, text_size_if_known: ImVec2Like, align: Optional[ImVec2Like] = None, clip_rect: Optional[ImRect] = None) -> NoneIMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);Python bindings defaults:
If align is None, then its default value will be: ImVec2(0, 0)
render_text_ellipsis¶
def render_text_ellipsis(draw_list: ImDrawList, pos_min: ImVec2Like, pos_max: ImVec2Like, ellipsis_max_x: float, text: str, text_end: str, text_size_if_known: ImVec2Like) -> NoneIMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known);render_frame¶
def render_frame(p_min: ImVec2Like, p_max: ImVec2Like, fill_col: ImU32, borders: bool = True, rounding: float = 0.0) -> NoneIMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders = true, float rounding = 0.0f);render_frame_border¶
def render_frame_border(p_min: ImVec2Like, p_max: ImVec2Like, rounding: float = 0.0) -> NoneIMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);render_color_component_marker¶
def render_color_component_marker(bb: ImRect, col: ImU32, rounding: float) -> NoneIMGUI_API void RenderColorComponentMarker(const ImRect& bb, ImU32 col, float rounding);render_color_rect_with_alpha_checkerboard¶
def render_color_rect_with_alpha_checkerboard(draw_list: ImDrawList, p_min: ImVec2Like, p_max: ImVec2Like, col: ImU32, alpha: float, grid_step: float, grid_off: ImVec2Like, rounding: float = 0.0, flags: ImDrawFlags = 0) -> NoneIMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 col, float alpha, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);render_nav_cursor¶
def render_nav_cursor(bb: ImRect, id_: ID, flags: NavRenderCursorFlags = NavRenderCursorFlags_None, rounding: float = -1.0) -> NoneIMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None, float rounding = -1.0f);Navigation highlight
find_rendered_text_end¶
def find_rendered_text_end(text: str, text_end: Optional[str] = None) -> strIMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL);Find the optional ## from which we stop displaying text.
render_mouse_cursor¶
def render_mouse_cursor(pos: ImVec2Like, scale: float, mouse_cursor: MouseCursor, col_fill: ImU32, col_border: ImU32, col_shadow: ImU32) -> NoneIMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);render_arrow¶
def render_arrow(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32, dir: Dir, scale: float = 1.0) -> NoneIMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f);Render helpers (those functions don’t access any ImGui state!)
render_bullet¶
def render_bullet(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32) -> NoneIMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);render_check_mark¶
def render_check_mark(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32, sz: float) -> NoneIMGUI_API void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz);render_arrow_pointing_at¶
def render_arrow_pointing_at(draw_list: ImDrawList, pos: ImVec2Like, half_sz: ImVec2Like, direction: Dir, col: ImU32) -> NoneIMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);render_arrow_dock_menu¶
def render_arrow_dock_menu(draw_list: ImDrawList, p_min: ImVec2Like, sz: float, col: ImU32) -> NoneIMGUI_API void RenderArrowDockMenu(ImDrawList* draw_list, ImVec2 p_min, float sz, ImU32 col);render_rect_filled_in_range_h¶
def render_rect_filled_in_range_h(draw_list: ImDrawList, rect: ImRect, col: ImU32, fill_x0: float, fill_x1: float, rounding: float) -> NoneIMGUI_API void RenderRectFilledInRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float fill_x0, float fill_x1, float rounding);render_rect_filled_with_hole¶
def render_rect_filled_with_hole(draw_list: ImDrawList, outer: ImRect, inner: ImRect, col: ImU32, rounding: float) -> NoneIMGUI_API void RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding);calc_rounding_flags_for_rect_in_rect¶
def calc_rounding_flags_for_rect_in_rect(r_in: ImRect, r_outer: ImRect, threshold: float) -> ImDrawFlagsIMGUI_API ImDrawFlags CalcRoundingFlagsForRectInRect(const ImRect& r_in, const ImRect& r_outer, float threshold);Widgets: Text¶
text_ex¶
def text_ex(text: str, text_end: Optional[str] = None, flags: TextFlags = 0) -> NoneIMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);text_aligned¶
def text_aligned(align_x: float, width: float, fmt: str) -> NoneIMGUI_API void TextAligned(float align_x, float width, const char* fmt, ...) ;FIXME-WIP: Works but API is likely to be reworked.
Widgets¶
button_ex¶
def button_ex(label: str, size_arg: Optional[ImVec2Like] = None, flags: ButtonFlags = 0) -> boolIMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);Python bindings defaults:
If size_arg is None, then its default value will be: ImVec2(0, 0)
arrow_button_ex¶
def arrow_button_ex(str_id: str, dir: Dir, size_arg: ImVec2Like, flags: ButtonFlags = 0) -> boolIMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);image_button_ex¶
def image_button_ex(id_: ID, tex_ref: ImTextureRef, image_size: ImVec2Like, uv0: ImVec2Like, uv1: ImVec2Like, bg_col: ImVec4Like, tint_col: ImVec4Like, flags: ButtonFlags = 0) -> boolIMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureRef tex_ref, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0);separator_ex¶
def separator_ex(flags: SeparatorFlags, thickness: float = 1.0) -> NoneIMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f);separator_text_ex¶
def separator_text_ex(id_: ID, label: str, label_end: str, extra_width: float) -> NoneIMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width);checkbox_flags¶
@overload
def checkbox_flags(label: str, flags: ImS64, flags_value: ImS64) -> bool
@overload
def checkbox_flags(label: str, flags: ImU64, flags_value: ImU64) -> boolIMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);Widgets: Window Decorations¶
close_button¶
def close_button(id_: ID, pos: ImVec2Like) -> boolIMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos);collapse_button¶
def collapse_button(id_: ID, pos: ImVec2Like, dock_node: DockNode) -> boolIMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos, ImGuiDockNode* dock_node);scrollbar¶
def scrollbar(axis: Axis) -> NoneIMGUI_API void Scrollbar(ImGuiAxis axis);scrollbar_ex¶
def scrollbar_ex(bb: ImRect, id_: ID, axis: Axis, p_scroll_v: ImS64, avail_v: ImS64, contents_v: ImS64, draw_rounding_flags: ImDrawFlags = 0) -> boolIMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags draw_rounding_flags = 0);get_window_scrollbar_rect¶
def get_window_scrollbar_rect(window: Window, axis: Axis) -> ImRectIMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis);get_window_scrollbar_id¶
def get_window_scrollbar_id(window: Window, axis: Axis) -> IDIMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);get_window_resize_corner_id¶
def get_window_resize_corner_id(window: Window, n: int) -> IDIMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window, int n);0..3: corners
get_window_resize_border_id¶
def get_window_resize_border_id(window: Window, dir: Dir) -> IDIMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir);extend_hit_box_when_near_viewport_edge¶
def extend_hit_box_when_near_viewport_edge(window: Window, bb: ImRect, threshold: float, axis: Axis) -> NoneIMGUI_API void ExtendHitBoxWhenNearViewportEdge(ImGuiWindow* window, ImRect* bb, float threshold, ImGuiAxis axis);Widgets low-level behaviors¶
button_behavior¶
def button_behavior(bb: ImRect, id_: ID, out_hovered: bool, out_held: bool, flags: ButtonFlags = 0) -> Tuple[bool, bool, bool]IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);drag_behavior¶
def drag_behavior(id_: ID, data_type: DataType, p_v: Any, v_speed: float, p_min: Any, p_max: Any, format: str, flags: SliderFlags) -> boolIMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags);slider_behavior¶
def slider_behavior(bb: ImRect, id_: ID, data_type: DataType, p_v: Any, p_min: Any, p_max: Any, format: str, flags: SliderFlags, out_grab_bb: ImRect) -> boolIMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);splitter_behavior¶
def splitter_behavior(bb: ImRect, id_: ID, axis: Axis, size1: float, size2: float, min_size1: float, min_size2: float, hover_extend: float = 0.0, hover_visibility_delay: float = 0.0, bg_col: ImU32 = 0) -> Tuple[bool, float, float]IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0);Widgets: Tree Nodes¶
tree_node_behavior¶
def tree_node_behavior(id_: ID, flags: TreeNodeFlags, label: str, label_end: Optional[str] = None) -> boolIMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);tree_node_draw_line_to_child_node¶
def tree_node_draw_line_to_child_node(target_pos: ImVec2Like) -> NoneIMGUI_API void TreeNodeDrawLineToChildNode(const ImVec2& target_pos);tree_node_draw_line_to_tree_pop¶
def tree_node_draw_line_to_tree_pop(data: TreeNodeStackData) -> NoneIMGUI_API void TreeNodeDrawLineToTreePop(const ImGuiTreeNodeStackData* data);tree_push_override_id¶
def tree_push_override_id(id_: ID) -> NoneIMGUI_API void TreePushOverrideID(ImGuiID id);tree_node_set_open¶
def tree_node_set_open(storage_id: ID, open: bool) -> NoneIMGUI_API void TreeNodeSetOpen(ImGuiID storage_id, bool open);tree_node_update_next_open¶
def tree_node_update_next_open(storage_id: ID, flags: TreeNodeFlags) -> boolIMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags);Return open state. Consume previous SetNextItemOpen() data, if any. May return True when logging.
InputText¶
input_text_deactivate_hook¶
def input_text_deactivate_hook(id_: ID) -> NoneIMGUI_API void InputTextDeactivateHook(ImGuiID id);temp_input_is_active¶
def temp_input_is_active(id_: ID) -> boolinline bool TempInputIsActive(ImGuiID id);(private API)
get_input_text_state¶
def get_input_text_state(id_: ID) -> InputTextStateinline ImGuiInputTextState* GetInputTextState(ImGuiID id);(private API)
Get input text state if active
set_next_item_ref_val¶
def set_next_item_ref_val(data_type: DataType, p_data: Any) -> NoneIMGUI_API void SetNextItemRefVal(ImGuiDataType data_type, void* p_data);is_item_active_as_input_text¶
def is_item_active_as_input_text() -> boolinline bool IsItemActiveAsInputText();(private API)
This may be useful to apply workaround that a based on distinguish whenever an item is active as a text input field.
Color¶
color_tooltip¶
def color_tooltip(text: str, col: float, flags: ColorEditFlags) -> NoneIMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);color_edit_options_popup¶
def color_edit_options_popup(col: float, flags: ColorEditFlags) -> NoneIMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags);color_picker_options_popup¶
def color_picker_options_popup(ref_col: float, flags: ColorEditFlags) -> NoneIMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags);set_next_item_color_marker¶
def set_next_item_color_marker(col: ImU32) -> Noneinline void SetNextItemColorMarker(ImU32 col);(private API)
Shade functions (write over already created vertices)¶
shade_verts_linear_color_gradient_keep_alpha¶
def shade_verts_linear_color_gradient_keep_alpha(draw_list: ImDrawList, vert_start_idx: int, vert_end_idx: int, gradient_p0: ImVec2Like, gradient_p1: ImVec2Like, col0: ImU32, col1: ImU32) -> NoneIMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);shade_verts_linear_uv¶
def shade_verts_linear_uv(draw_list: ImDrawList, vert_start_idx: int, vert_end_idx: int, a: ImVec2Like, b: ImVec2Like, uv_a: ImVec2Like, uv_b: ImVec2Like, clamp: bool) -> NoneIMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);shade_verts_transform_pos¶
def shade_verts_transform_pos(draw_list: ImDrawList, vert_start_idx: int, vert_end_idx: int, pivot_in: ImVec2Like, cos_a: float, sin_a: float, pivot_out: ImVec2Like) -> NoneIMGUI_API void ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out);Garbage collection¶
gc_compact_transient_misc_buffers¶
def gc_compact_transient_misc_buffers() -> NoneIMGUI_API void GcCompactTransientMiscBuffers();gc_compact_transient_window_buffers¶
def gc_compact_transient_window_buffers(window: Window) -> NoneIMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);gc_awake_transient_window_buffers¶
def gc_awake_transient_window_buffers(window: Window) -> NoneIMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);error_log¶
def error_log(msg: str) -> boolIMGUI_API bool ErrorLog(const char* msg);Error handling, State Recovery
error_recovery_store_state¶
def error_recovery_store_state(state_out: ErrorRecoveryState) -> NoneIMGUI_API void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out);error_recovery_try_to_recover_state¶
def error_recovery_try_to_recover_state(state_in: ErrorRecoveryState) -> NoneIMGUI_API void ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in);error_recovery_try_to_recover_window_state¶
def error_recovery_try_to_recover_window_state(state_in: ErrorRecoveryState) -> NoneIMGUI_API void ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in);error_check_using_set_cursor_pos_to_extend_parent_boundaries¶
def error_check_using_set_cursor_pos_to_extend_parent_boundaries() -> NoneIMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();error_check_end_frame_finalize_error_tooltip¶
def error_check_end_frame_finalize_error_tooltip() -> NoneIMGUI_API void ErrorCheckEndFrameFinalizeErrorTooltip();begin_error_tooltip¶
def begin_error_tooltip() -> boolIMGUI_API bool BeginErrorTooltip();end_error_tooltip¶
def end_error_tooltip() -> NoneIMGUI_API void EndErrorTooltip();demo_marker¶
def demo_marker(file: str, line: int, section: str) -> NoneIMGUI_API void DemoMarker(const char* file, int line, const char* section);Demo Doc Marker for e.g. imgui_explorer
Debug Tools¶
debug_alloc_hook¶
def debug_alloc_hook(info: DebugAllocInfo, frame_count: int, ptr: Any, size: int) -> NoneIMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size);size >= 0 : alloc, size = -1 : free
debug_draw_cursor_pos¶
def debug_draw_cursor_pos(col: ImU32 = IM_COL32(255, 0, 0, 255)) -> NoneIMGUI_API void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));debug_draw_line_extents¶
def debug_draw_line_extents(col: ImU32 = IM_COL32(255, 0, 0, 255)) -> NoneIMGUI_API void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));debug_draw_item_rect¶
def debug_draw_item_rect(col: ImU32 = IM_COL32(255, 0, 0, 255)) -> NoneIMGUI_API void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));debug_text_unformatted_with_locate_item¶
def debug_text_unformatted_with_locate_item(line_begin: str, line_end: str) -> NoneIMGUI_API void DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end);debug_locate_item¶
def debug_locate_item(target_id: ID) -> NoneIMGUI_API void DebugLocateItem(ImGuiID target_id);Call sparingly: only 1 at the same time!
debug_locate_item_on_hover¶
def debug_locate_item_on_hover(target_id: ID) -> NoneIMGUI_API void DebugLocateItemOnHover(ImGuiID target_id);Only call on reaction to a mouse Hover: because only 1 at the same time!
debug_locate_item_resolve_with_last_item¶
def debug_locate_item_resolve_with_last_item() -> NoneIMGUI_API void DebugLocateItemResolveWithLastItem();debug_break_clear_data¶
def debug_break_clear_data() -> NoneIMGUI_API void DebugBreakClearData();debug_break_button¶
def debug_break_button(label: str, description_of_location: str) -> boolIMGUI_API bool DebugBreakButton(const char* label, const char* description_of_location);debug_break_button_tooltip¶
def debug_break_button_tooltip(keyboard_only: bool, description_of_location: str) -> NoneIMGUI_API void DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location);show_font_atlas¶
def show_font_atlas(atlas: ImFontAtlas) -> NoneIMGUI_API void ShowFontAtlas(ImFontAtlas* atlas);debug_texture_id_to_u64¶
def debug_texture_id_to_u64(tex_id: ImTextureID) -> ImU64IMGUI_API ImU64 DebugTextureIDToU64(ImTextureID tex_id);debug_hook_id_info¶
def debug_hook_id_info(id_: ID, data_type: DataType, data_id: Any, data_id_end: Any) -> NoneIMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end);debug_node_columns¶
def debug_node_columns(columns: OldColumns) -> NoneIMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns);debug_node_dock_node¶
def debug_node_dock_node(node: DockNode, label: str) -> NoneIMGUI_API void DebugNodeDockNode(ImGuiDockNode* node, const char* label);debug_node_draw_list¶
def debug_node_draw_list(window: Window, viewport: ViewportP, draw_list: ImDrawList, label: str) -> NoneIMGUI_API void DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, const ImDrawList* draw_list, const char* label);debug_node_draw_cmd_show_mesh_and_bounding_box¶
def debug_node_draw_cmd_show_mesh_and_bounding_box(out_draw_list: ImDrawList, draw_list: ImDrawList, draw_cmd: ImDrawCmd, show_mesh: bool, show_aabb: bool) -> NoneIMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb);debug_node_font¶
def debug_node_font(font: ImFont) -> NoneIMGUI_API void DebugNodeFont(ImFont* font);debug_node_font_glyphs_for_src_mask¶
def debug_node_font_glyphs_for_src_mask(font: ImFont, baked: ImFontBaked, src_mask: int) -> NoneIMGUI_API void DebugNodeFontGlyphsForSrcMask(ImFont* font, ImFontBaked* baked, int src_mask);debug_node_font_glyph¶
def debug_node_font_glyph(font: ImFont, glyph: ImFontGlyph) -> NoneIMGUI_API void DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph);debug_node_texture¶
def debug_node_texture(tex: ImTextureData, int_id: int, highlight_rect: Optional[ImFontAtlasRect] = None) -> NoneIMGUI_API void DebugNodeTexture(ImTextureData* tex, int int_id, const ImFontAtlasRect* highlight_rect = NULL);ID used to facilitate persisting the “current” texture.
debug_node_storage¶
def debug_node_storage(storage: Storage, label: str) -> NoneIMGUI_API void DebugNodeStorage(ImGuiStorage* storage, const char* label);debug_node_tab_bar¶
def debug_node_tab_bar(tab_bar: TabBar, label: str) -> NoneIMGUI_API void DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label);debug_node_table¶
def debug_node_table(table: Table) -> NoneIMGUI_API void DebugNodeTable(ImGuiTable* table);debug_node_table_settings¶
def debug_node_table_settings(settings: TableSettings, table: Table) -> NoneIMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings, ImGuiTable* table);debug_node_input_text_state¶
def debug_node_input_text_state(state: InputTextState) -> NoneIMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);debug_node_typing_select_state¶
def debug_node_typing_select_state(state: TypingSelectState) -> NoneIMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);debug_node_multi_select_state¶
def debug_node_multi_select_state(state: MultiSelectState) -> NoneIMGUI_API void DebugNodeMultiSelectState(ImGuiMultiSelectState* state);debug_node_window¶
def debug_node_window(window: Window, label: str) -> NoneIMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label);debug_node_window_settings¶
def debug_node_window_settings(settings: WindowSettings) -> NoneIMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings);debug_node_windows_list¶
def debug_node_windows_list(windows: ImVector_Window_ptr, label: str) -> NoneIMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);debug_node_viewport¶
def debug_node_viewport(viewport: ViewportP) -> NoneIMGUI_API void DebugNodeViewport(ImGuiViewportP* viewport);debug_node_platform_monitor¶
def debug_node_platform_monitor(monitor: PlatformMonitor, label: str, idx: int) -> NoneIMGUI_API void DebugNodePlatformMonitor(ImGuiPlatformMonitor* monitor, const char* label, int idx);debug_render_keyboard_preview¶
def debug_render_keyboard_preview(draw_list: ImDrawList) -> NoneIMGUI_API void DebugRenderKeyboardPreview(ImDrawList* draw_list);debug_render_viewport_thumbnail¶
def debug_render_viewport_thumbnail(draw_list: ImDrawList, viewport: ViewportP, bb: ImRect) -> NoneIMGUI_API void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb);Obsolete functions¶
ImFontLoader
ImFontLoader (class)¶
Hooks and storage for a given font backend.
This structure is likely to evolve as we add support for incremental atlas updates.
Conceptually this could be public, but API is still going to be evolve.
| Attribute | C++ | |
|---|---|---|
name: str | const char* Name; | (const) |
font_baked_src_loader_data_size: int | size_t FontBakedSrcLoaderDataSize; |
ImFontLoader.__init__¶
def __init__(self) -> NoneImFontLoader();ImFontAtlas internal API¶
im_font_atlas_rect_id_get_index¶
def im_font_atlas_rect_id_get_index(id_: ImFontAtlasRectId) -> intinline int ImFontAtlasRectId_GetIndex(ImFontAtlasRectId id);(private API)
Helpers: ImTextureRef ==/!= operators provided as convenience
(note that _TexID and _TexData are never set simultaneously)
Refer to ImFontAtlasPackGetRect() to better understand how this works.
im_font_atlas_rect_id_get_generation¶
def im_font_atlas_rect_id_get_generation(id_: ImFontAtlasRectId) -> intinline unsigned int ImFontAtlasRectId_GetGeneration(ImFontAtlasRectId id);(private API)
im_font_atlas_rect_id_make¶
def im_font_atlas_rect_id_make(index_idx: int, gen_idx: int) -> ImFontAtlasRectIdinline ImFontAtlasRectId ImFontAtlasRectId_Make(int index_idx, int gen_idx);(private API)
ImFontAtlasRectEntry (class)¶
Packed rectangle lookup entry (we need an indirection to allow removing/reordering rectangles)
User are returned ImFontAtlasRectId values which are meant to be persistent.
We handle this with an indirection. While Rects[] may be in theory shuffled, compacted etc., RectsIndex[] cannot it is keyed by ImFontAtlasRectId.
RectsIndex[] is used both as an index into Rects[] and an index into itself. This is basically a free-list. See ImFontAtlasBuildAllocRectIndexEntry() code.
Having this also makes it easier to e.g. sort rectangles during repack.
ImFontAtlasRectEntry.__init__¶
def __init__(self) -> NoneAuto-generated default constructor
ImFontAtlasPostProcessData (class)¶
Data available to potential texture post-processing functions
| Attribute | C++ | |
|---|---|---|
font_atlas: ImFontAtlas | ImFontAtlas* FontAtlas; | |
font: ImFont | ImFont* Font; | |
font_src: ImFontConfig | ImFontConfig* FontSrc; | |
font_baked: ImFontBaked | ImFontBaked* FontBaked; | |
glyph: ImFontGlyph | ImFontGlyph* Glyph; | |
pixels: Any | void* Pixels; | |
format: ImTextureFormat | ImTextureFormat Format; | |
pitch: int | int Pitch; | |
width: int | int Width; | |
height: int | int Height; |
ImFontAtlasPostProcessData.__init__¶
def __init__(self, format: Optional[ImTextureFormat] = None, pitch: int = int(), width: int = int(), height: int = int()) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If Format is None, then its default value will be: ImTextureFormat()
stbrp_context_opaque (class)¶
stbrp_context_opaque.__init__¶
def __init__(self) -> NoneAuto-generated default constructor
ImFontAtlasBuilder (class)¶
Internal storage for incrementally packing and building a ImFontAtlas
| Attribute | C++ | |
|---|---|---|
pack_context: stbrp_context_opaque | stbrp_context_opaque PackContext; | Actually ‘stbrp_context’ but we don’t want to define this in the header file. |
rects: ImVector_ImTextureRect | ImVector<ImTextureRect> Rects; | |
temp_buffer: ImVector_uchar | ImVector<uchar> TempBuffer; | Misc scratch buffer |
rects_index_free_list_start: int | int RectsIndexFreeListStart; | First unused entry |
rects_packed_count: int | int RectsPackedCount; | Number of packed rectangles. |
rects_packed_surface: int | int RectsPackedSurface; | Number of packed pixels. Used when compacting to heuristically find the ideal texture size. |
rects_discarded_count: int | int RectsDiscardedCount; | |
rects_discarded_surface: int | int RectsDiscardedSurface; | |
frame_count: int | int FrameCount; | Current frame count |
max_rect_size: ImVec2i | ImVec2i MaxRectSize; | Largest rectangle to pack (de-facto used as a “minimum texture size”) |
max_rect_bounds: ImVec2i | ImVec2i MaxRectBounds; | Bottom-right most used pixels |
lock_disable_resize: bool | bool LockDisableResize; | Disable resizing texture |
preloaded_all_glyphs_ranges: bool | bool PreloadedAllGlyphsRanges; | Set when missing ImGuiBackendFlags_RendererHasTextures features forces atlas to preload everything. |
baked_map: Storage | ImGuiStorage BakedMap; | BakedId --> ImFontBaked* |
baked_discarded_count: int | int BakedDiscardedCount; | |
pack_id_mouse_cursors: ImFontAtlasRectId | ImFontAtlasRectId PackIdMouseCursors; | White pixel + mouse cursors. Also happen to be fallback in case of packing failure. |
pack_id_lines_tex_data: ImFontAtlasRectId | ImFontAtlasRectId PackIdLinesTexData; |
im_font_atlas_texture_add¶
def im_font_atlas_texture_add(atlas: ImFontAtlas, w: int, h: int) -> ImTextureDataIMGUI_API ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h);im_font_atlas_texture_make_space¶
def im_font_atlas_texture_make_space(atlas: ImFontAtlas) -> NoneIMGUI_API void ImFontAtlasTextureMakeSpace(ImFontAtlas* atlas);im_font_atlas_texture_repack¶
def im_font_atlas_texture_repack(atlas: ImFontAtlas, w: int, h: int) -> NoneIMGUI_API void ImFontAtlasTextureRepack(ImFontAtlas* atlas, int w, int h);im_font_atlas_texture_grow¶
def im_font_atlas_texture_grow(atlas: ImFontAtlas, old_w: int = -1, old_h: int = -1) -> NoneIMGUI_API void ImFontAtlasTextureGrow(ImFontAtlas* atlas, int old_w = -1, int old_h = -1);im_font_atlas_texture_compact¶
def im_font_atlas_texture_compact(atlas: ImFontAtlas) -> NoneIMGUI_API void ImFontAtlasTextureCompact(ImFontAtlas* atlas);im_font_atlas_texture_get_size_estimate¶
def im_font_atlas_texture_get_size_estimate(atlas: ImFontAtlas) -> ImVec2iIMGUI_API ImVec2i ImFontAtlasTextureGetSizeEstimate(ImFontAtlas* atlas);im_font_atlas_font_source_init¶
def im_font_atlas_font_source_init(atlas: ImFontAtlas, src: ImFontConfig) -> boolIMGUI_API bool ImFontAtlasFontSourceInit(ImFontAtlas* atlas, ImFontConfig* src);im_font_atlas_font_source_add_to_font¶
def im_font_atlas_font_source_add_to_font(atlas: ImFontAtlas, font: ImFont, src: ImFontConfig) -> NoneIMGUI_API void ImFontAtlasFontSourceAddToFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* src);im_font_atlas_font_destroy_source_data¶
def im_font_atlas_font_destroy_source_data(atlas: ImFontAtlas, src: ImFontConfig) -> NoneIMGUI_API void ImFontAtlasFontDestroySourceData(ImFontAtlas* atlas, ImFontConfig* src);im_font_atlas_font_init_output¶
def im_font_atlas_font_init_output(atlas: ImFontAtlas, font: ImFont) -> boolIMGUI_API bool ImFontAtlasFontInitOutput(ImFontAtlas* atlas, ImFont* font);Using FontDestroyOutput/FontInitOutput sequence useful notably if font loader params have changed
im_font_atlas_font_destroy_output¶
def im_font_atlas_font_destroy_output(atlas: ImFontAtlas, font: ImFont) -> NoneIMGUI_API void ImFontAtlasFontDestroyOutput(ImFontAtlas* atlas, ImFont* font);im_font_atlas_font_rebuild_output¶
def im_font_atlas_font_rebuild_output(atlas: ImFontAtlas, font: ImFont) -> NoneIMGUI_API void ImFontAtlasFontRebuildOutput(ImFontAtlas* atlas, ImFont* font);im_font_atlas_font_discard_bakes¶
def im_font_atlas_font_discard_bakes(atlas: ImFontAtlas, font: ImFont, unused_frames: int) -> NoneIMGUI_API void ImFontAtlasFontDiscardBakes(ImFontAtlas* atlas, ImFont* font, int unused_frames);im_font_atlas_baked_get_id¶
def im_font_atlas_baked_get_id(font_id: ID, baked_size: float, rasterizer_density: float) -> IDIMGUI_API ImGuiID ImFontAtlasBakedGetId(ImGuiID font_id, float baked_size, float rasterizer_density);im_font_atlas_baked_get_or_add¶
def im_font_atlas_baked_get_or_add(atlas: ImFontAtlas, font: ImFont, font_size: float, font_rasterizer_density: float) -> ImFontBakedIMGUI_API ImFontBaked* ImFontAtlasBakedGetOrAdd(ImFontAtlas* atlas, ImFont* font, float font_size, float font_rasterizer_density);im_font_atlas_baked_get_closest_match¶
def im_font_atlas_baked_get_closest_match(atlas: ImFontAtlas, font: ImFont, font_size: float, font_rasterizer_density: float) -> ImFontBakedIMGUI_API ImFontBaked* ImFontAtlasBakedGetClosestMatch(ImFontAtlas* atlas, ImFont* font, float font_size, float font_rasterizer_density);im_font_atlas_baked_add¶
def im_font_atlas_baked_add(atlas: ImFontAtlas, font: ImFont, font_size: float, font_rasterizer_density: float, baked_id: ID) -> ImFontBakedIMGUI_API ImFontBaked* ImFontAtlasBakedAdd(ImFontAtlas* atlas, ImFont* font, float font_size, float font_rasterizer_density, ImGuiID baked_id);im_font_atlas_baked_discard¶
def im_font_atlas_baked_discard(atlas: ImFontAtlas, font: ImFont, baked: ImFontBaked) -> NoneIMGUI_API void ImFontAtlasBakedDiscard(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked);im_font_atlas_baked_add_font_glyph¶
def im_font_atlas_baked_add_font_glyph(atlas: ImFontAtlas, baked: ImFontBaked, src: ImFontConfig, in_glyph: ImFontGlyph) -> ImFontGlyphIMGUI_API ImFontGlyph* ImFontAtlasBakedAddFontGlyph(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, const ImFontGlyph* in_glyph);im_font_atlas_baked_add_font_glyph_advanced_x¶
def im_font_atlas_baked_add_font_glyph_advanced_x(atlas: ImFontAtlas, baked: ImFontBaked, src: ImFontConfig, codepoint: ImWchar, advance_x: float) -> NoneIMGUI_API void ImFontAtlasBakedAddFontGlyphAdvancedX(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, ImWchar codepoint, float advance_x);im_font_atlas_baked_discard_font_glyph¶
def im_font_atlas_baked_discard_font_glyph(atlas: ImFontAtlas, font: ImFont, baked: ImFontBaked, glyph: ImFontGlyph) -> NoneIMGUI_API void ImFontAtlasBakedDiscardFontGlyph(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked, ImFontGlyph* glyph);im_font_atlas_baked_set_font_glyph_bitmap¶
def im_font_atlas_baked_set_font_glyph_bitmap(atlas: ImFontAtlas, baked: ImFontBaked, src: ImFontConfig, glyph: ImFontGlyph, r: ImTextureRect, src_pixels: uchar, src_fmt: ImTextureFormat, src_pitch: int) -> NoneIMGUI_API void ImFontAtlasBakedSetFontGlyphBitmap(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, ImFontGlyph* glyph, ImTextureRect* r, const uchar* src_pixels, ImTextureFormat src_fmt, int src_pitch);im_font_atlas_pack_init¶
def im_font_atlas_pack_init(atlas: ImFontAtlas) -> NoneIMGUI_API void ImFontAtlasPackInit(ImFontAtlas* atlas);im_font_atlas_pack_add_rect¶
def im_font_atlas_pack_add_rect(atlas: ImFontAtlas, w: int, h: int, overwrite_entry: Optional[ImFontAtlasRectEntry] = None) -> ImFontAtlasRectIdIMGUI_API ImFontAtlasRectId ImFontAtlasPackAddRect(ImFontAtlas* atlas, int w, int h, ImFontAtlasRectEntry* overwrite_entry = NULL);im_font_atlas_pack_get_rect¶
def im_font_atlas_pack_get_rect(atlas: ImFontAtlas, id_: ImFontAtlasRectId) -> ImTextureRectIMGUI_API ImTextureRect* ImFontAtlasPackGetRect(ImFontAtlas* atlas, ImFontAtlasRectId id);im_font_atlas_pack_get_rect_safe¶
def im_font_atlas_pack_get_rect_safe(atlas: ImFontAtlas, id_: ImFontAtlasRectId) -> ImTextureRectIMGUI_API ImTextureRect* ImFontAtlasPackGetRectSafe(ImFontAtlas* atlas, ImFontAtlasRectId id);im_font_atlas_pack_discard_rect¶
def im_font_atlas_pack_discard_rect(atlas: ImFontAtlas, id_: ImFontAtlasRectId) -> NoneIMGUI_API void ImFontAtlasPackDiscardRect(ImFontAtlas* atlas, ImFontAtlasRectId id);im_font_atlas_update_new_frame¶
def im_font_atlas_update_new_frame(atlas: ImFontAtlas, frame_count: int, renderer_has_textures: bool) -> NoneIMGUI_API void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count, bool renderer_has_textures);im_font_atlas_add_draw_list_shared_data¶
def im_font_atlas_add_draw_list_shared_data(atlas: ImFontAtlas, data: ImDrawListSharedData) -> NoneIMGUI_API void ImFontAtlasAddDrawListSharedData(ImFontAtlas* atlas, ImDrawListSharedData* data);im_font_atlas_remove_draw_list_shared_data¶
def im_font_atlas_remove_draw_list_shared_data(atlas: ImFontAtlas, data: ImDrawListSharedData) -> NoneIMGUI_API void ImFontAtlasRemoveDrawListSharedData(ImFontAtlas* atlas, ImDrawListSharedData* data);im_font_atlas_update_draw_lists_textures¶
def im_font_atlas_update_draw_lists_textures(atlas: ImFontAtlas, old_tex: ImTextureRef, new_tex: ImTextureRef) -> NoneIMGUI_API void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex, ImTextureRef new_tex);im_font_atlas_update_draw_lists_shared_data¶
def im_font_atlas_update_draw_lists_shared_data(atlas: ImFontAtlas) -> NoneIMGUI_API void ImFontAtlasUpdateDrawListsSharedData(ImFontAtlas* atlas);im_font_atlas_texture_block_convert¶
def im_font_atlas_texture_block_convert(src_pixels: uchar, src_fmt: ImTextureFormat, src_pitch: int, dst_pixels: uchar, dst_fmt: ImTextureFormat, dst_pitch: int, w: int, h: int) -> NoneIMGUI_API void ImFontAtlasTextureBlockConvert(const uchar* src_pixels, ImTextureFormat src_fmt, int src_pitch, uchar* dst_pixels, ImTextureFormat dst_fmt, int dst_pitch, int w, int h);im_font_atlas_texture_block_post_process¶
def im_font_atlas_texture_block_post_process(data: ImFontAtlasPostProcessData) -> NoneIMGUI_API void ImFontAtlasTextureBlockPostProcess(ImFontAtlasPostProcessData* data);im_font_atlas_texture_block_post_process_multiply¶
def im_font_atlas_texture_block_post_process_multiply(data: ImFontAtlasPostProcessData, multiply_factor: float) -> NoneIMGUI_API void ImFontAtlasTextureBlockPostProcessMultiply(ImFontAtlasPostProcessData* data, float multiply_factor);im_font_atlas_texture_block_fill¶
def im_font_atlas_texture_block_fill(dst_tex: ImTextureData, dst_x: int, dst_y: int, w: int, h: int, col: ImU32) -> NoneIMGUI_API void ImFontAtlasTextureBlockFill(ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h, ImU32 col);im_font_atlas_texture_block_copy¶
def im_font_atlas_texture_block_copy(src_tex: ImTextureData, src_x: int, src_y: int, dst_tex: ImTextureData, dst_x: int, dst_y: int, w: int, h: int) -> NoneIMGUI_API void ImFontAtlasTextureBlockCopy(ImTextureData* src_tex, int src_x, int src_y, ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h);im_font_atlas_texture_block_queue_upload¶
def im_font_atlas_texture_block_queue_upload(atlas: ImFontAtlas, tex: ImTextureData, x: int, y: int, w: int, h: int) -> NoneIMGUI_API void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex, int x, int y, int w, int h);im_texture_data_update_new_frame¶
def im_texture_data_update_new_frame(tex: ImTextureData) -> boolIMGUI_API bool ImTextureDataUpdateNewFrame(ImTextureData* tex);im_texture_data_queue_upload¶
def im_texture_data_queue_upload(tex: ImTextureData, x: int, y: int, w: int, h: int) -> NoneIMGUI_API void ImTextureDataQueueUpload(ImTextureData* tex, int x, int y, int w, int h);im_texture_data_get_format_bytes_per_pixel¶
def im_texture_data_get_format_bytes_per_pixel(format: ImTextureFormat) -> intIMGUI_API int ImTextureDataGetFormatBytesPerPixel(ImTextureFormat format);im_texture_data_get_status_name¶
def im_texture_data_get_status_name(status: ImTextureStatus) -> strIMGUI_API const char* ImTextureDataGetStatusName(ImTextureStatus status);im_texture_data_get_format_name¶
def im_texture_data_get_format_name(format: ImTextureFormat) -> strIMGUI_API const char* ImTextureDataGetFormatName(ImTextureFormat format);im_font_atlas_get_mouse_cursor_tex_data¶
def im_font_atlas_get_mouse_cursor_tex_data(atlas: ImFontAtlas, cursor_type: MouseCursor, out_offset: ImVec2Like, out_size: ImVec2Like, out_uv_border: ImVec2Like, out_uv_fill: ImVec2Like) -> boolIMGUI_API bool ImFontAtlasGetMouseCursorTexData(ImFontAtlas* atlas, ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]);Test Engine specific hooks¶
Docking: Internal Types¶
ImGuiDockRequestType
ImGuiDockRequest
ImGuiDockPreviewData
ImGuiDockNodeSettings
ImGuiDockContext
DockRequestType (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
none | 0 | ImGuiDockRequestType_None = 0 | |
dock | 1 | ImGuiDockRequestType_Dock | |
undock | 2 | ImGuiDockRequestType_Undock | |
split | 3 | ImGuiDockRequestType_Split | Split is the same as Dock but without a DockPayload |
DockRequest (class)¶
| Attribute | C++ | |
|---|---|---|
type: DockRequestType | ImGuiDockRequestType Type; | |
dock_target_window: Window | ImGuiWindow* DockTargetWindow; | Destination/Target Window to dock into (may be a loose window or a DockNode, might be None in which case DockTargetNode cannot be None) |
dock_target_node: DockNode | ImGuiDockNode* DockTargetNode; | Destination/Target Node to dock into |
dock_payload: Window | ImGuiWindow* DockPayload; | Source/Payload window to dock (may be a loose window or a DockNode), [Optional] |
dock_split_dir: Dir | ImGuiDir DockSplitDir; | |
dock_split_ratio: float | float DockSplitRatio; | |
dock_split_outer: bool | bool DockSplitOuter; | |
undock_target_window: Window | ImGuiWindow* UndockTargetWindow; | |
undock_target_node: DockNode | ImGuiDockNode* UndockTargetNode; |
DockRequest.__init__¶
def __init__(self) -> NoneImGuiDockRequest();DockPreviewData (class)¶
| Attribute | C++ | |
|---|---|---|
future_node: DockNode | ImGuiDockNode FutureNode; | |
is_drop_allowed: bool | bool IsDropAllowed; | |
is_center_available: bool | bool IsCenterAvailable; | |
is_sides_available: bool | bool IsSidesAvailable; | Hold your breath, grammar freaks.. |
is_split_dir_explicit: bool | bool IsSplitDirExplicit; | Set when hovered the drop rect (vs. implicit SplitDir==None when hovered the window) |
split_node: DockNode | ImGuiDockNode* SplitNode; | |
split_dir: Dir | ImGuiDir SplitDir; | |
split_ratio: float | float SplitRatio; |
DockPreviewData.__init__¶
def __init__(self) -> NoneImGuiDockPreviewData() : FutureNode(0);DockNodeSettings (class)¶
Persistent Settings data, stored contiguously in SettingsNodes (sizeof() ~32 bytes)
| Attribute | C++ | |
|---|---|---|
id_: ID | ImGuiID ID; | |
parent_node_id: ID | ImGuiID ParentNodeId; | |
parent_window_id: ID | ImGuiID ParentWindowId; | |
selected_tab_id: ID | ImGuiID SelectedTabId; | |
split_axis: int | signed char SplitAxis; | |
depth: int | char Depth; | |
flags: DockNodeFlags | ImGuiDockNodeFlags Flags; | NB: We save individual flags one by one in ascii format (ImGuiDockNodeFlags_SavedFlagsMask_) |
pos: ImVec2ih | ImVec2ih Pos; | |
size: ImVec2ih | ImVec2ih Size; | |
size_ref: ImVec2ih | ImVec2ih SizeRef; |
DockNodeSettings.__init__¶
def __init__(self) -> NoneImGuiDockNodeSettings();Submodule im_stb¶
im_stb (class)¶
get_current_window¶
def get_current_window() -> Windowimgui_internal_pywrappers.h¶
dock_builder_split_node_py¶
def dock_builder_split_node_py(node_id: ID, split_dir: Dir, size_ratio_for_node_at_dir: float) -> Tuple[ID, ID, ID]IMGUI_API std::tuple<ImGuiID, ImGuiID, ImGuiID> DockBuilderSplitNode_Py(ImGuiID node_id, ImGuiDir split_dir, float size_ratio_for_node_at_dir);DockBuilderSplitNode_Py() create 2 child nodes within 1 node. The initial node becomes a parent node.
This version is an adaptation for the python bindings (the C++ version uses two output parameters for the ID of the child nodes, this version returns a tuple)
DockBuilderSplitNodeResult (class)¶
Result of DockBuilderSplitNode() (python version)
| Attribute | C++ | |
|---|---|---|
id_at_dir: ID | ImGuiID id_at_dir; | |
id_at_opposite_dir: ID | ImGuiID id_at_opposite_dir; |
DockBuilderSplitNodeResult.__init__¶
def __init__(self, id_at_dir: ID = ID(), id_at_opposite_dir: ID = ID()) -> NoneAuto-generated default constructor with named params
dock_builder_split_node¶
def dock_builder_split_node(node_id: ID, split_dir: Dir, size_ratio_for_node_at_dir: float) -> DockBuilderSplitNodeResultIMGUI_API DockBuilderSplitNodeResult DockBuilderSplitNode(ImGuiID node_id, ImGuiDir split_dir, float size_ratio_for_node_at_dir);DockBuilderSplitNode() creates 2 child nodes within 1 node. The initial node becomes a parent node. (python version: the two output parameters of the C++ version are returned in a struct)
input_text_ex¶
def input_text_ex(label: str, hint: str, s: str, size_arg: ImVec2Like, flags: InputTextFlags, callback: InputTextCallback = None) -> Tuple[bool, str]IMGUI_API bool InputTextEx(const char* label, const char* hint, std::string* s, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL);Python versions of InputTextEx() and TempInputText(): the text buffer is a string (returned modified)
temp_input_text¶
def temp_input_text(bb: ImRect, id_: ID, label: str, s: str, flags: InputTextFlags) -> Tuple[bool, str]IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, std::string* s, ImGuiInputTextFlags flags);}