mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
Intermediate Checkboxes #2644
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#2644
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version: ImGui.NET 1.70
Branch: master
Operating System: Arch Linux
I was looking into adding Checkboxes that support an intermediate mode, but didn't find them. It's a feature that would be handy to have.
An intermediate Checkbox allows for a third state, which could generally be seen as a "i'm not sure", instead of a yes or no. Most GUI libraries support them, and they've plenty applications, especially for input forms. Occasionally they're also used to delineate when something is neither true or false. E.g. "Selected all" in a list, but only some items are selected:
https://docs.oracle.com/javafx/2/ui_controls/checkbox.htm
This document for JavaFX demonstrates the intermediate model fairly well.
Any chance this could be implemented in Dear ImGui?
I would like to design this as a more general feature (e.g. any widgets representing a "mixed" selection, or potentially even one single component of a multi-component widget), so the problem is that I'd be hesitant to design something too specific to Checkbox.
I don't mind adding something in
imgui_internal.hto support it for Checkbox at a first step, with the understanding that the API might break if we change how it works later on?Pushed something to
imgui_internal.hMy draft to support the general feature involved a
ImGuiItemFlags_MixedValueflag so I went this way for the checkbox.You'll need to add your own wrapper function (in any of your own .cpp file), e.g.
Usage
Well, that was fast! I like the generalisation of that concept, and for now this workaround is more than enough, thanks for the quick reply!