Recent

Author Topic: [SOLVED] Resizing (8 little-squares) Handles on Controls/Objects  (Read 4350 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
I am experimenting with moving controls on a form... that works.

However, I want to be able to manually resize a control using those little squares that surround an object.
You know, kind of what they do in graphic programs.

I am thinking of using the drawing features, but not sure if that is the best way.
Can anyone shed any light on what THE BEST way to go about this would be?

Thanks in Advanced.
« Last Edit: April 23, 2017, 01:16:19 pm by technipixel »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #1 on: April 23, 2017, 04:52:33 am »
Okay... here is my crude resize handles using the canvas.

I can easily show or hide the handles & marquee when clicking on/off object.
I need to clean it up, but good enough for now.

Issues...

1) This is drawn on a canvas on the form. So, if I had multiple objects that overlapped, an object could cover the canvas drawing. This would be a problem.

2) How do I go about hovering and dragging a "painted object" that isn't actually there.

Well, its a start.... still learning how to do this.

See attached...
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #2 on: April 23, 2017, 05:57:39 am »
TSizeControl v.7.2 by Angus Johnson. If I remember correctly this can be used as is in lazarus.

TJuhasResizeNodes v.1 by Juhas Software.  I think juha is a member of the lazarus team not sure though, if it is the same person then I bet that this will work on lcl as well.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #3 on: April 23, 2017, 12:35:04 pm »
@taaz

Thanks...
Both are Delphi

The TJuhas version doesn't have any main code to see how it's implemented.

The TSizeControl... seems much better when i run the included EXE.
However, when I try to port it over (using LAZ's Convert Delphic)
There are several errors... and I am not sure how to fix yet.

Hmm... no one has ported this over to LAZ yet so that it works?
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #4 on: April 23, 2017, 12:51:26 pm »
Here are all the errors, even after adding "Windows" to the "uses" clause
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

balazsszekely

  • Guest
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #5 on: April 23, 2017, 01:03:10 pm »
@technipixel
I converted once SizeControl component, but as far as I remember it only worked on windows. Anyway I attach the converted zip, feel free to run a few tests.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #6 on: April 23, 2017, 01:16:02 pm »
Perfect!!!

Thank you sir!
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Resizing (8 little-squares) Handles on Controls/Objects
« Reply #7 on: April 23, 2017, 01:34:50 pm »
TJuhasResizeNodes v.1 by Juhas Software.  I think juha is a member of the lazarus team not sure though, if it is the same person then I bet that this will work on lcl as well.
No it is not me. The source file says:
  author: Adam Jachocki (juhas@toya.net.pl)
So his name is not Juha. Maybe "juhas" means something in Polish. I don't know.
I happen to know that "juha" in Croatian language means "soup".

Anyway, the TJuhasResizeNodes code compiles after adding {$mode delphi}
and replacing unit Windows with LCLIntf.
I did not test how well it works.
« Last Edit: April 23, 2017, 01:43:28 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

wcleyton

  • Jr. Member
  • **
  • Posts: 80
Re: [SOLVED] Resizing (8 little-squares) Handles on Controls/Objects
« Reply #8 on: May 05, 2017, 02:03:48 am »
Hello,

How to make guide lines with SizeControl?

Look Attach.

Thankful For Attention

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: [SOLVED] Resizing (8 little-squares) Handles on Controls/Objects
« Reply #9 on: May 05, 2017, 03:02:02 am »
Cool.... thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

 

TinyPortal © 2005-2018