|
|
@@ -1,10 +1,11 @@
|
|
|
-// dear imgui, v1.90.9 WIP
|
|
|
+// dear imgui, v1.91.1 WIP
|
|
|
// (headers)
|
|
|
|
|
|
// Help:
|
|
|
// - See links below.
|
|
|
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
|
|
|
// - Read top of imgui.cpp for more details, links and comments.
|
|
|
+// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
|
|
|
|
|
|
// Resources:
|
|
|
// - FAQ ........................ https://dearimgui.com/faq (in repository as docs/FAQ.md)
|
|
|
@@ -27,8 +28,8 @@
|
|
|
|
|
|
// Library Version
|
|
|
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
|
|
-#define IMGUI_VERSION "1.90.9 WIP"
|
|
|
-#define IMGUI_VERSION_NUM 19081
|
|
|
+#define IMGUI_VERSION "1.91.1 WIP"
|
|
|
+#define IMGUI_VERSION_NUM 19104
|
|
|
#define IMGUI_HAS_TABLE
|
|
|
|
|
|
/*
|
|
|
@@ -39,15 +40,16 @@ Index of this file:
|
|
|
// [SECTION] Dear ImGui end-user API functions
|
|
|
// [SECTION] Flags & Enumerations
|
|
|
// [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs)
|
|
|
-// [SECTION] Helpers: Memory allocations macros, ImVector<>
|
|
|
+// [SECTION] Helpers: Debug log, Memory allocations macros, ImVector<>
|
|
|
// [SECTION] ImGuiStyle
|
|
|
// [SECTION] ImGuiIO
|
|
|
// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload)
|
|
|
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor)
|
|
|
+// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiMultiSelectIO, ImGuiSelectionRequest, ImGuiSelectionBasicStorage, ImGuiSelectionExternalStorage)
|
|
|
// [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData)
|
|
|
// [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
|
|
|
// [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport)
|
|
|
-// [SECTION] Platform Dependent Interfaces (ImGuiPlatformImeData)
|
|
|
+// [SECTION] ImGuiPlatformIO + other Platform Dependent Interfaces (ImGuiPlatformImeData)
|
|
|
// [SECTION] Obsolete functions and types
|
|
|
|
|
|
*/
|
|
|
@@ -170,13 +172,18 @@ struct ImFontGlyph; // A single font glyph (code point + coordin
|
|
|
struct ImFontGlyphRangesBuilder; // Helper to build glyph ranges from text/string data
|
|
|
struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using)
|
|
|
struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h)
|
|
|
-struct ImGuiIO; // Main configuration and I/O between your application and ImGui
|
|
|
+struct ImGuiIO; // Main configuration and I/O between your application and ImGui (also see: ImGuiPlatformIO)
|
|
|
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
|
|
|
struct ImGuiKeyData; // Storage for ImGuiIO and IsKeyDown(), IsKeyPressed() etc functions.
|
|
|
struct ImGuiListClipper; // Helper to manually clip large list of items
|
|
|
+struct ImGuiMultiSelectIO; // Structure to interact with a BeginMultiSelect()/EndMultiSelect() block
|
|
|
struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame
|
|
|
struct ImGuiPayload; // User data payload for drag and drop operations
|
|
|
-struct ImGuiPlatformImeData; // Platform IME data for io.SetPlatformImeDataFn() function.
|
|
|
+struct ImGuiPlatformIO; // Interface between platform/renderer backends and ImGui (e.g. Clipboard, IME hooks). Extends ImGuiIO. In docking branch, this gets extended to support multi-viewports.
|
|
|
+struct ImGuiPlatformImeData; // Platform IME data for io.PlatformSetImeDataFn() function.
|
|
|
+struct ImGuiSelectionBasicStorage; // Optional helper to store multi-selection state + apply multi-selection requests.
|
|
|
+struct ImGuiSelectionExternalStorage;//Optional helper to apply multi-selection requests to existing randomly accessible storage.
|
|
|
+struct ImGuiSelectionRequest; // A selection request (stored in ImGuiMultiSelectIO)
|
|
|
struct ImGuiSizeCallbackData; // Callback data when using SetNextWindowSizeConstraints() (rare/advanced use)
|
|
|
struct ImGuiStorage; // Helper for key->value storage (container sorted by key)
|
|
|
struct ImGuiStoragePair; // Helper for key->value storage (pair)
|
|
|
@@ -224,8 +231,10 @@ typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: f
|
|
|
typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
|
|
|
typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for Shortcut(), SetNextItemShortcut()
|
|
|
typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline()
|
|
|
+typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), shared by all items
|
|
|
typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for IsKeyChordPressed(), Shortcut() etc. an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values.
|
|
|
typedef int ImGuiPopupFlags; // -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen()
|
|
|
+typedef int ImGuiMultiSelectFlags; // -> enum ImGuiMultiSelectFlags_// Flags: for BeginMultiSelect()
|
|
|
typedef int ImGuiSelectableFlags; // -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
|
|
|
typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
|
|
|
typedef int ImGuiTabBarFlags; // -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
|
|
|
@@ -261,6 +270,11 @@ typedef ImWchar32 ImWchar;
|
|
|
typedef ImWchar16 ImWchar;
|
|
|
#endif
|
|
|
|
|
|
+// Multi-Selection item index or identifier when using BeginMultiSelect()
|
|
|
+// - Used by SetNextItemSelectionUserData() + and inside ImGuiMultiSelectIO structure.
|
|
|
+// - Most users are likely to use this store an item INDEX but this may be used to store a POINTER/ID as well. Read comments near ImGuiMultiSelectIO for details.
|
|
|
+typedef ImS64 ImGuiSelectionUserData;
|
|
|
+
|
|
|
// Callback and functions types
|
|
|
typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData* data); // Callback function for ImGui::InputText()
|
|
|
typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); // Callback function for ImGui::SetNextWindowSizeConstraints()
|
|
|
@@ -268,8 +282,8 @@ typedef void* (*ImGuiMemAllocFunc)(size_t sz, void* user_data);
|
|
|
typedef void (*ImGuiMemFreeFunc)(void* ptr, void* user_data); // Function signature for ImGui::SetAllocatorFunctions()
|
|
|
|
|
|
// ImVec2: 2D vector used to store positions, sizes etc. [Compile-time configurable type]
|
|
|
-// This is a frequently used type in the API. Consider using IM_VEC2_CLASS_EXTRA to create implicit cast from/to our preferred type.
|
|
|
-// Add '#define IMGUI_DEFINE_MATH_OPERATORS' in your imconfig.h file to benefit from courtesy maths operators for those types.
|
|
|
+// - This is a frequently used type in the API. Consider using IM_VEC2_CLASS_EXTRA to create implicit cast from/to our preferred type.
|
|
|
+// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
|
|
|
IM_MSVC_RUNTIME_CHECKS_OFF
|
|
|
struct ImVec2
|
|
|
{
|
|
|
@@ -312,7 +326,8 @@ namespace ImGui
|
|
|
IMGUI_API void SetCurrentContext(ImGuiContext* ctx);
|
|
|
|
|
|
// Main
|
|
|
- IMGUI_API ImGuiIO& GetIO(); // access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
|
|
|
+ IMGUI_API ImGuiIO& GetIO(); // access the ImGuiIO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
|
|
|
+ IMGUI_API ImGuiPlatformIO& GetPlatformIO(); // access the ImGuiPlatformIO structure (mostly hooks/functions to connect to platform/renderer and OS Clipboard, IME etc.)
|
|
|
IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleColor(), PushStyleVar() to modify style mid-frame!
|
|
|
IMGUI_API void NewFrame(); // start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
|
|
|
IMGUI_API void EndFrame(); // ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!
|
|
|
@@ -354,10 +369,10 @@ namespace ImGui
|
|
|
// Child Windows
|
|
|
// - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
|
|
|
// - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false".
|
|
|
- // This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Border == true.
|
|
|
+ // This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Borders == true.
|
|
|
// Consider updating your old code:
|
|
|
// BeginChild("Name", size, false) -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None);
|
|
|
- // BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Border);
|
|
|
+ // BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Borders);
|
|
|
// - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)):
|
|
|
// == 0.0f: use remaining parent window size for this axis.
|
|
|
// > 0.0f: use specified size for this axis.
|
|
|
@@ -380,10 +395,10 @@ namespace ImGui
|
|
|
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0); // is current window focused? or its root/child, depending on flags. see flags for options.
|
|
|
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
|
|
|
IMGUI_API ImDrawList* GetWindowDrawList(); // get draw list associated to the current window, to append your own drawing primitives
|
|
|
- IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (note: it is unlikely you need to use this. Consider using current layout pos instead, GetCursorScreenPos())
|
|
|
- IMGUI_API ImVec2 GetWindowSize(); // get current window size (note: it is unlikely you need to use this. Consider using GetCursorScreenPos() and e.g. GetContentRegionAvail() instead)
|
|
|
- IMGUI_API float GetWindowWidth(); // get current window width (shortcut for GetWindowSize().x)
|
|
|
- IMGUI_API float GetWindowHeight(); // get current window height (shortcut for GetWindowSize().y)
|
|
|
+ IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
|
|
|
+ IMGUI_API ImVec2 GetWindowSize(); // get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
|
|
|
+ IMGUI_API float GetWindowWidth(); // get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().x.
|
|
|
+ IMGUI_API float GetWindowHeight(); // get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().y.
|
|
|
|
|
|
// Window manipulation
|
|
|
// - Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin).
|
|
|
@@ -405,14 +420,6 @@ namespace ImGui
|
|
|
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state
|
|
|
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / top-most. use NULL to remove focus.
|
|
|
|
|
|
- // Content region
|
|
|
- // - Retrieve available space from a given point. GetContentRegionAvail() is frequently useful.
|
|
|
- // - Those functions are bound to be redesigned (they are confusing, incomplete and the Min/Max return values are in local window coordinates which increases confusion)
|
|
|
- IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
|
|
|
- IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
|
|
|
- IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates
|
|
|
- IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates
|
|
|
-
|
|
|
// Windows Scrolling
|
|
|
// - Any change of Scroll will be applied at the beginning of next frame in the first call to Begin().
|
|
|
// - You may instead use SetNextWindowScroll() prior to calling Begin() to avoid this delay, as an alternative to using SetScrollX()/SetScrollY().
|
|
|
@@ -433,13 +440,13 @@ namespace ImGui
|
|
|
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col); // modify a style color. always use this if you modify the style after NewFrame().
|
|
|
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col);
|
|
|
IMGUI_API void PopStyleColor(int count = 1);
|
|
|
- IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame().
|
|
|
- IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. always use this if you modify the style after NewFrame().
|
|
|
+ IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame()!
|
|
|
+ IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. "
|
|
|
+ IMGUI_API void PushStyleVarX(ImGuiStyleVar idx, float val_x); // modify X component of a style ImVec2 variable. "
|
|
|
+ IMGUI_API void PushStyleVarY(ImGuiStyleVar idx, float val_y); // modify Y component of a style ImVec2 variable. "
|
|
|
IMGUI_API void PopStyleVar(int count = 1);
|
|
|
- IMGUI_API void PushTabStop(bool tab_stop); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
|
|
|
- IMGUI_API void PopTabStop();
|
|
|
- IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
|
|
|
- IMGUI_API void PopButtonRepeat();
|
|
|
+ IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); // modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true)
|
|
|
+ IMGUI_API void PopItemFlag();
|
|
|
|
|
|
// Parameters stacks (current window)
|
|
|
IMGUI_API void PushItemWidth(float item_width); // push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
|
|
|
@@ -463,19 +470,22 @@ namespace ImGui
|
|
|
// - By "cursor" we mean the current output position.
|
|
|
// - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
|
|
|
// - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget.
|
|
|
+ // - YOU CAN DO 99% OF WHAT YOU NEED WITH ONLY GetCursorScreenPos() and GetContentRegionAvail().
|
|
|
// - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API:
|
|
|
// - Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward.
|
|
|
- // - Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos()
|
|
|
- // - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates.
|
|
|
- IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute coordinates (prefer using this, also more useful to work with ImDrawList API).
|
|
|
- IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute coordinates
|
|
|
- IMGUI_API ImVec2 GetCursorPos(); // [window-local] cursor position in window coordinates (relative to window position)
|
|
|
+ // - Window-local coordinates: SameLine(offset), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), PushTextWrapPos()
|
|
|
+ // - Window-local coordinates: GetContentRegionMax(), GetWindowContentRegionMin(), GetWindowContentRegionMax() --> all obsoleted. YOU DON'T NEED THEM.
|
|
|
+ // - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates. Try not to use it.
|
|
|
+ IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than GetCursorPos(), also more useful to work with ImDrawList API).
|
|
|
+ IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND.
|
|
|
+ IMGUI_API ImVec2 GetContentRegionAvail(); // available space from current position. THIS IS YOUR BEST FRIEND.
|
|
|
+ IMGUI_API ImVec2 GetCursorPos(); // [window-local] cursor position in window-local coordinates. This is not your best friend.
|
|
|
IMGUI_API float GetCursorPosX(); // [window-local] "
|
|
|
IMGUI_API float GetCursorPosY(); // [window-local] "
|
|
|
IMGUI_API void SetCursorPos(const ImVec2& local_pos); // [window-local] "
|
|
|
IMGUI_API void SetCursorPosX(float local_x); // [window-local] "
|
|
|
IMGUI_API void SetCursorPosY(float local_y); // [window-local] "
|
|
|
- IMGUI_API ImVec2 GetCursorStartPos(); // [window-local] initial cursor position, in window coordinates
|
|
|
+ IMGUI_API ImVec2 GetCursorStartPos(); // [window-local] initial cursor position, in window-local coordinates. Call GetCursorScreenPos() after Begin() to get the absolute coordinates version.
|
|
|
|
|
|
// Other layout functions
|
|
|
IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
|
|
|
@@ -512,6 +522,7 @@ namespace ImGui
|
|
|
IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself
|
|
|
IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end);
|
|
|
IMGUI_API ImGuiID GetID(const void* ptr_id);
|
|
|
+ IMGUI_API ImGuiID GetID(int int_id);
|
|
|
|
|
|
// Widgets: Text
|
|
|
IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
|
|
|
@@ -543,6 +554,8 @@ namespace ImGui
|
|
|
IMGUI_API bool RadioButton(const char* label, int* v, int v_button); // shortcut to handle the above pattern when value is an integer
|
|
|
IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-FLT_MIN, 0), const char* overlay = NULL);
|
|
|
IMGUI_API void Bullet(); // draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
|
|
|
+ IMGUI_API bool TextLink(const char* label); // hyperlink text button, return true when clicked
|
|
|
+ IMGUI_API void TextLinkOpenURL(const char* label, const char* url = NULL); // hyperlink text button, automatically open file/url when clicked
|
|
|
|
|
|
// Widgets: Images
|
|
|
// - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
|
|
|
@@ -653,6 +666,7 @@ namespace ImGui
|
|
|
IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
|
|
|
IMGUI_API bool CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFlags flags = 0); // when 'p_visible != NULL': if '*p_visible==true' display an additional small close button on upper right of the header which will set the bool to false when clicked, if '*p_visible==false' don't display the header.
|
|
|
IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state.
|
|
|
+ IMGUI_API void SetNextItemStorageID(ImGuiID storage_id); // set id to use for open/close storage (default to same as item id).
|
|
|
|
|
|
// Widgets: Selectables
|
|
|
// - A selectable highlights when hovered, and can display another color when selected.
|
|
|
@@ -660,6 +674,18 @@ namespace ImGui
|
|
|
IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
|
|
|
IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper.
|
|
|
|
|
|
+ // Multi-selection system for Selectable(), Checkbox(), TreeNode() functions [BETA]
|
|
|
+ // - This enables standard multi-selection/range-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc.) in a way that also allow a clipper to be used.
|
|
|
+ // - ImGuiSelectionUserData is often used to store your item index within the current view (but may store something else).
|
|
|
+ // - Read comments near ImGuiMultiSelectIO for instructions/details and see 'Demo->Widgets->Selection State & Multi-Select' for demo.
|
|
|
+ // - TreeNode() is technically supported but... using this correctly is more complicated. You need some sort of linear/random access to your tree,
|
|
|
+ // which is suited to advanced trees setups already implementing filters and clipper. We will work simplifying the current demo.
|
|
|
+ // - 'selection_size' and 'items_count' parameters are optional and used by a few features. If they are costly for you to compute, you may avoid them.
|
|
|
+ IMGUI_API ImGuiMultiSelectIO* BeginMultiSelect(ImGuiMultiSelectFlags flags, int selection_size = -1, int items_count = -1);
|
|
|
+ IMGUI_API ImGuiMultiSelectIO* EndMultiSelect();
|
|
|
+ IMGUI_API void SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data);
|
|
|
+ IMGUI_API bool IsItemToggledSelection(); // Was the last item selection state toggled? Useful if you need the per-item information _before_ reaching EndMultiSelect(). We only returns toggle _event_ in order to handle clipping correctly.
|
|
|
+
|
|
|
// Widgets: List Boxes
|
|
|
// - This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
|
|
|
// - You can submit contents and manage your selection state however you want it, by creating e.g. Selectable() or any other items.
|
|
|
@@ -779,7 +805,7 @@ namespace ImGui
|
|
|
// - TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row!
|
|
|
// - TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear!
|
|
|
// - 5. Call EndTable()
|
|
|
- IMGUI_API bool BeginTable(const char* str_id, int column, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f);
|
|
|
+ IMGUI_API bool BeginTable(const char* str_id, int columns, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f);
|
|
|
IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true!
|
|
|
IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f); // append into the first cell of a new row.
|
|
|
IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible.
|
|
|
@@ -812,11 +838,12 @@ namespace ImGui
|
|
|
IMGUI_API const char* TableGetColumnName(int column_n = -1); // return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
|
|
|
IMGUI_API ImGuiTableColumnFlags TableGetColumnFlags(int column_n = -1); // return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
|
|
|
IMGUI_API void TableSetColumnEnabled(int column_n, bool v);// change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)
|
|
|
+ IMGUI_API int TableGetHoveredColumn(); // return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead.
|
|
|
IMGUI_API void TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n = -1); // change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
|
|
|
|
|
|
// Legacy Columns API (prefer using Tables!)
|
|
|
// - You can also use SameLine(pos_x) to mimic simplified columns.
|
|
|
- IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true);
|
|
|
+ IMGUI_API void Columns(int count = 1, const char* id = NULL, bool borders = true);
|
|
|
IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished
|
|
|
IMGUI_API int GetColumnIndex(); // get current column index
|
|
|
IMGUI_API float GetColumnWidth(int column_index = -1); // get column width (in pixels). pass -1 to use current column
|
|
|
@@ -860,6 +887,7 @@ namespace ImGui
|
|
|
// Disabling [BETA API]
|
|
|
// - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors)
|
|
|
// - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
|
|
|
+ // - Tooltips windows by exception are opted out of disabling.
|
|
|
// - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it.
|
|
|
IMGUI_API void BeginDisabled(bool disabled = true);
|
|
|
IMGUI_API void EndDisabled();
|
|
|
@@ -958,6 +986,14 @@ namespace ImGui
|
|
|
IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0);
|
|
|
IMGUI_API void SetNextItemShortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0);
|
|
|
|
|
|
+ // Inputs Utilities: Key/Input Ownership [BETA]
|
|
|
+ // - One common use case would be to allow your items to disable standard inputs behaviors such
|
|
|
+ // as Tab or Alt key handling, Mouse Wheel scrolling, etc.
|
|
|
+ // e.g. Button(...); SetItemKeyOwner(ImGuiKey_MouseWheelY); to make hovering/activating a button disable wheel for scrolling.
|
|
|
+ // - Reminder ImGuiKey enum include access to mouse buttons and gamepad, so key ownership can apply to them.
|
|
|
+ // - Many related features are still in imgui_internal.h. For instance, most IsKeyXXX()/IsMouseXXX() functions have an owner-id-aware version.
|
|
|
+ IMGUI_API void SetItemKeyOwner(ImGuiKey key); // Set key owner to last item ID if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
|
|
|
+
|
|
|
// Inputs Utilities: Mouse specific
|
|
|
// - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
|
|
|
// - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle.
|
|
|
@@ -999,6 +1035,10 @@ namespace ImGui
|
|
|
IMGUI_API void DebugFlashStyleColor(ImGuiCol idx);
|
|
|
IMGUI_API void DebugStartItemPicker();
|
|
|
IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro.
|
|
|
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
|
|
+ IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1); // Call via IMGUI_DEBUG_LOG() for maximum stripping in caller code!
|
|
|
+ IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1);
|
|
|
+#endif
|
|
|
|
|
|
// Memory Allocators
|
|
|
// - Those functions are not reliant on the current context.
|
|
|
@@ -1044,7 +1084,6 @@ enum ImGuiWindowFlags_
|
|
|
ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
|
|
|
|
|
|
// [Internal]
|
|
|
- ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] On child window: share focus scope, allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows.
|
|
|
ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild()
|
|
|
ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip()
|
|
|
ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup()
|
|
|
@@ -1053,12 +1092,13 @@ enum ImGuiWindowFlags_
|
|
|
|
|
|
// Obsolete names
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
- ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 30, // Obsoleted in 1.90: Use ImGuiChildFlags_AlwaysUseWindowPadding in BeginChild() call.
|
|
|
+ ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 30, // Obsoleted in 1.90.0: Use ImGuiChildFlags_AlwaysUseWindowPadding in BeginChild() call.
|
|
|
+ ImGuiWindowFlags_NavFlattened = 1 << 31, // Obsoleted in 1.90.9: Use ImGuiChildFlags_NavFlattened in BeginChild() call.
|
|
|
#endif
|
|
|
};
|
|
|
|
|
|
// Flags for ImGui::BeginChild()
|
|
|
-// (Legacy: bit 0 must always correspond to ImGuiChildFlags_Border to be backward compatible with old API using 'bool border = false'.
|
|
|
+// (Legacy: bit 0 must always correspond to ImGuiChildFlags_Borders to be backward compatible with old API using 'bool border = false'.
|
|
|
// About using AutoResizeX/AutoResizeY flags:
|
|
|
// - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints").
|
|
|
// - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing.
|
|
|
@@ -1069,7 +1109,7 @@ enum ImGuiWindowFlags_
|
|
|
enum ImGuiChildFlags_
|
|
|
{
|
|
|
ImGuiChildFlags_None = 0,
|
|
|
- ImGuiChildFlags_Border = 1 << 0, // Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason)
|
|
|
+ ImGuiChildFlags_Borders = 1 << 0, // Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason)
|
|
|
ImGuiChildFlags_AlwaysUseWindowPadding = 1 << 1, // Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
|
|
|
ImGuiChildFlags_ResizeX = 1 << 2, // Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
|
|
|
ImGuiChildFlags_ResizeY = 1 << 3, // Allow resize from bottom border (layout direction). "
|
|
|
@@ -1077,6 +1117,24 @@ enum ImGuiChildFlags_
|
|
|
ImGuiChildFlags_AutoResizeY = 1 << 5, // Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above.
|
|
|
ImGuiChildFlags_AlwaysAutoResize = 1 << 6, // Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED.
|
|
|
ImGuiChildFlags_FrameStyle = 1 << 7, // Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.
|
|
|
+ ImGuiChildFlags_NavFlattened = 1 << 8, // [BETA] Share focus scope, allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows.
|
|
|
+
|
|
|
+ // Obsolete names
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
+ ImGuiChildFlags_Border = ImGuiChildFlags_Borders, // Renamed in 1.91.1 (August 2024) for consistency.
|
|
|
+#endif
|
|
|
+};
|
|
|
+
|
|
|
+// Flags for ImGui::PushItemFlag()
|
|
|
+// (Those are shared by all items)
|
|
|
+enum ImGuiItemFlags_
|
|
|
+{
|
|
|
+ ImGuiItemFlags_None = 0, // (Default)
|
|
|
+ ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav.
|
|
|
+ ImGuiItemFlags_NoNav = 1 << 1, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls).
|
|
|
+ ImGuiItemFlags_NoNavDefaultFocus = 1 << 2, // false // Disable item being a candidate for default focus (e.g. used by title bar items).
|
|
|
+ ImGuiItemFlags_ButtonRepeat = 1 << 3, // false // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held.
|
|
|
+ ImGuiItemFlags_AutoClosePopups = 1 << 4, // true // MenuItem()/Selectable() automatically close their parent popup window.
|
|
|
};
|
|
|
|
|
|
// Flags for ImGui::InputText()
|
|
|
@@ -1129,8 +1187,8 @@ enum ImGuiTreeNodeFlags_
|
|
|
ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
|
|
|
ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
|
|
|
ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, // Default node to be open
|
|
|
- ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Need double-click to open node
|
|
|
- ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
|
|
|
+ ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Open on double-click instead of simple click (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined.
|
|
|
+ ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Open when clicking on the arrow part (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined.
|
|
|
ImGuiTreeNodeFlags_Leaf = 1 << 8, // No collapsing, no arrow (use as a convenience for leaf nodes).
|
|
|
ImGuiTreeNodeFlags_Bullet = 1 << 9, // Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don't set the _Leaf flag!
|
|
|
ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding() before the node.
|
|
|
@@ -1176,14 +1234,16 @@ enum ImGuiPopupFlags_
|
|
|
enum ImGuiSelectableFlags_
|
|
|
{
|
|
|
ImGuiSelectableFlags_None = 0,
|
|
|
- ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this doesn't close parent popup window
|
|
|
+ ImGuiSelectableFlags_NoAutoClosePopups = 1 << 0, // Clicking this doesn't close parent popup window (overrides ImGuiItemFlags_AutoClosePopups)
|
|
|
ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Frame will span all columns of its container table (text will still fit in current column)
|
|
|
ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, // Generate press events on double clicks too
|
|
|
ImGuiSelectableFlags_Disabled = 1 << 3, // Cannot be selected, display grayed out text
|
|
|
ImGuiSelectableFlags_AllowOverlap = 1 << 4, // (WIP) Hit testing to allow subsequent widgets to overlap this one
|
|
|
+ ImGuiSelectableFlags_Highlight = 1 << 5, // Make the item be displayed as if it is hovered
|
|
|
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
- ImGuiSelectableFlags_AllowItemOverlap = ImGuiSelectableFlags_AllowOverlap, // Renamed in 1.89.7
|
|
|
+ ImGuiSelectableFlags_DontClosePopups = ImGuiSelectableFlags_NoAutoClosePopups, // Renamed in 1.91.0
|
|
|
+ ImGuiSelectableFlags_AllowItemOverlap = ImGuiSelectableFlags_AllowOverlap, // Renamed in 1.89.7
|
|
|
#endif
|
|
|
};
|
|
|
|
|
|
@@ -1212,8 +1272,9 @@ enum ImGuiTabBarFlags_
|
|
|
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
|
|
|
ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 4, // Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll)
|
|
|
ImGuiTabBarFlags_NoTooltip = 1 << 5, // Disable tooltips when hovering a tab
|
|
|
- ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit
|
|
|
- ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit
|
|
|
+ ImGuiTabBarFlags_DrawSelectedOverline = 1 << 6, // Draw selected overline markers over selected tab
|
|
|
+ ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 7, // Resize tabs when they don't fit
|
|
|
+ ImGuiTabBarFlags_FittingPolicyScroll = 1 << 8, // Add scroll buttons when tabs don't fit
|
|
|
ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll,
|
|
|
ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown,
|
|
|
};
|
|
|
@@ -1295,12 +1356,18 @@ enum ImGuiDragDropFlags_
|
|
|
ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
|
|
|
ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
|
|
|
ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
|
|
|
- ImGuiDragDropFlags_SourceAutoExpirePayload = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged)
|
|
|
+ ImGuiDragDropFlags_PayloadAutoExpire = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged)
|
|
|
+ ImGuiDragDropFlags_PayloadNoCrossContext = 1 << 6, // Hint to specify that the payload may not be copied outside current dear imgui context.
|
|
|
+ ImGuiDragDropFlags_PayloadNoCrossProcess = 1 << 7, // Hint to specify that the payload may not be copied outside current process.
|
|
|
// AcceptDragDropPayload() flags
|
|
|
ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
|
|
|
ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target.
|
|
|
ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site.
|
|
|
ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery.
|
|
|
+
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
+ ImGuiDragDropFlags_SourceAutoExpirePayload = ImGuiDragDropFlags_PayloadAutoExpire, // Renamed in 1.90.9
|
|
|
+#endif
|
|
|
};
|
|
|
|
|
|
// Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui.
|
|
|
@@ -1320,6 +1387,7 @@ enum ImGuiDataType_
|
|
|
ImGuiDataType_U64, // unsigned long long / unsigned __int64
|
|
|
ImGuiDataType_Float, // float
|
|
|
ImGuiDataType_Double, // double
|
|
|
+ ImGuiDataType_Bool, // bool (provided for user convenience, not supported by scalar widgets)
|
|
|
ImGuiDataType_COUNT
|
|
|
};
|
|
|
|
|
|
@@ -1528,8 +1596,9 @@ enum ImGuiConfigFlags_
|
|
|
ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad.
|
|
|
ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth.
|
|
|
ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set.
|
|
|
- ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend.
|
|
|
+ ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct dear imgui to disable mouse inputs and interactions.
|
|
|
ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
|
|
|
+ ImGuiConfigFlags_NoKeyboard = 1 << 6, // Instruct dear imgui to disable keyboard inputs and interactions. This is done by ignoring keyboard events and clearing existing states.
|
|
|
|
|
|
// User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are NOT used by core Dear ImGui)
|
|
|
ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware.
|
|
|
@@ -1582,11 +1651,13 @@ enum ImGuiCol_
|
|
|
ImGuiCol_ResizeGrip, // Resize grip in lower-right and lower-left corners of windows.
|
|
|
ImGuiCol_ResizeGripHovered,
|
|
|
ImGuiCol_ResizeGripActive,
|
|
|
- ImGuiCol_Tab, // TabItem in a TabBar
|
|
|
- ImGuiCol_TabHovered,
|
|
|
- ImGuiCol_TabActive,
|
|
|
- ImGuiCol_TabUnfocused,
|
|
|
- ImGuiCol_TabUnfocusedActive,
|
|
|
+ ImGuiCol_TabHovered, // Tab background, when hovered
|
|
|
+ ImGuiCol_Tab, // Tab background, when tab-bar is focused & tab is unselected
|
|
|
+ ImGuiCol_TabSelected, // Tab background, when tab-bar is focused & tab is selected
|
|
|
+ ImGuiCol_TabSelectedOverline, // Tab horizontal overline, when tab-bar is focused & tab is selected
|
|
|
+ ImGuiCol_TabDimmed, // Tab background, when tab-bar is unfocused & tab is unselected
|
|
|
+ ImGuiCol_TabDimmedSelected, // Tab background, when tab-bar is unfocused & tab is selected
|
|
|
+ ImGuiCol_TabDimmedSelectedOverline,//..horizontal overline, when tab-bar is unfocused & tab is selected
|
|
|
ImGuiCol_PlotLines,
|
|
|
ImGuiCol_PlotLinesHovered,
|
|
|
ImGuiCol_PlotHistogram,
|
|
|
@@ -1596,13 +1667,20 @@ enum ImGuiCol_
|
|
|
ImGuiCol_TableBorderLight, // Table inner borders (prefer using Alpha=1.0 here)
|
|
|
ImGuiCol_TableRowBg, // Table row background (even rows)
|
|
|
ImGuiCol_TableRowBgAlt, // Table row background (odd rows)
|
|
|
+ ImGuiCol_TextLink, // Hyperlink color
|
|
|
ImGuiCol_TextSelectedBg,
|
|
|
ImGuiCol_DragDropTarget, // Rectangle highlighting a drop target
|
|
|
ImGuiCol_NavHighlight, // Gamepad/keyboard: current highlighted item
|
|
|
ImGuiCol_NavWindowingHighlight, // Highlight window when using CTRL+TAB
|
|
|
ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active
|
|
|
ImGuiCol_ModalWindowDimBg, // Darken/colorize entire screen behind a modal window, when one is active
|
|
|
- ImGuiCol_COUNT
|
|
|
+ ImGuiCol_COUNT,
|
|
|
+
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
+ ImGuiCol_TabActive = ImGuiCol_TabSelected, // [renamed in 1.90.9]
|
|
|
+ ImGuiCol_TabUnfocused = ImGuiCol_TabDimmed, // [renamed in 1.90.9]
|
|
|
+ ImGuiCol_TabUnfocusedActive = ImGuiCol_TabDimmedSelected, // [renamed in 1.90.9]
|
|
|
+#endif
|
|
|
};
|
|
|
|
|
|
// Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure.
|
|
|
@@ -1641,11 +1719,12 @@ enum ImGuiStyleVar_
|
|
|
ImGuiStyleVar_TabRounding, // float TabRounding
|
|
|
ImGuiStyleVar_TabBorderSize, // float TabBorderSize
|
|
|
ImGuiStyleVar_TabBarBorderSize, // float TabBarBorderSize
|
|
|
- ImGuiStyleVar_TableAngledHeadersAngle, // float TableAngledHeadersAngle
|
|
|
- ImGuiStyleVar_TableAngledHeadersTextAlign,// ImVec2 TableAngledHeadersTextAlign
|
|
|
+ ImGuiStyleVar_TabBarOverlineSize, // float TabBarOverlineSize
|
|
|
+ ImGuiStyleVar_TableAngledHeadersAngle, // float TableAngledHeadersAngle
|
|
|
+ ImGuiStyleVar_TableAngledHeadersTextAlign,// ImVec2 TableAngledHeadersTextAlign
|
|
|
ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
|
|
|
ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign
|
|
|
- ImGuiStyleVar_SeparatorTextBorderSize, // float SeparatorTextBorderSize
|
|
|
+ ImGuiStyleVar_SeparatorTextBorderSize, // float SeparatorTextBorderSize
|
|
|
ImGuiStyleVar_SeparatorTextAlign, // ImVec2 SeparatorTextAlign
|
|
|
ImGuiStyleVar_SeparatorTextPadding, // ImVec2 SeparatorTextPadding
|
|
|
ImGuiStyleVar_COUNT
|
|
|
@@ -1714,8 +1793,9 @@ enum ImGuiSliderFlags_
|
|
|
ImGuiSliderFlags_None = 0,
|
|
|
ImGuiSliderFlags_AlwaysClamp = 1 << 4, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
|
|
|
ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
|
|
|
- ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits)
|
|
|
- ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget
|
|
|
+ ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).
|
|
|
+ ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget.
|
|
|
+ ImGuiSliderFlags_WrapAround = 1 << 8, // Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions for now.
|
|
|
ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
|
|
|
|
|
|
// Obsolete names
|
|
|
@@ -1938,9 +2018,19 @@ struct ImGuiTableColumnSortSpecs
|
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
-// [SECTION] Helpers: Memory allocations macros, ImVector<>
|
|
|
+// [SECTION] Helpers: Debug log, memory allocations macros, ImVector<>
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+// Debug Logging into ShowDebugLogWindow(), tty and more.
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
|
|
+#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
|
|
|
+#else
|
|
|
+#define IMGUI_DEBUG_LOG(...) ((void)0)
|
|
|
+#endif
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// IM_MALLOC(), IM_FREE(), IM_NEW(), IM_PLACEMENT_NEW(), IM_DELETE()
|
|
|
// We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax.
|
|
|
@@ -2073,12 +2163,13 @@ struct ImGuiStyle
|
|
|
float TabBorderSize; // Thickness of border around tabs.
|
|
|
float TabMinWidthForCloseButton; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
|
|
|
float TabBarBorderSize; // Thickness of tab-bar separator, which takes on the tab active color to denote focus.
|
|
|
+ float TabBarOverlineSize; // Thickness of tab-bar overline, which highlights the selected tab-bar.
|
|
|
float TableAngledHeadersAngle; // Angle of angled headers (supported values range from -50.0f degrees to +50.0f degrees).
|
|
|
ImVec2 TableAngledHeadersTextAlign;// Alignment of angled headers within the cell
|
|
|
ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
|
|
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
|
|
|
ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
|
|
- float SeparatorTextBorderSize; // Thickkness of border in SeparatorText()
|
|
|
+ float SeparatorTextBorderSize; // Thickness of border in SeparatorText()
|
|
|
ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
|
|
|
ImVec2 SeparatorTextPadding; // Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
|
|
|
ImVec2 DisplayWindowPadding; // Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen.
|
|
|
@@ -2112,6 +2203,8 @@ struct ImGuiStyle
|
|
|
// - initialization: backends and user code writes to ImGuiIO.
|
|
|
// - main loop: backends writes to ImGuiIO, user code and imgui code reads from ImGuiIO.
|
|
|
//-----------------------------------------------------------------------------
|
|
|
+// Also see ImGui::GetPlatformIO() and ImGuiPlatformIO struct for OS/platform related functions: clipboard, IME etc.
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
|
|
|
// [Internal] Storage used by IsKeyDown(), IsKeyPressed() etc functions.
|
|
|
// If prior to 1.87 you used io.KeysDownDuration[] (which was marked as internal), you should use GetKeyData(key)->DownDuration and *NOT* io.KeysData[key]->DownDuration.
|
|
|
@@ -2147,6 +2240,7 @@ struct ImGuiIO
|
|
|
// Miscellaneous options
|
|
|
bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
|
|
|
bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // Swap Cmd<>Ctrl keys + OS X style text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
|
|
|
+ bool ConfigNavSwapGamepadButtons; // = false // Swap Activate<>Cancel (A<>B) buttons, matching typical "Nintendo/Japanese style" gamepad layout.
|
|
|
bool ConfigInputTrickleEventQueue; // = true // Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.
|
|
|
bool ConfigInputTextCursorBlink; // = true // Enable blinking cursor (optional as some users consider it to be distracting).
|
|
|
bool ConfigInputTextEnterKeepActive; // = false // [BETA] Pressing Enter will keep item active and select contents (single-line only).
|
|
|
@@ -2183,9 +2277,9 @@ struct ImGuiIO
|
|
|
// Option to deactivate io.AddFocusEvent(false) handling.
|
|
|
// - May facilitate interactions with a debugger when focus loss leads to clearing inputs data.
|
|
|
// - Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them.
|
|
|
- bool ConfigDebugIgnoreFocusLoss; // = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys() in input processing.
|
|
|
+ bool ConfigDebugIgnoreFocusLoss; // = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys()/io.ClearInputMouse() in input processing.
|
|
|
|
|
|
- // Options to audit .ini data
|
|
|
+ // Option to audit .ini data
|
|
|
bool ConfigDebugIniSettings; // = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
@@ -2200,19 +2294,6 @@ struct ImGuiIO
|
|
|
void* BackendRendererUserData; // = NULL // User data for renderer backend
|
|
|
void* BackendLanguageUserData; // = NULL // User data for non C++ programming language backend
|
|
|
|
|
|
- // Optional: Access OS clipboard
|
|
|
- // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
|
|
|
- const char* (*GetClipboardTextFn)(void* user_data);
|
|
|
- void (*SetClipboardTextFn)(void* user_data, const char* text);
|
|
|
- void* ClipboardUserData;
|
|
|
-
|
|
|
- // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows)
|
|
|
- // (default to use native imm32 api on Windows)
|
|
|
- void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
|
|
|
-
|
|
|
- // Optional: Platform locale
|
|
|
- ImWchar PlatformLocaleDecimalPoint; // '.' // [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point
|
|
|
-
|
|
|
//------------------------------------------------------------------
|
|
|
// Input - Call before calling NewFrame()
|
|
|
//------------------------------------------------------------------
|
|
|
@@ -2232,7 +2313,8 @@ struct ImGuiIO
|
|
|
IMGUI_API void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index = -1); // [Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.
|
|
|
IMGUI_API void SetAppAcceptingEvents(bool accepting_events); // Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
|
|
|
IMGUI_API void ClearEventsQueue(); // Clear all incoming events.
|
|
|
- IMGUI_API void ClearInputKeys(); // Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
|
|
|
+ IMGUI_API void ClearInputKeys(); // Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
|
|
|
+ IMGUI_API void ClearInputMouse(); // Clear current mouse state.
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
IMGUI_API void ClearInputCharacters(); // [Obsoleted in 1.89.8] Clear the current frame text input buffer. Now included within ClearInputKeys().
|
|
|
#endif
|
|
|
@@ -2313,6 +2395,14 @@ struct ImGuiIO
|
|
|
//void* ImeWindowHandle; // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
|
|
|
#endif
|
|
|
|
|
|
+ // Legacy: before 1.91.1, clipboard functions were stored in ImGuiIO instead of ImGuiPlatformIO.
|
|
|
+ // As this is will affect all users of custom engines/backends, we are providing proper legacy redirection (will obsolete).
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
+ const char* (*GetClipboardTextFn)(void* user_data);
|
|
|
+ void (*SetClipboardTextFn)(void* user_data, const char* text);
|
|
|
+ void* ClipboardUserData;
|
|
|
+#endif
|
|
|
+
|
|
|
IMGUI_API ImGuiIO();
|
|
|
};
|
|
|
|
|
|
@@ -2544,9 +2634,10 @@ struct ImGuiListClipper
|
|
|
int ItemsCount; // [Internal] Number of items
|
|
|
float ItemsHeight; // [Internal] Height of item after a first step and item submission can calculate it
|
|
|
float StartPosY; // [Internal] Cursor position at the time of Begin() or after table frozen rows are all processed
|
|
|
+ double StartSeekOffsetY; // [Internal] Account for frozen rows in a table and initial loss of precision in very large windows.
|
|
|
void* TempData; // [Internal] Internal data
|
|
|
|
|
|
- // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step)
|
|
|
+ // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step, and you can call SeekCursorForItem() manually if you need)
|
|
|
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
|
|
|
IMGUI_API ImGuiListClipper();
|
|
|
IMGUI_API ~ImGuiListClipper();
|
|
|
@@ -2559,6 +2650,11 @@ struct ImGuiListClipper
|
|
|
inline void IncludeItemByIndex(int item_index) { IncludeItemsByIndex(item_index, item_index + 1); }
|
|
|
IMGUI_API void IncludeItemsByIndex(int item_begin, int item_end); // item_end is exclusive e.g. use (42, 42+1) to make item 42 never clipped.
|
|
|
|
|
|
+ // Seek cursor toward given item. This is automatically called while stepping.
|
|
|
+ // - The only reason to call this is: you can use ImGuiListClipper::Begin(INT_MAX) if you don't know item count ahead of time.
|
|
|
+ // - In this case, after all steps are done, you'll want to call SeekCursorForItem(item_count).
|
|
|
+ IMGUI_API void SeekCursorForItem(int item_index);
|
|
|
+
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
inline void IncludeRangeByIndices(int item_begin, int item_end) { IncludeItemsByIndex(item_begin, item_end); } // [renamed in 1.89.9]
|
|
|
inline void ForceDisplayRangeByIndices(int item_begin, int item_end) { IncludeItemsByIndex(item_begin, item_end); } // [renamed in 1.89.6]
|
|
|
@@ -2569,7 +2665,7 @@ struct ImGuiListClipper
|
|
|
// Helpers: ImVec2/ImVec4 operators
|
|
|
// - It is important that we are keeping those disabled by default so they don't leak in user space.
|
|
|
// - This is in order to allow user enabling implicit cast operators between ImVec2/ImVec4 and their own types (using IM_VEC2_CLASS_EXTRA in imconfig.h)
|
|
|
-// - You can use '#define IMGUI_DEFINE_MATH_OPERATORS' to import our operators, provided as a courtesy.
|
|
|
+// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
|
|
|
#ifdef IMGUI_DEFINE_MATH_OPERATORS
|
|
|
#define IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED
|
|
|
IM_MSVC_RUNTIME_CHECKS_OFF
|
|
|
@@ -2639,6 +2735,154 @@ struct ImColor
|
|
|
static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r, g, b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r, g, b, a); }
|
|
|
};
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiSelectionRequestType, ImGuiSelectionRequest, ImGuiMultiSelectIO, ImGuiSelectionBasicStorage)
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+
|
|
|
+// Multi-selection system
|
|
|
+// Documentation at: https://github.com/ocornut/imgui/wiki/Multi-Select
|
|
|
+// - Refer to 'Demo->Widgets->Selection State & Multi-Select' for demos using this.
|
|
|
+// - This system implements standard multi-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc)
|
|
|
+// with support for clipper (skipping non-visible items), box-select and many other details.
|
|
|
+// - Selectable(), Checkbox() are supported but custom widgets may use it as well.
|
|
|
+// - TreeNode() is technically supported but... using this correctly is more complicated: you need some sort of linear/random access to your tree,
|
|
|
+// which is suited to advanced trees setups also implementing filters and clipper. We will work toward simplifying and demoing it.
|
|
|
+// - In the spirit of Dear ImGui design, your code owns actual selection data.
|
|
|
+// This is designed to allow all kinds of selection storage you may use in your application e.g. set/map/hash.
|
|
|
+// About ImGuiSelectionBasicStorage:
|
|
|
+// - This is an optional helper to store a selection state and apply selection requests.
|
|
|
+// - It is used by our demos and provided as a convenience to quickly implement multi-selection.
|
|
|
+// Usage:
|
|
|
+// - Identify submitted items with SetNextItemSelectionUserData(), most likely using an index into your current data-set.
|
|
|
+// - Store and maintain actual selection data using persistent object identifiers.
|
|
|
+// - Usage flow:
|
|
|
+// BEGIN - (1) Call BeginMultiSelect() and retrieve the ImGuiMultiSelectIO* result.
|
|
|
+// - (2) Honor request list (SetAll/SetRange requests) by updating your selection data. Same code as Step 6.
|
|
|
+// - (3) [If using clipper] You need to make sure RangeSrcItem is always submitted. Calculate its index and pass to clipper.IncludeItemByIndex(). If storing indices in ImGuiSelectionUserData, a simple clipper.IncludeItemByIndex(ms_io->RangeSrcItem) call will work.
|
|
|
+// LOOP - (4) Submit your items with SetNextItemSelectionUserData() + Selectable()/TreeNode() calls.
|
|
|
+// END - (5) Call EndMultiSelect() and retrieve the ImGuiMultiSelectIO* result.
|
|
|
+// - (6) Honor request list (SetAll/SetRange requests) by updating your selection data. Same code as Step 2.
|
|
|
+// If you submit all items (no clipper), Step 2 and 3 are optional and will be handled by each item themselves. It is fine to always honor those steps.
|
|
|
+// About ImGuiSelectionUserData:
|
|
|
+// - This can store an application-defined identifier (e.g. index or pointer) submitted via SetNextItemSelectionUserData().
|
|
|
+// - In return we store them into RangeSrcItem/RangeFirstItem/RangeLastItem and other fields in ImGuiMultiSelectIO.
|
|
|
+// - Most applications will store an object INDEX, hence the chosen name and type. Storing an index is natural, because
|
|
|
+// SetRange requests will give you two end-points and you will need to iterate/interpolate between them to update your selection.
|
|
|
+// - However it is perfectly possible to store a POINTER or another IDENTIFIER inside ImGuiSelectionUserData.
|
|
|
+// Our system never assume that you identify items by indices, it never attempts to interpolate between two values.
|
|
|
+// - If you enable ImGuiMultiSelectFlags_NoRangeSelect then it is guaranteed that you will never have to interpolate
|
|
|
+// between two ImGuiSelectionUserData, which may be a convenient way to use part of the feature with less code work.
|
|
|
+// - As most users will want to store an index, for convenience and to reduce confusion we use ImS64 instead of void*,
|
|
|
+// being syntactically easier to downcast. Feel free to reinterpret_cast and store a pointer inside.
|
|
|
+
|
|
|
+// Flags for BeginMultiSelect()
|
|
|
+enum ImGuiMultiSelectFlags_
|
|
|
+{
|
|
|
+ ImGuiMultiSelectFlags_None = 0,
|
|
|
+ ImGuiMultiSelectFlags_SingleSelect = 1 << 0, // Disable selecting more than one item. This is available to allow single-selection code to share same code/logic if desired. It essentially disables the main purpose of BeginMultiSelect() tho!
|
|
|
+ ImGuiMultiSelectFlags_NoSelectAll = 1 << 1, // Disable CTRL+A shortcut to select all.
|
|
|
+ ImGuiMultiSelectFlags_NoRangeSelect = 1 << 2, // Disable Shift+selection mouse/keyboard support (useful for unordered 2D selection). With BoxSelect is also ensure contiguous SetRange requests are not combined into one. This allows not handling interpolation in SetRange requests.
|
|
|
+ ImGuiMultiSelectFlags_NoAutoSelect = 1 << 3, // Disable selecting items when navigating (useful for e.g. supporting range-select in a list of checkboxes).
|
|
|
+ ImGuiMultiSelectFlags_NoAutoClear = 1 << 4, // Disable clearing selection when navigating or selecting another one (generally used with ImGuiMultiSelectFlags_NoAutoSelect. useful for e.g. supporting range-select in a list of checkboxes).
|
|
|
+ ImGuiMultiSelectFlags_NoAutoClearOnReselect = 1 << 5, // Disable clearing selection when clicking/selecting an already selected item.
|
|
|
+ ImGuiMultiSelectFlags_BoxSelect1d = 1 << 6, // Enable box-selection with same width and same x pos items (e.g. full row Selectable()). Box-selection works better with little bit of spacing between items hit-box in order to be able to aim at empty space.
|
|
|
+ ImGuiMultiSelectFlags_BoxSelect2d = 1 << 7, // Enable box-selection with varying width or varying x pos items support (e.g. different width labels, or 2D layout/grid). This is slower: alters clipping logic so that e.g. horizontal movements will update selection of normally clipped items.
|
|
|
+ ImGuiMultiSelectFlags_BoxSelectNoScroll = 1 << 8, // Disable scrolling when box-selecting near edges of scope.
|
|
|
+ ImGuiMultiSelectFlags_ClearOnEscape = 1 << 9, // Clear selection when pressing Escape while scope is focused.
|
|
|
+ ImGuiMultiSelectFlags_ClearOnClickVoid = 1 << 10, // Clear selection when clicking on empty location within scope.
|
|
|
+ ImGuiMultiSelectFlags_ScopeWindow = 1 << 11, // Scope for _BoxSelect and _ClearOnClickVoid is whole window (Default). Use if BeginMultiSelect() covers a whole window or used a single time in same window.
|
|
|
+ ImGuiMultiSelectFlags_ScopeRect = 1 << 12, // Scope for _BoxSelect and _ClearOnClickVoid is rectangle encompassing BeginMultiSelect()/EndMultiSelect(). Use if BeginMultiSelect() is called multiple times in same window.
|
|
|
+ ImGuiMultiSelectFlags_SelectOnClick = 1 << 13, // Apply selection on mouse down when clicking on unselected item. (Default)
|
|
|
+ ImGuiMultiSelectFlags_SelectOnClickRelease = 1 << 14, // Apply selection on mouse release when clicking an unselected item. Allow dragging an unselected item without altering selection.
|
|
|
+ //ImGuiMultiSelectFlags_RangeSelect2d = 1 << 15, // Shift+Selection uses 2d geometry instead of linear sequence, so possible to use Shift+up/down to select vertically in grid. Analogous to what BoxSelect does.
|
|
|
+ ImGuiMultiSelectFlags_NavWrapX = 1 << 16, // [Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don't have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one.
|
|
|
+};
|
|
|
+
|
|
|
+// Main IO structure returned by BeginMultiSelect()/EndMultiSelect().
|
|
|
+// This mainly contains a list of selection requests.
|
|
|
+// - Use 'Demo->Tools->Debug Log->Selection' to see requests as they happen.
|
|
|
+// - Some fields are only useful if your list is dynamic and allows deletion (getting post-deletion focus/state right is shown in the demo)
|
|
|
+// - Below: who reads/writes each fields? 'r'=read, 'w'=write, 'ms'=multi-select code, 'app'=application/user code.
|
|
|
+struct ImGuiMultiSelectIO
|
|
|
+{
|
|
|
+ //------------------------------------------// BeginMultiSelect / EndMultiSelect
|
|
|
+ ImVector<ImGuiSelectionRequest> Requests; // ms:w, app:r / ms:w app:r // Requests to apply to your selection data.
|
|
|
+ ImGuiSelectionUserData RangeSrcItem; // ms:w app:r / // (If using clipper) Begin: Source item (often the first selected item) must never be clipped: use clipper.IncludeItemByIndex() to ensure it is submitted.
|
|
|
+ ImGuiSelectionUserData NavIdItem; // ms:w, app:r / // (If using deletion) Last known SetNextItemSelectionUserData() value for NavId (if part of submitted items).
|
|
|
+ bool NavIdSelected; // ms:w, app:r / app:r // (If using deletion) Last known selection state for NavId (if part of submitted items).
|
|
|
+ bool RangeSrcReset; // app:w / ms:r // (If using deletion) Set before EndMultiSelect() to reset ResetSrcItem (e.g. if deleted selection).
|
|
|
+ int ItemsCount; // ms:w, app:r / app:r // 'int items_count' parameter to BeginMultiSelect() is copied here for convenience, allowing simpler calls to your ApplyRequests handler. Not used internally.
|
|
|
+};
|
|
|
+
|
|
|
+// Selection request type
|
|
|
+enum ImGuiSelectionRequestType
|
|
|
+{
|
|
|
+ ImGuiSelectionRequestType_None = 0,
|
|
|
+ ImGuiSelectionRequestType_SetAll, // Request app to clear selection (if Selected==false) or select all items (if Selected==true). We cannot set RangeFirstItem/RangeLastItem as its contents is entirely up to user (not necessarily an index)
|
|
|
+ ImGuiSelectionRequestType_SetRange, // Request app to select/unselect [RangeFirstItem..RangeLastItem] items (inclusive) based on value of Selected. Only EndMultiSelect() request this, app code can read after BeginMultiSelect() and it will always be false.
|
|
|
+};
|
|
|
+
|
|
|
+// Selection request item
|
|
|
+struct ImGuiSelectionRequest
|
|
|
+{
|
|
|
+ //------------------------------------------// BeginMultiSelect / EndMultiSelect
|
|
|
+ ImGuiSelectionRequestType Type; // ms:w, app:r / ms:w, app:r // Request type. You'll most often receive 1 Clear + 1 SetRange with a single-item range.
|
|
|
+ bool Selected; // ms:w, app:r / ms:w, app:r // Parameter for SetAll/SetRange requests (true = select, false = unselect)
|
|
|
+ ImS8 RangeDirection; // / ms:w app:r // Parameter for SetRange request: +1 when RangeFirstItem comes before RangeLastItem, -1 otherwise. Useful if you want to preserve selection order on a backward Shift+Click.
|
|
|
+ ImGuiSelectionUserData RangeFirstItem; // / ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from top to bottom).
|
|
|
+ ImGuiSelectionUserData RangeLastItem; // / ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from bottom to top). Inclusive!
|
|
|
+};
|
|
|
+
|
|
|
+// Optional helper to store multi-selection state + apply multi-selection requests.
|
|
|
+// - Used by our demos and provided as a convenience to easily implement basic multi-selection.
|
|
|
+// - Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it, &id)) { ... }'
|
|
|
+// Or you can check 'if (Contains(id)) { ... }' for each possible object if their number is not too high to iterate.
|
|
|
+// - USING THIS IS NOT MANDATORY. This is only a helper and not a required API.
|
|
|
+// To store a multi-selection, in your application you could:
|
|
|
+// - Use this helper as a convenience. We use our simple key->value ImGuiStorage as a std::set<ImGuiID> replacement.
|
|
|
+// - Use your own external storage: e.g. std::set<MyObjectId>, std::vector<MyObjectId>, interval trees, intrusively stored selection etc.
|
|
|
+// In ImGuiSelectionBasicStorage we:
|
|
|
+// - always use indices in the multi-selection API (passed to SetNextItemSelectionUserData(), retrieved in ImGuiMultiSelectIO)
|
|
|
+// - use the AdapterIndexToStorageId() indirection layer to abstract how persistent selection data is derived from an index.
|
|
|
+// - use decently optimized logic to allow queries and insertion of very large selection sets.
|
|
|
+// - do not preserve selection order.
|
|
|
+// Many combinations are possible depending on how you prefer to store your items and how you prefer to store your selection.
|
|
|
+// Large applications are likely to eventually want to get rid of this indirection layer and do their own thing.
|
|
|
+// See https://github.com/ocornut/imgui/wiki/Multi-Select for details and pseudo-code using this helper.
|
|
|
+struct ImGuiSelectionBasicStorage
|
|
|
+{
|
|
|
+ // Members
|
|
|
+ int Size; // // Number of selected items, maintained by this helper.
|
|
|
+ bool PreserveOrder; // = false // GetNextSelectedItem() will return ordered selection (currently implemented by two additional sorts of selection. Could be improved)
|
|
|
+ void* UserData; // = NULL // User data for use by adapter function // e.g. selection.UserData = (void*)my_items;
|
|
|
+ ImGuiID (*AdapterIndexToStorageId)(ImGuiSelectionBasicStorage* self, int idx); // e.g. selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((MyItems**)self->UserData)[idx]->ID; };
|
|
|
+ int _SelectionOrder;// [Internal] Increasing counter to store selection order
|
|
|
+ ImGuiStorage _Storage; // [Internal] Selection set. Think of this as similar to e.g. std::set<ImGuiID>. Prefer not accessing directly: iterate with GetNextSelectedItem().
|
|
|
+
|
|
|
+ // Methods
|
|
|
+ IMGUI_API ImGuiSelectionBasicStorage();
|
|
|
+ IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io); // Apply selection requests coming from BeginMultiSelect() and EndMultiSelect() functions. It uses 'items_count' passed to BeginMultiSelect()
|
|
|
+ IMGUI_API bool Contains(ImGuiID id) const; // Query if an item id is in selection.
|
|
|
+ IMGUI_API void Clear(); // Clear selection
|
|
|
+ IMGUI_API void Swap(ImGuiSelectionBasicStorage& r); // Swap two selections
|
|
|
+ IMGUI_API void SetItemSelected(ImGuiID id, bool selected); // Add/remove an item from selection (generally done by ApplyRequests() function)
|
|
|
+ IMGUI_API bool GetNextSelectedItem(void** opaque_it, ImGuiID* out_id); // Iterate selection with 'void* it = NULL; ImGuiId id; while (selection.GetNextSelectedItem(&it, &id)) { ... }'
|
|
|
+ inline ImGuiID GetStorageIdFromIndex(int idx) { return AdapterIndexToStorageId(this, idx); } // Convert index to item id based on provided adapter.
|
|
|
+};
|
|
|
+
|
|
|
+// Optional helper to apply multi-selection requests to existing randomly accessible storage.
|
|
|
+// Convenient if you want to quickly wire multi-select API on e.g. an array of bool or items storing their own selection state.
|
|
|
+struct ImGuiSelectionExternalStorage
|
|
|
+{
|
|
|
+ // Members
|
|
|
+ void* UserData; // User data for use by adapter function // e.g. selection.UserData = (void*)my_items;
|
|
|
+ void (*AdapterSetItemSelected)(ImGuiSelectionExternalStorage* self, int idx, bool selected); // e.g. AdapterSetItemSelected = [](ImGuiSelectionExternalStorage* self, int idx, bool selected) { ((MyItems**)self->UserData)[idx]->Selected = selected; }
|
|
|
+
|
|
|
+ // Methods
|
|
|
+ IMGUI_API ImGuiSelectionExternalStorage();
|
|
|
+ IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io); // Apply selection requests by using AdapterSetItemSelected() calls
|
|
|
+};
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// [SECTION] Drawing API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData)
|
|
|
// Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList.
|
|
|
@@ -2908,6 +3152,7 @@ struct ImDrawList
|
|
|
IMGUI_API void _OnChangedClipRect();
|
|
|
IMGUI_API void _OnChangedTextureID();
|
|
|
IMGUI_API void _OnChangedVtxOffset();
|
|
|
+ IMGUI_API void _SetTextureID(ImTextureID texture_id);
|
|
|
IMGUI_API int _CalcCircleAutoSegmentCount(float radius) const;
|
|
|
IMGUI_API void _PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step);
|
|
|
IMGUI_API void _PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments);
|
|
|
@@ -3142,7 +3387,7 @@ struct ImFontAtlas
|
|
|
struct ImFont
|
|
|
{
|
|
|
// Members: Hot ~20/24 bytes (for CalcTextSize)
|
|
|
- ImVector<float> IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI).
|
|
|
+ ImVector<float> IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI).
|
|
|
float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX
|
|
|
float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading)
|
|
|
|
|
|
@@ -3162,7 +3407,7 @@ struct ImFont
|
|
|
float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
|
|
|
bool DirtyLookupTables; // 1 // out //
|
|
|
float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
|
|
|
- float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
|
|
|
+ float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
|
|
|
int MetricsTotalSurface;// 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
|
|
|
ImU8 Used4kPagesMap[(IM_UNICODE_CODEPOINT_MAX+1)/4096/8]; // 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints.
|
|
|
|
|
|
@@ -3222,6 +3467,7 @@ struct ImGuiViewport
|
|
|
ImVec2 WorkSize; // Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
|
|
|
|
|
|
// Platform/Backend Dependent Data
|
|
|
+ void* PlatformHandle; // void* to hold higher-level, platform window handle (e.g. HWND, GLFWWindow*, SDL_Window*)
|
|
|
void* PlatformHandleRaw; // void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms)
|
|
|
|
|
|
ImGuiViewport() { memset(this, 0, sizeof(*this)); }
|
|
|
@@ -3235,7 +3481,38 @@ struct ImGuiViewport
|
|
|
// [SECTION] Platform Dependent Interfaces
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
-// (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
|
|
|
+// Access via ImGui::GetPlatformIO()
|
|
|
+struct ImGuiPlatformIO
|
|
|
+{
|
|
|
+ IMGUI_API ImGuiPlatformIO();
|
|
|
+
|
|
|
+ //------------------------------------------------------------------
|
|
|
+ // Inputs - Interface with OS/backends
|
|
|
+ //------------------------------------------------------------------
|
|
|
+
|
|
|
+ // Optional: Access OS clipboard
|
|
|
+ // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
|
|
|
+ const char* (*Platform_GetClipboardTextFn)(ImGuiContext* ctx);
|
|
|
+ void (*Platform_SetClipboardTextFn)(ImGuiContext* ctx, const char* text);
|
|
|
+ void* Platform_ClipboardUserData;
|
|
|
+
|
|
|
+ // Optional: Open link/folder/file in OS Shell
|
|
|
+ // (default to use ShellExecuteA() on Windows, system() on Linux/Mac)
|
|
|
+ bool (*Platform_OpenInShellFn)(ImGuiContext* ctx, const char* path);
|
|
|
+ void* Platform_OpenInShellUserData;
|
|
|
+
|
|
|
+ // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows)
|
|
|
+ // (default to use native imm32 api on Windows)
|
|
|
+ void (*Platform_SetImeDataFn)(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
|
|
|
+ void* Platform_ImeUserData;
|
|
|
+ //void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data); // [Renamed to platform_io.PlatformSetImeDataFn in 1.91.1]
|
|
|
+
|
|
|
+ // Optional: Platform locale
|
|
|
+ // [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point
|
|
|
+ ImWchar Platform_LocaleDecimalPoint; // '.'
|
|
|
+};
|
|
|
+
|
|
|
+// (Optional) Support for IME (Input Method Editor) via the platform_io.Platform_SetImeDataFn() function.
|
|
|
struct ImGuiPlatformImeData
|
|
|
{
|
|
|
bool WantVisible; // A widget wants the IME to be visible
|
|
|
@@ -3254,29 +3531,37 @@ struct ImGuiPlatformImeData
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
namespace ImGui
|
|
|
{
|
|
|
+ // OBSOLETED in 1.91.0 (from July 2024)
|
|
|
+ static inline void PushButtonRepeat(bool repeat) { PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); }
|
|
|
+ static inline void PopButtonRepeat() { PopItemFlag(); }
|
|
|
+ static inline void PushTabStop(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); }
|
|
|
+ static inline void PopTabStop() { PopItemFlag(); }
|
|
|
+ IMGUI_API ImVec2 GetContentRegionMax(); // Content boundaries max (e.g. window boundaries including scrolling, or current column boundaries). You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()!
|
|
|
+ IMGUI_API ImVec2 GetWindowContentRegionMin(); // Content boundaries min for the window (roughly (0,0)-Scroll), in window-local coordinates. You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()!
|
|
|
+ IMGUI_API ImVec2 GetWindowContentRegionMax(); // Content boundaries max for the window (roughly (0,0)+Size-Scroll), in window-local coordinates. You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()!
|
|
|
// OBSOLETED in 1.90.0 (from September 2023)
|
|
|
- static inline bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags window_flags = 0) { return BeginChild(id, size, ImGuiChildFlags_FrameStyle, window_flags); }
|
|
|
- static inline void EndChildFrame() { EndChild(); }
|
|
|
- //static inline bool BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags){ return BeginChild(str_id, size_arg, border ? ImGuiChildFlags_Border : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Border
|
|
|
- //static inline bool BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags) { return BeginChild(id, size_arg, border ? ImGuiChildFlags_Border : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Border
|
|
|
- static inline void ShowStackToolWindow(bool* p_open = NULL) { ShowIDStackToolWindow(p_open); }
|
|
|
- IMGUI_API bool ListBox(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int height_in_items = -1);
|
|
|
+ static inline bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags window_flags = 0) { return BeginChild(id, size, ImGuiChildFlags_FrameStyle, window_flags); }
|
|
|
+ static inline void EndChildFrame() { EndChild(); }
|
|
|
+ //static inline bool BeginChild(const char* str_id, const ImVec2& size_arg, bool borders, ImGuiWindowFlags window_flags){ return BeginChild(str_id, size_arg, borders ? ImGuiChildFlags_Borders : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Borders
|
|
|
+ //static inline bool BeginChild(ImGuiID id, const ImVec2& size_arg, bool borders, ImGuiWindowFlags window_flags) { return BeginChild(id, size_arg, borders ? ImGuiChildFlags_Borders : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Borders
|
|
|
+ static inline void ShowStackToolWindow(bool* p_open = NULL) { ShowIDStackToolWindow(p_open); }
|
|
|
IMGUI_API bool Combo(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int popup_max_height_in_items = -1);
|
|
|
+ IMGUI_API bool ListBox(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int height_in_items = -1);
|
|
|
// OBSOLETED in 1.89.7 (from June 2023)
|
|
|
- IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item.
|
|
|
+ IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item.
|
|
|
// OBSOLETED in 1.89.4 (from March 2023)
|
|
|
- static inline void PushAllowKeyboardFocus(bool tab_stop) { PushTabStop(tab_stop); }
|
|
|
- static inline void PopAllowKeyboardFocus() { PopTabStop(); }
|
|
|
- // OBSOLETED in 1.89 (from August 2022)
|
|
|
- IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding)
|
|
|
+ static inline void PushAllowKeyboardFocus(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); }
|
|
|
+ static inline void PopAllowKeyboardFocus() { PopItemFlag(); }
|
|
|
// OBSOLETED in 1.87 (from February 2022 but more formally obsoleted April 2024)
|
|
|
- IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); // Map ImGuiKey_* values into legacy native key index. == io.KeyMap[key]. When using a 1.87+ backend using io.AddKeyEvent(), calling GetKeyIndex() with ANY ImGuiKey_XXXX values will return the same value!
|
|
|
- //static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END); return key; }
|
|
|
+ IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); // Map ImGuiKey_* values into legacy native key index. == io.KeyMap[key]. When using a 1.87+ backend using io.AddKeyEvent(), calling GetKeyIndex() with ANY ImGuiKey_XXXX values will return the same value!
|
|
|
+ //static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END); return key; }
|
|
|
|
|
|
// Some of the older obsolete names along with their replacement (commented out so they are not reported in IDE)
|
|
|
+ //-- OBSOLETED in 1.89 (from August 2022)
|
|
|
+ //IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // --> Use new ImageButton() signature (explicit item id, regular FramePadding). Refer to code in 1.91 if you want to grab a copy of this version.
|
|
|
//-- OBSOLETED in 1.88 (from May 2022)
|
|
|
- //static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value.
|
|
|
- //static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value.
|
|
|
+ //static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value.
|
|
|
+ //static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value.
|
|
|
//-- OBSOLETED in 1.86 (from November 2021)
|
|
|
//IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // Code removed, see 1.90 for last version of the code. Calculate range of visible items for large list of evenly sized items. Prefer using ImGuiListClipper.
|
|
|
//-- OBSOLETED in 1.85 (from August 2021)
|
|
|
@@ -3349,8 +3634,8 @@ namespace ImGui
|
|
|
|
|
|
// RENAMED and MERGED both ImGuiKey_ModXXX and ImGuiModFlags_XXX into ImGuiMod_XXX (from September 2022)
|
|
|
// RENAMED ImGuiKeyModFlags -> ImGuiModFlags in 1.88 (from April 2022). Exceptionally commented out ahead of obscolescence schedule to reduce confusion and because they were not meant to be used in the first place.
|
|
|
-typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", but you may store only mods in there.
|
|
|
-enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super };
|
|
|
+//typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", so you may store mods in there.
|
|
|
+//enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super };
|
|
|
//typedef ImGuiKeyChord ImGuiKeyModFlags; // == int
|
|
|
//enum ImGuiKeyModFlags_ { ImGuiKeyModFlags_None = 0, ImGuiKeyModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiKeyModFlags_Shift = ImGuiMod_Shift, ImGuiKeyModFlags_Alt = ImGuiMod_Alt, ImGuiKeyModFlags_Super = ImGuiMod_Super };
|
|
|
|