Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual list box #6648

Closed
darkvad1010 opened this issue Jul 25, 2023 · 4 comments
Closed

Dual list box #6648

darkvad1010 opened this issue Jul 25, 2023 · 4 comments

Comments

@darkvad1010
Copy link

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

@GamingMinds-DanielC
Copy link
Contributor

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.

@ocornut
Copy link
Owner

ocornut commented Jul 26, 2023

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.

@ocornut
Copy link
Owner

ocornut commented Aug 23, 2023

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.

@ocornut
Copy link
Owner

ocornut commented Jul 18, 2024

A dual list box demo has now been merged as part of the multi-select integration into master.

You can find it in Demo->Widgets->Selection State&Multi-Select->Dual List Box

image

@ocornut ocornut closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants