Recent

Author Topic: visual layout not working  (Read 1109 times)

petex

  • Jr. Member
  • **
  • Posts: 81
visual layout not working
« on: November 03, 2024, 01:31:11 pm »
I started to modify a working demo. I added a 2D grid of buttons. The left column has the property "pos relative to parent" as rpLeft, the middle column to rgCenterHorizontal and the right hand column to rpRight.

When I run it, each column is superimposed at the top and there is no vertical separation of the buttons. The top most button is active, If I just design a layout with no anchoring, every visual object appears at the top left.

So the visual layout bears no relation to what actually happens.

How can I achieve my aim here ?

kirchfritz

  • Jr. Member
  • **
  • Posts: 63
  • WIN11 LAZ 2.2.4 FPC 3.2.2
Re: visual layout not working
« Reply #1 on: November 03, 2024, 03:19:05 pm »
Is this, what you want to achieve?


petex

  • Jr. Member
  • **
  • Posts: 81
Re: visual layout not working
« Reply #2 on: November 03, 2024, 03:25:25 pm »
yes something like that

petex

  • Jr. Member
  • **
  • Posts: 81
Re: visual layout not working
« Reply #3 on: November 03, 2024, 03:26:57 pm »
ok, you have three panels.
In the first panel, how do you get the buttons to anchor such that they form a column ?

dseligo

  • Hero Member
  • *****
  • Posts: 1406
Re: visual layout not working
« Reply #4 on: November 03, 2024, 03:58:06 pm »
ok, you have three panels.
In the first panel, how do you get the buttons to anchor such that they form a column ?

In Button2 set Anchor property to be Button1.
In Button3 set Anchor property to be Button2.
In Button4 set Anchor property to be Button3.

Then in Button2, Button3 and Button4 in PosRelativeToAnchor in object inspector check 'raBelow' (see attachment).

If you will still have problem, post unit and form files here.

MarkMLl

  • Hero Member
  • *****
  • Posts: 7999
Re: visual layout not working
« Reply #5 on: November 03, 2024, 05:07:17 pm »
If the particular controls you're using have an "Anchors" property, you'll find that the Anchor Editor accessible from the "..." to the right of the value field will make things enormously easier.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dseligo

  • Hero Member
  • *****
  • Posts: 1406
Re: visual layout not working
« Reply #6 on: November 03, 2024, 09:07:34 pm »
If the particular controls you're using have an "Anchors" property, you'll find that the Anchor Editor accessible from the "..." to the right of the value field will make things enormously easier.

You can't use Anchor Editor in LAMW.

kirchfritz

  • Jr. Member
  • **
  • Posts: 63
  • WIN11 LAZ 2.2.4 FPC 3.2.2
Re: visual layout not working
« Reply #7 on: November 03, 2024, 10:26:24 pm »
ok, you have three panels.
In the first panel, how do you get the buttons to anchor such that they form a column ?

here is my sourcecode

I am using the panels childsizing property
see screenshot
« Last Edit: November 03, 2024, 11:00:25 pm by kirchfritz »

MarkMLl

  • Hero Member
  • *****
  • Posts: 7999
Re: visual layout not working
« Reply #8 on: November 04, 2024, 09:27:47 am »
You can't use Anchor Editor in LAMW.

My apologies, I'd not spotted the OS.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dseligo

  • Hero Member
  • *****
  • Posts: 1406
Re: visual layout not working
« Reply #9 on: November 04, 2024, 09:39:03 am »
You can't use Anchor Editor in LAMW.

My apologies, I'd not spotted the OS.

MarkMLl

Np. I usually don't notice in what board message is, but "pos relative to parent" and "rpLeft" caught my eye (since I use LAMW).

MarkMLl

  • Hero Member
  • *****
  • Posts: 7999
Re: visual layout not working
« Reply #10 on: November 04, 2024, 09:44:04 am »
Np. I usually don't notice in what board message is, but "pos relative to parent" and "rpLeft" caught my eye (since I use LAMW).

In my own feeble defence, I'd read the thread ans specifically looked for info on the OS etc. in the OP.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018