Recent

Author Topic: Lazarus 4: Changes in ChildSizing in Lazarus 4?  (Read 1429 times)

stem

  • Jr. Member
  • **
  • Posts: 98
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #15 on: May 30, 2025, 06:22:44 pm »
How can I use that code?

I know that I can rebuild Lazarus IDE, but how can I open the existing wincontrol.inc and apply the posted diff?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11333
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #16 on: May 30, 2025, 06:28:23 pm »
On windows there should be a "patch.exe" in the fpc folder. On Linux "patch" is often part of the distro.

cd lazarus
patch <the_patchfile

You may or may not need a newline at the end... not sure.

Also the leading git stuff, may have to go for patch. (all to and including the "index" line)




In case of this patch, you can just open the file in an editor, and go to line 1399++

The lines with leading "-" are currently in there, and need to be removed.
The lines with leading "+" will go in instead (without the +).

The other lines are kept as they are.

Remove 2 lines, add 6 lines

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11333
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #17 on: May 30, 2025, 07:03:25 pm »
It does get some column sizes wrong.

Actually, it doesn't. It does seem to work.

I overlooked that your Panel7 has a MaxWidth. As soon as I set that (and the 2 TShape) to ccaLeftTop, then it looks all good.



I will need to do some more testing.

stem

  • Jr. Member
  • **
  • Posts: 98
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #18 on: May 30, 2025, 08:45:45 pm »
Ah, that looks really nice.

Just to be sure: what components have to have the property
ccaLeftTop? And is it for both CellAlignHorizontal and CellAlignVertical?

stem

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11333
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #19 on: May 30, 2025, 09:00:13 pm »
Ah, that looks really nice.

Just to be sure: what components have to have the property
ccaLeftTop? And is it for both CellAlignHorizontal and CellAlignVertical?

Any component with a Constraint.MaxWidth <> 0  needs CellAlignHorizontal = ccaLeftTop.
And any component with a Constraint.MaxHeight <> 0  needs CellAlignVertical = ccaLeftTop.

Because, if they are ccaFill, then they want to fill their entire cell, and if they can't grow, the cell may shrink.

So in your examples you had 2 TShape, with "MaxWidth = 8" and that is what brought the first column to be 8 pixel narrow.
Yes, they conflict with the labels MinWidth = 80 => but only one can win.



I will add that to the release notes.
I will also make sure the fix goes into Lazarus 4.2.



stem

  • Jr. Member
  • **
  • Posts: 98
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #20 on: May 30, 2025, 09:37:43 pm »
Thank you, everything works fine.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11333
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 4: Changes in ChildSizing in Lazarus 4?
« Reply #22 on: June 02, 2025, 01:24:13 pm »
If you have a moment, I prepared some updates to the docs.

Since you seem to have used this extensively, it would be nice if you could have a glance at the changes and see if you find anything at odds.

https://gitlab.com/martin_frb/lazarus/-/compare/main...9cc22c439564936fa3bbb08306cc1e0a9ccb72a0?from_project_id=28419588

Thanks.

 

TinyPortal © 2005-2018