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

BeginChild() make its area loose the ability to move a window #1337

Closed
djdeath opened this issue Sep 27, 2017 · 5 comments
Closed

BeginChild() make its area loose the ability to move a window #1337

djdeath opened this issue Sep 27, 2017 · 5 comments
Labels

Comments

@djdeath
Copy link
Contributor

djdeath commented Sep 27, 2017

Hi,

I'm trying to layout a window so that there is a top part that doesn't scroll, and the bottom part is a list that can be scrolled :
screenshot from 2017-09-27 01-42-53

This can be implemented by using BeginChild()/BeginChildFrame() for the scrolling part.
The slightly annoying problem with this is that previously the entire window would be reactive to click-and-drag (so you can move it by clicking anywhere), but now only the part outside of BeginChild/EndChild has that ability.

Is there a way around this?

Thanks!

@ocornut
Copy link
Owner

ocornut commented Sep 27, 2017

Looks like this commit broke it:
313d388
It needs to be looked at.

(Btw I'm not sure why you are using BeginChildFrame and not BeginChild here, and your UI looks really hard to read).

@djdeath
Copy link
Contributor Author

djdeath commented Sep 27, 2017

Thanks, indeed, BeginChild() looks much better.
I was just trying out all possibilities.

@djdeath djdeath changed the title BeginChildFrame() make its area loose the ability to move a window BeginChild() make its area loose the ability to move a window Sep 27, 2017
@ocornut
Copy link
Owner

ocornut commented Sep 27, 2017

Should be fixed now!
Note that you can use the ImGuiWindowFlags_NoMove flag on a child window to explicitly disable this if needed.

@ocornut ocornut closed this as completed Sep 27, 2017
@djdeath
Copy link
Contributor Author

djdeath commented Sep 27, 2017

Wow thanks you so much! All good now 👍

ocornut added a commit that referenced this issue Oct 20, 2017
ocornut added a commit that referenced this issue Jan 11, 2018
…ActiveId so we can't hover something else. (ref #1381, #1337)
ocornut added a commit that referenced this issue Jan 11, 2018
…akes an ActiveId so we can't hover something else. (ref #1381, #1337)"

This reverts commit 651538e.
ocornut added a commit that referenced this issue Jan 11, 2018
…Window which has side-effects. Clicking on a window with the ImGuiWIndowFlags_NoMove flags takes an ActiveId so we can't hover something else. (ref #1381, #1337)
@ocornut
Copy link
Owner

ocornut commented Nov 7, 2023

Please note that BeginChildFrame() now has been obsoleted in favor of using BeginChild() with the ImGuiChildFlags_FrameStyle flag. See commit cdbc21a.

I have currently made ImGuiChildFlags_FrameStyle automatically set the ImGuiWindowFlags_NoMove flag but since the API changed I may backtrack on this. However it seems more consistent for user experience to do it.

Those functions were merely PushStyle/PopStyle helpers and custom versions are easy to create.

(The removal isn't so much motivated by needing to add the feature in BeginChild(), but by the necessity to avoid BeginChildFrame() signature mismatching BeginChild() newer signature and features.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants