Recent

Author Topic: Auto-alignment of TLabels and TEdits - and anything else  (Read 4158 times)

WickedDum

  • Full Member
  • ***
  • Posts: 211
Auto-alignment of TLabels and TEdits - and anything else
« on: September 10, 2016, 11:33:15 pm »
I saw items being dropped in (a TPanel?) and they were auto-aligning.  I created a TPanel but cannot seem to get it working.  Auto-alignment seems a lot easier than trying to get them lined up manually! :D

How do I do that?

Thank you!!
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #1 on: September 10, 2016, 11:34:07 pm »
You created 2 themes with the same content  ::)
The other is here
http://forum.lazarus-ide.org/index.php/topic,34000.msg221667/topicseen.html#new

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #2 on: September 10, 2016, 11:43:01 pm »
I noticed.  I couldn't delete it...sorry.
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #3 on: September 10, 2016, 11:51:32 pm »
Thank you for the child-sizing!!!

Here is a print screen.  I was trying different things and got a few labels out of order.  How do I insert them correctly?

Thanks!!
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #4 on: September 11, 2016, 12:14:27 am »
Im not with lazarus right now but try controls per line 1 and align top to bottom, in childsizing of panel.

Angus

  • New Member
  • *
  • Posts: 16
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #5 on: September 11, 2016, 12:14:59 am »
Hi
Select the controls using the shift key and the LH mouse button.  With the mouse cursor over one of the selected controls RH mouse click and select 'Align...'.  This will pop up a window with various options.  You will need to get your controls in roughly the right order before doing this, however once you have an order of your liking you just let the IDE do the rest.
You may also consider View>Anchor Editor to manage the placement of controls on the form during run time. This latter functionality is a considerable improvement over the Delphi XE5 IDE btw.

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #6 on: September 11, 2016, 12:19:53 am »
That's ok. But the main advantage of childsizing is that will work with any font size and no re-align is required. Is automatic.

Edit: Attached picture with the settings and the result.

If you get some out of order change the Z order of labels.
« Last Edit: September 11, 2016, 12:26:41 am by lainz »

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #7 on: September 11, 2016, 03:23:13 am »
I've toiled with this thing for hours today.  I know I have to be patient with something new, but some of these properties changed by themselves!!!  ;)

What file contains the numbers/text of the form data?  (The file that contains the locations and configurations of the controls.)  I'll do this old-school!

Thanks!!
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #8 on: September 11, 2016, 03:46:33 am »
I've toiled with this thing for hours today.  I know I have to be patient with something new, but some of these properties changed by themselves!!!  ;)

What file contains the numbers/text of the form data?  (The file that contains the locations and configurations of the controls.)  I'll do this old-school!

Thanks!!

The lfm file. Please learn how to use it, once you master it will never use other solution.  :D

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #9 on: September 11, 2016, 03:58:50 am »
Understand.  But right now I need to move past this frustration to feel that I accomplished something today!

If I modify the lfm file, will it carry over to the other files, too?  In other words, will modifying the lfm file give em the results I want?

Thanks!!
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Auto-alignment of TLabels and TEdits - and anything else
« Reply #10 on: September 11, 2016, 04:04:28 am »
The lfm is the form itself, if you change the numbers or something from it, it will change like you change the form with the editor.

Do it with care since you can broke that file and the form maybe can't be loaded again.

So better use the method of aligning that Angus said if you prefer.

 

TinyPortal © 2005-2018