Recent

Author Topic: location of non visual component  (Read 1512 times)

Paolo

  • Hero Member
  • *****
  • Posts: 515
location of non visual component
« on: April 17, 2024, 08:35:32 pm »
Hello,

after a conversion of a delphi demo program, I can see in the object inspector the presence of TImageList componente, but I did not see it on the form. Just espanding to full screen, on wide screen, I can see it in the bottom left corner.

the question is :  for similar situation How can bring non visual componets in a "visible" area ? non visual component obviously dos not have Top/left.
It could be useful to have a editor command to bring such kind of component in a reachable visble area ?

Ciao.

cdbc

  • Hero Member
  • *****
  • Posts: 1157
    • http://www.cdbc.dk
Re: location of non visual component
« Reply #1 on: April 17, 2024, 08:45:20 pm »
Hi
1) select the component in the Object Inspector
2) change the 'Left' & 'Top' properties until you see the component...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

wp

  • Hero Member
  • *****
  • Posts: 11993
Re: location of non visual component
« Reply #2 on: April 17, 2024, 10:09:42 pm »
This is not working because non-visual components do not have Left and Top in the Object Inspector. But these properties exist in the lfm file - so, close the IDE, open the lfm file in an external editor, find the non-visual components and correct their Left and Top values so that they are inside the form. Save. Open the form in the IDE, and the non-visuals should be visible, adjust their position as needed.
« Last Edit: April 17, 2024, 10:11:22 pm by wp »

Paolo

  • Hero Member
  • *****
  • Posts: 515
Re: location of non visual component
« Reply #3 on: April 17, 2024, 11:37:22 pm »
Thanks for the information.
@wp, why not put top/left in the object inspector? This could be useful in such situation.

VisualLab

  • Sr. Member
  • ****
  • Posts: 355
Re: location of non visual component
« Reply #4 on: April 17, 2024, 11:58:55 pm »
Thanks for the information.
@wp, why not put top/left in the object inspector? This could be useful in such situation.

TImageList comes from the TComponent class, which does not have the "Left" and "Top" properties. These properties appear in the TControl class. It appears that the positioning (i.e. "Left" and "Top" "properties" in LFM file) of non-visual objects (i.e. those located in the inheritance tree outside the TControl class) at the design stage is managed by the Lazarus GUI editor (forms and data modules).
« Last Edit: April 18, 2024, 10:36:55 am by VisualLab »

gerardus

  • Jr. Member
  • **
  • Posts: 93
Re: location of non visual component
« Reply #5 on: April 18, 2024, 04:16:44 pm »
Crude solution:

Open the .lfm file with a text editor and search for your TImageList

  object ImageList1: TImageList
    Left = 148
    Top = 60
  end

and modify the Left and Top.
And yes, it would nice to have an IDE command to center "lost" components in the form.

 

TinyPortal © 2005-2018