@ -175,7 +175,7 @@ struct ImGuiIO; // Main configuration and I/O between your a
structImGuiInputTextCallbackData;// Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
structImGuiKeyData;// Storage for ImGuiIO and IsKeyDown(), IsKeyPressed() etc functions.
structImGuiListClipper;// Helper to manually clip large list of items
structImGuiMultiSelectData;// State for a BeginMultiSelect() block
structImGuiMultiSelectIO;// Structure to interact with a BeginMultiSelect()/EndMultiSelect() block
structImGuiOnceUponAFrame;// Helper for running a block of code not more than once a frame
structImGuiPayload;// User data payload for drag and drop operations
structImGuiPlatformImeData;// Platform IME data for io.SetPlatformImeDataFn() function.
@ -669,10 +669,10 @@ namespace ImGui
// Multi-selection system for Selectable() and TreeNode() functions.
// This enables standard multi-selection/range-selection idioms (CTRL+Click/Arrow, SHIFT+Click/Arrow, etc) in a way that allow items to be fully clipped (= not submitted at all) when not visible.
// Read comments near ImGuiMultiSelectData for details.
// Read comments near ImGuiMultiSelectIO for details.
// When enabled, Selectable() and TreeNode() functions will return true when selection needs toggling.
// 5) Call EndMultiSelect(). Save the value of ->RangeSrc for the next frame (you may convert the value in a format that is safe for persistance)
// 6) Honor Clear/SelectAll/SetRange requests by updating your selection data. Always process them in this order (as you will receive Clear+SetRange request simultaneously)
// If you submit all items (no clipper), Step 2 and 3 and will be handled by Selectable() on a per-item basis.
structImGuiMultiSelectData
structImGuiMultiSelectIO
{
// Output (return by BeginMultiSelect()/EndMultiSelect()
// - Always process requests in their structure order.
boolRequestClear;// Begin, End // 1. Request user to clear selection
boolRequestSelectAll;// Begin, End // 2. Request user to select all
boolRequestSetRange;// End // 3. Request user to set or clear selection in the [RangeSrc..RangeDst] range
boolRangeSrcPassedBy;// Loop // (If clipping) Need to be set by user if RangeSrc was part of the clipped set before submitting the visible items. Ignore if not clipping.
boolRangeValue;// End // End: parameter from RequestSetRange request. true = Select Range, false = Unselect Range.
void*RangeSrc;// Begin, End // End: parameter from RequestSetRange request + you need to save this value so you can pass it again next frame. / Begin: this is the value you passed to BeginMultiSelect()
void*RangeDst;// End // End: parameter from RequestSetRange request.
intRangeDirection;// End // End: parameter from RequestSetRange request. +1 if RangeSrc came before RangeDst, -1 otherwise. Available as an indicator in case you cannot infer order from the void* values. If your void* values are storing indices you will never need this.
ImGuiMultiSelectData(){Clear();}
// Input (written by user between BeginMultiSelect()/EndMultiSelect()
boolRangeSrcPassedBy;// Loop // (If using a clipper) Need to be set by user if RangeSrc was part of the clipped set before submitting the visible items. Ignore if not clipping.
voidSelectAll(intcount){Storage.Data.resize(count);for(intidx=0;idx<count;idx++)Storage.Data[idx]=ImGuiStoragePair((ImGuiID)idx,1);SelectionSize=count;}// This could be using SetRange(), but it this way is faster.
// Apply requests coming from BeginMultiSelect() and EndMultiSelect(). Must be done in this order! Order->SelectAll->SetRange.
ImGuiMultiSelectDataIn;// The In requests are set and returned by BeginMultiSelect()
ImGuiMultiSelectDataOut;// The Out requests are finalized and returned by EndMultiSelect()
ImGuiMultiSelectIOIn;// The In requests are set and returned by BeginMultiSelect()
ImGuiMultiSelectIOOut;// The Out requests are finalized and returned by EndMultiSelect()
boolIsFocused;// Set if currently focusing the selection scope (any item of the selection). May be used if you have custom shortcut associated to selection.
boolInRangeDstPassedBy;// (Internal) set by the the item that match NavJustMovedToId when InRequestRangeSetNav is set.
boolInRequestSetRangeNav;// (Internal) set by BeginMultiSelect() when using Shift+Navigation. Because scrolling may be affected we can't afford a frame of lag with Shift+Navigation.