Recent

Author Topic: Problem with items in groupboxes when converting a Delphi app  (Read 3288 times)

JR1234

  • New Member
  • *
  • Posts: 11
When I import a delphi project all items within groupboxes are shifted down.

I have attached the simplest Delphi project to demonstrate.  When loaded in Delphi the buttons are correctly aligned within the groupbox.  Once converted into a Lazarus project and run the buttons are all moved downwards a little.

Any fix for this?  It isn't too bad in a small app, but for a larger app it is a pain to go through all the groupboxes and move the inner components up again.  And at this stage I really want to keep both Delphi and Lazarus versions going until the full conversion works, so having to move every groupbox components every conversion will drive me mad.


zeljko

  • Hero Member
  • *****
  • Posts: 1624
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Problem with items in groupboxes when converting a Delphi app
« Reply #1 on: May 13, 2014, 07:13:27 am »
That's becase LCL's TGroupBox have offset (client rect covers only part below title).Probably Juha can fix that ...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4498
  • I like bugs.
Re: Problem with items in groupboxes when converting a Delphi app
« Reply #2 on: May 13, 2014, 08:28:12 am »
That's becase LCL's TGroupBox have offset (client rect covers only part below title).Probably Juha can fix that ...

That was fixed already ~3 years ago. The converter Settings dialog has "Coordinate Offsets". The default top offset for TGroupBox is 14.
JR1234, you can change the value if needed. We can also change the default if it is badly wrong.
JR1234, do you use the converter?
« Last Edit: May 13, 2014, 08:30:31 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

JR1234

  • New Member
  • *
  • Posts: 11
Re: Problem with items in groupboxes when converting a Delphi app
« Reply #3 on: May 14, 2014, 12:01:48 am »
Yes, I use the converter.  Using Lazarus 1.2.0 with FPC 2.6.2.

I open Lazarus and select Convert Delphi Project.

But your mention of the Coordinate Offsets did the trick.  By default they are Disabled, so that is why my groupbox members where shifted down.  When I enabled the option the conversion went fine and the controls within groupboxes are correctly aligned.  I don't think I would have disabled this option (not knowing what it did in the first place) so maybe enable it for the next release of Lazarus?

Thanks for the help.  ;D

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4498
  • I like bugs.
Re: Problem with items in groupboxes when converting a Delphi app
« Reply #4 on: May 14, 2014, 12:29:48 am »
By default they are Disabled [...]  so maybe enable it for the next release of Lazarus?

Yes, the default setting is not perfect. I think the good setting would be "Cross-platform" but no "Support Delphi", or maybe "Support Delphi", too, but not with the same DFM form file.

However the default settings are not very important because your settings are remembered. You need to make your favorite selection only once.

[Edit:] actually the default settings are just like I suggested, "Cross-platform" is checked but "Support Delphi" not.
It means you have changed the settings yourself.
« Last Edit: May 16, 2014, 08:54:00 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

YetAnotherDelphiLeaver

  • Newbie
  • Posts: 2
Re: Problem with items in groupboxes when converting a Delphi app
« Reply #5 on: May 31, 2024, 10:24:10 am »
Sorry for reviving this thread,
but I am currently trying to convert a medium large Delphi project to Lazarus and I am experiencing exactly those coordinate offset problems.

Specifically, I do not see any effect of the offset settings of the copnversion tool at all. All my TLabels within TGroupBoxes have Top=24 and that stays unchanged during the conversion. I have tried all combinations of offset values (negative, 0, positive), have increased the offset values and have played with the Enabled/Disabled setting and there is no change to the y position of the components whatsoever.

What could be the reason for this?

I am using Lazarus 3.4 (installed yesterday with the latest version from sourceforge), my settings are:
cross-platform: checked
support Delphi: unchecked
use same DFM: unchecked

Thanks a lot in advance!

wp

  • Hero Member
  • *****
  • Posts: 12153
Re: Problem with items in groupboxes when converting a Delphi app
« Reply #6 on: May 31, 2024, 11:45:16 am »
I sent this and other issues of the converter to the bug tracker: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40979. Maybe somebody takes care of it.

My personal experience with the converter is that it requires a lot of rework, and I normally do conversions manually.

 

TinyPortal © 2005-2018