ocornut/imgui

Dual list box

darkvad1010 opened this issue · 3 comments

How could one achieve this type of dual list box widget, using imgui listboxes and buttons? With this component, you can add or remove a selected item from one list to another. You can also add or remove all items in one list to the other.

vue-listbox-multiselect~2

Take a look a tables in the demo sources. If you rather want to define your layout manually, you can use GetContentRegionAvail() to get the available size, SetCursorPos() to place your items and give an explicit size when committing your items.

You can achieve this with two child window or listbox, submitting items in either of them depending on their inclusion in the set, with stored selection on both sides and buttons to move from one to the other.

I think it would be a worthy demo to add, in particular with the addition of the range-select branch. I’ll try to work on one next month.

FYI I've been doing some research on this as part of the multi-select features and being an expected demo.
Turns out it hasn't been simple to design and formalize the right demo for this this and other multi-select features, one problem being that multi-select generally requires quite some involvement from user code.

image

No ETA.