Recent

Author Topic: set object Top,Left at once;  (Read 1597 times)

guest62577

  • Guest
set object Top,Left at once;
« on: May 27, 2018, 09:23:09 pm »
hello there. . .

how can a Object being set to a new position Top and Left at once;
which meaning without set set Top at a command line, then setting Left at another command line;

issued situation:
Code: Pascal  [Select][+][-]
  1. object1.Top := 100;
  2. object1.Left := 200;

wondering situation:
Code: Pascal  [Select][+][-]
  1. object1.position := (100,200);

[?] this way, avoiding Object effect like going stairs Up\Down instead straight at each step;

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: set object Top,Left at once;
« Reply #1 on: May 27, 2018, 09:29:27 pm »
There's method SetBounds(Left, Top, Width, Height);.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: set object Top,Left at once;
« Reply #2 on: May 27, 2018, 11:45:25 pm »
For clarity the SetBounds accepts  the Left,Top, Width and Bottom how ever, using GetBounds
reports the Left, Top, Right, Bottom. It does not report width, of course you can calculate that with the
returned info.

So using the "BoundsRect" property will return a TRECT and from that you can obtain the width if
desired. But setting that property requires that you enter the Left,top, width and Bottom as I described.



The only true wisdom is knowing you know nothing

guest62577

  • Guest
[SOLVED] Set Object Top,Left at Once;
« Reply #3 on: May 27, 2018, 11:59:47 pm »
Hey, fantastic;
the SetBounds name is way out of meaning; [ :-\] then it works perfectly; (so simple);

it is a nice progress -if- when at the moment to get there and construct very focused logics;
[^] the software is still fine on windows right, about the UWP not being the Lazarus-IDE Tool;  %) {that's where it goes};

very well;

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: [SOLVED] Set Object Top,Left at Once;
« Reply #4 on: May 28, 2018, 12:01:34 am »
Hey, fantastic;
the SetBounds name is way out of meaning; [ :-\]
bounds is short for boundaries what do expect it to mean?

 

TinyPortal © 2005-2018