Lazarus
Programming => General => Topic started by: Jonny on February 21, 2025, 02:53:06 pm
-
I have a TPanel at the top of my form with a TSplitter below it and another TPanel below that.
But Splitter.MinSize only works for the top panel TPanel.Constraints.MinHeight is required for the bottom one.
According to the documentation for TSplitter
lazarus/docs/xml/lcl/extctrls.xml
TCustomSplitter.MinSize
Minimum size for either of the anchored controls on opposing sides of the splitter.
MinSize indicates the smallest size allowed for either of the anchored controls
on opposing sides of the splitter. MinSize is used in the MoveSplitter method to
prevent adjacent controls from becoming too small when the splitter is dragged.
The default value for the property is 30 (pixels). When set to 0 (zero), an adjacent
control can be resized until is no longer visible. MinSize does not accept negative
Integer values in the property.
Is this a bug or am I doing something wrong? Minimal project is attached.
(Also, TSplitter has a Color property which is not respected, ParentColor is set to False)
-
Well, documentation can always be wrong out out-dated. But when I look at the source code there is an internal function GetControlConstraintsMinSize(Control: TControl): Integer, and this is called with the arguments CurResizeControl and CurOtherResizeControl. This makes me believe that the constraints are intended to be effective for both sides.
Please file a bug report so that the issue is not forgotten.
-
Is this a bug or am I doing something wrong?
I think the constraint property of the panels conflict with TSplitter.
I made a simple project.
Placed Panel1, set Align=alTop.
Placed Splitter1, set Align=alTop, AutoSnap=False.
Placed Panel2, set Align=alClient.
Everything is working as expected: the minimum size of both panels is 30.
-
Placed Panel1, set Align=alTop.
Placed Splitter1, set Align=alTop, AutoSnap=False.
Placed Panel2, set Align=alClient.
From the wiki https://wiki.freepascal.org/TSplitter
TSplitter can work basically in two different modes: via Align (the Delphi way) or via AnchorSides (not supported by Delphi).
I am using AnchorSides for additional flexibility.
Please file a bug report so that the issue is not forgotten.
Ok, will do.
-
Submitted: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41450