Just a small update, I managed to implement the resizing logic and it was really, really easy. Most of my time went away by drawing the transparent, themed, system default resize gripper...
...which almost can not be seen on dark styles, so totally with it! 👍
Frames above and below are adjusting properly, not changing places or jumping around. Overflow is handled correctly by the alClient scrollbox, if the contents grow too large for the window.
The only thing is that I did not use splitters, I wrote the resizing logic myself (which is awfully long, like 10 lines of code?)
Procedure TMultiLineParamFrame.ResizeHandleImageMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Begin
_resizing := True;
SetCapture(Self.Handle);
End;
Procedure TMultiLineParamFrame.ResizeHandleImageMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
relative: TPoint;
begin
If Not _resizing Then Exit;
relative := ScreenToClient(Mouse.CursorPos);
If relative.Y > 47 Then Height := relative.Y; // Burned in magic number, because we all love them!
End;
Procedure TMultiLineParamFrame.ResizeHandleImageMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Begin
ReleaseCapture;
_resizing := False;
End;
Drawing the gripping handle:
Constructor TMultiLineParamFrame.Create(AOwner: TComponent);
Var
bmp: TBitmap;
Begin
inherited;
_resizing := False;
bmp := TBitmap.Create;
Try
bmp.Height := 16;
bmp.Width := 16;
bmp.TransparentColor := clYellow;
bmp.Canvas.Brush.Color := bmp.TransparentColor;
bmp.Canvas.FillRect(Rect(0, 0, bmp.Width, bmp.Height));
StyleServices.DrawElement(bmp.Canvas.Handle, StyleServices.GetElementDetails(tsGripper), Rect(0, 0, bmp.Width, bmp.Height));
ResizeHandleImage.Picture.Assign(bmp);
Finally
FreeAndNil(bmp);
End;
End;