Recent

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

loaded

  • Hero Member
  • *****
  • Posts: 825
[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 »
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

wp

  • Hero Member
  • *****
  • Posts: 11916
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.

loaded

  • Hero Member
  • *****
  • Posts: 825
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.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

avra

  • Hero Member
  • *****
  • Posts: 2514
    • 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

  • Hero Member
  • *****
  • Posts: 825
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.


Check out  loaded on Strava
https://www.strava.com/athletes/109391137

wp

  • Hero Member
  • *****
  • Posts: 11916
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.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

loaded

  • Hero Member
  • *****
  • Posts: 825
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 »
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018