Recent

Author Topic: [Solved] How to open sizeboxes of Shape Control at runtime?  (Read 726 times)

loaded

  • Full Member
  • ***
  • Posts: 127
[Solved] How to open sizeboxes of Shape Control at runtime?
« on: October 02, 2019, 11:28:04 am »
Hi All
Sizeboxes open and running at design time,but it disappears at runtime.
Can we view them at runtime ?


http://delphidabbler.com/tips/93 There is a study on the subject, but it works on Wincontroller. :(


« Last Edit: October 04, 2019, 01:22:34 pm by loaded »
Installing the spelling, google translate is used :)

wp

  • Hero Member
  • *****
  • Posts: 7043
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #1 on: October 02, 2019, 12:17:29 pm »
The JvRunTimeDesign package of JVCL does show size boxes around any controls (installable via OPM, see JvDesigner example). Maybe overkill for your purpose.

Some thoughts how I would do it for a general solution (untested):
- Define a class TSizeBox for a single size box. Has property "Position = (pEast, pSouthEast, pSouth, pSouthWest, pWest, ...)" and "Control". Is drawn at the corresponding position of the Control. Has mouse event handlers for dragging the size boxes in the direction corresponding to the Position parameter. The new position of the size box is applied to the corresponding size parameter of the control.
- Define a class TSizeBoxes for all size boxes of a control. Has property "Control"
- The "TSizePanel" gets a method "ShowSizeBoxes" which creates the TSizeBoxes and displays them. "HideSizeBoxes" removes them again.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

loaded

  • Full Member
  • ***
  • Posts: 127
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #2 on: October 02, 2019, 12:47:48 pm »
wp, We have similar ideas.
I thought maybe there was a shorter path.
Thank you very much for your answer.
Installing the spelling, google translate is used :)

avra

  • Hero Member
  • *****
  • Posts: 1884
    • Additional info
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #3 on: October 03, 2019, 11:57:56 pm »
I thought maybe there was a shorter path.
There is, as wp has already mentioned: https://wiki.freepascal.org/JVCL_Components#JvRuntimeDesign
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

loaded

  • Full Member
  • ***
  • Posts: 127
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #4 on: October 04, 2019, 07:47:58 am »
avra thank you for your answer.

The solution on the https://www.thoughtco.com/how-to-move-and-resize-controls-at-run-time-4092542 seemed more convenient to me as it was ease of use.


Installing the spelling, google translate is used :)

wp

  • Hero Member
  • *****
  • Posts: 7043
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #5 on: October 04, 2019, 12:02:11 pm »
The solution on the https://www.thoughtco.com/how-to-move-and-resize-controls-at-run-time-4092542 seemed more convenient to me as it was ease of use.
But they don't explain how to draw the size boxes which was the topic of your question.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Thaddy

  • Hero Member
  • *****
  • Posts: 10098
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #6 on: October 04, 2019, 12:39:52 pm »
I wrote something for KOL about 20 years ago http://members.chello.nl/t.koning8/kolfrmdesign.zip
Maybe of help, because it shows how to make a simple designer and a size control. Needs some work to use it with lazarus, but the algorithms are self explaining.
I am more like donkey than shrek

loaded

  • Full Member
  • ***
  • Posts: 127
Re: How to open sizeboxes of Shape Control at runtime?
« Reply #7 on: October 04, 2019, 01:15:11 pm »
Thaddy and wp thank you very much for your answers.
Wp was not exactly what I wanted, but the method was available, so I did a work on him.
Thaddy 20 years is a long time, thank you very much for your case study. Health in your hands.
I finally did what I wanted (might be a little amateur)
Let's put it here maybe someday it might help someone :)
« Last Edit: October 04, 2019, 01:18:34 pm by loaded »
Installing the spelling, google translate is used :)

Thaddy

  • Hero Member
  • *****
  • Posts: 10098
Re: [Solved] How to open sizeboxes of Shape Control at runtime?
« Reply #8 on: October 04, 2019, 01:28:51 pm »
20 years was rounding mode: actually 17 years.. :D
Glad you have a working solution.
I am more like donkey than shrek

 

TinyPortal © 2005-2018