07-31-2019 10:52 AM - edited 07-31-2019 10:53 AM
I am trying to learn how to use the Splitter control to make a resizable window where some content (like a table or text box) resizes, but other controls (like buttons) just move.
I found the docking example, and it is exactly what I am trying to recreate.
When I try to build my UI, it seems to work as I want when resizing, but it messed up when I maximize. I am clearly not anchoring things the same way the docking example does, and I am unsure where I can see those settings.
NOTE: My recreation appears to work fine on my main monitor, but messes up on a secondary monitor. But, the docking example works fine on both.
I see where you set it when you add/link something to a splitter, but I don't see how to tell how things are set in the docking example. Is there a reference/tutorial that explains how it was built?
Thanks!
Solved! Go to Solution.
08-01-2019 12:43 AM - edited 08-01-2019 12:44 AM
The docking example does really nothing in the code, as 99% of its functionality lies in the built-in capabilities of the splitter controls.
To understand how controls are tied to the splitters you need to edit one of them, then hit Attach/Detach Controls... button: in the following window click on a control in the right area and see how it is configured in the Attachment Mode control below:
08-01-2019 08:03 AM - edited 08-01-2019 08:11 AM
I've done that, but still get different behavior in my UI versus the docking example. On mine, at around a screen height of 1200, it stops moving items down with the bottom of the screen. Whenb I start decreasing the height, everything shifts up (even though there is a big gap at the bottom). I "assume" there must be more settings in the docking example I am unaware of. I've simple made a panel, added the splitter to the right and bottom and named them similarly (VSPLITTER, HSPLITTER) and attached a few things to the right, a few things to the bottom, and a few to both (bottom right buttons, so they stick to the bottom right). It all works unless the screen gets too tall.
Yet docking does not have this issue. Very odd. I need to figure out what I am not doing.
08-05-2019 12:24 PM
Could what I am seeing be tied to the "Operation Range" settings of "Top Side Auto Range" and "Bottom Side Auto Range"? Mine are both checked, just like the docking example, so probably not. I'm not sure what else could limit the automatic splitter moving to cause it to stop (but still move the other direction).
08-05-2019 12:38 PM
SOLVED.
One of my Splitters was accidentally attached to the other Splitter. That was causing the results I was seeing. Once I removed it, it now works like the docking example.
Thank goodness for those dotted lines, or I never would have caught it. I didn't realize the lines I'd been looking at were an attachment -- I thought they were just connecting all the anchored objects together 🙂