TPairSplitter constraints lazarus / 31-LCL ---------------------------------------------------------------------- MarkMLl · 2020-09-12 11:03 I've got a piece of legacy code that I'm porting from Delphi as a long-term exercise. On account of its age there's been various new components arrive, and some of the older hacks I'm using are probably inappropriate. I've got a form containing a TPairSplitter with a top and bottom pane. In the top pane I've got a TStringGrid being used for text output. In the bottom I've got another TPairSplitter with left and right panes, where the left is a checkbox and the right is a laboriously- constructed grid-of-panels-in-TFrames showing monitoring status. How can I set up the splitters so that when the height of the form changes the top pane height tracks it but the bottom pane height is preserved, and when the width of the form changes the bottom-left pane width tracks it but the bottom-right pane width is preserved? The form size and splitter positions are normally locked, so that if a user takes a screenshot for support the grid-of-panels is always intact. Splitters are used for historical reasons, but there are scenarios where a skilled user might want to enlarge the top transcript even if this broke the grid-of-panels on a small display. I suspect that what I'm asking is whether TPairSplitterSide had a property exactly equivalent to TForm.AutoSize, i.e. that accurately wraps the corm around its content. What I'm currently seeing on both GTK2 and Qt is that if I click the "easter egg" that changes the form from bsDialog to bsResizeable and then enlarge it, the vertical panels behave as required up to a point, then it starts trying to resize the part that I want locked. If I revert to bsDialog then go to bsResizeable I can resize it some more until things go wrong and so on. So far I've not seen anything in my code that accounts for that. MarkMLl ---------------------------------------------------------------------- wp · 2020-09-12 11:29 Legacy code with a PairSplitter ported from Delphi? How's that? AFAIK, Delphi does not have a PairSplitter... With ordinary TSplitters I would set TopPanel.Align := alClient and BottomPanel.Align := alBottom and HorSplitter.Align := alBottom. And for the bottom panel I would set BottomLeftPanel.Align := alClient and BottomRightPanel.Align := alRight and BottomSplitter := alRight. But I must say that I do not fully understand the rest of the question. ---------------------------------------------------------------------- MarkMLl · 2020-09-12 12:26 Quote from: wp on September 12, 2020, 01:29:20 pmLegacy code with a PairSplitter ported from Delphi? How's that? AFAIK, Delphi does not have a PairSplitter... That's the whole point: I started off using a simpler splitter but am now using a TPairSplitter which seems a better match. But by doing so I might have painted myself into a corner. QuoteWith ordinary TSplitters I would set TopPanel.Align := alClient and BottomPanel.Align := alBottom and HorSplitter.Align := alBottom. And for the bottom panel I would set BottomLeftPanel.Align := alClient and BottomRightPanel.Align := alRight and BottomSplitter := alRight. I think that's the problem: it doesn't have a property indicating which side of the splitter is to be resized by default. Playing with a cut-down project (no special OnResize handlers) seems to indicate that when the container is resized either the top or left pane size stays constant (presumably because the spliiter position is in pixels relative to the top or left). What I want is for the top or left to be resized and the bottom or right to stay constant. It's cosmetic and probably not worth trying to fix, but I was interested in case I was overlooking something. MarkMLl ---------------------------------------------------------------------- wp · 2020-09-12 15:21 Here is the code according to my description above. In my eyes it fulfills the requirement that "when the height of the form changes the top pane height tracks it but the bottom pane height is preserved, and when the width of the form changes the bottom-left pane width tracks it but the bottom-right pane width is preserved" The reason why I don't understand the rest of your post probably is that I don't know what that mysterious "grid-of-panels-in-TFrames" is. ---------------------------------------------------------------------- MarkMLl · 2020-09-12 15:32 Found it. When resize started I was setting the maximum height constraint of the side which was to be adjusted to be the existing height of the form, which is obviously incorrect. MarkMLl ---------------------------------------------------------------------- Zoran · 2020-09-12 17:58 See: https://forum.lazarus.freepascal.org/index.php/topic,39545.msg271 831.html#msg271831 ---------------------------------------------------------------------- MarkMLl · 2020-09-12 19:25 @Zoran thanks, noted. MarkMLl