Comments (6)
You can use an InvisibleButton()
just before calling EndChild()
and use this. Make sure the button covers entire child region. You can call ImGui::DebugDrawItemRect()
after InvisibleButton()
to ensure your geometry is correct.
from imgui.
It doesn't indeed, but I'm not sure we can make it work as it would be a relatively ambiguous behavior.
What's inside your child? Do you want the drag to happen when clicking and interacting with any item within the child?
You might submit an invisible button covering the child window as the last item in the window, and use as a drop source. Have you tried that? (not same problem, but similar idea as what's used in #3379)
from imgui.
interesting post(#3379). Here is a picture
Each of the blocks on saying "Wait" are movement commands for a robot. Each of those commands has multiple inputs and so on and I want to be able to reorder them by dragging them on top or inbetween of each other.
To reflect on your response...
I can put a button within the child on the lowest z level just above the child (cause I need to be able to reach the widgets in the child. Is that right?
I am gonna give it a shot.
from imgui.
I did that and you can see the red rectangle;
The Problem I have is:
I have a child for the left gray bar on each of the routines and a child with all of the other elements in it.(see image)
the structure of the code is somthng like this:
BeginChild(); //LeftGrayBar
EndChild();
BeginChild(); //with all other elements
EndChild();
InvisibleButton();
The button is only reachable in the gaps between the 2 children.
It seems like the children have a higher z value.
the same is the case if I but the Button before the children.
I solved it now by putting the invisible button in all of the children, so it will be active on all layers.
not pretty but it works.
from imgui.
You can add the undocumented ImGuiButtonFlags_FlattenChildren
to InvisibleButton()
to solve this.
However, I think your nested use of BeginChild()
is unnecessary and may be inefficient. Child windows are meant to be scrolling area.
Instead of
BeginChild(); //LeftGrayBar
EndChild();
BeginChild(); //with all other elements
EndChild();
InvisibleButton();
You can use:
BeginGroup(); //LeftGrayBar
//..
EndGroup();
SameLine();
BeginGroup(); //with all other elements
EndGroup();
InvisibleButton();
BeginGroup() will lock the X coordinates. You can also use Indent() to adjust it.
from imgui.
Good to know, thank you.
I am gonna run with the hacked Solution for now to save time refactoring the layout but I'll use it from now on.
Thanks @ocornut
Cheers
from imgui.
Related Issues (20)
- Slight lag on opening comboboxes HOT 8
- Lag when changing mouse cursor (was: lag hovering over text inputs) HOT 4
- When ImGuiChildFlags_AlwaysUseWindowPadding is enabled, the left and right padding widths of the Child are different, but the Parent window is the same HOT 5
- No scrolling region or selectable items inside Child HOT 3
- Can't write in any field. (1.90.5-docking with SDL3) HOT 1
- `BeginGroup`/`EndGroup` with table inside reports incorrect item size
- Delay in Combo Popup Opening with glfwWaitEventsTimeout HOT 5
- Where's the binaries? HOT 4
- Mouse scrolling not working HOT 6
- Imgui community HOT 1
- Rendering vertices with the D3DPT_LINESTRIP type. HOT 1
- Can't access some stuff from imgui.h HOT 1
- Suggestion: Consider Adding Title Bar Text to Popups HOT 2
- SDL3 Multi-Viewports not creating windows when main window is hidden
- Recommended way to expand / collapse tree nodes with keyboard shortcuts? HOT 3
- VuIkan: invalid Dynamic Rendering functions from the Instance-level loader HOT 3
- Text Bottom Padding Bug HOT 1
- Power savings & hardware usage HOT 3
- Add RGFW backend implementation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui.