Recent

Author Topic: [SOLVED] Adding an LCL Component...at runtime  (Read 3082 times)

WickedDum

  • Full Member
  • ***
  • Posts: 211
[SOLVED] Adding an LCL Component...at runtime
« on: October 10, 2016, 08:10:55 pm »
I should put a radio button here - either YES or NO.    :D

I'm a big supporter of user-friendly - if the user has to think about what he or she wants to do, it is not user-friendly.  Always thinking of alternatives...

I would like to add or even change an LCL component based on a specific input from a user.  Is this possible?

I'm not sure the VISIBLE property will provide what I want...  I don't know if adding a form would modify only a little bit of the current/active form...?  To me, adding a form would be the same as changing the entire form you are working with, correct? 

Any thoughts?

Thanks!!



« Last Edit: October 10, 2016, 08:24:08 pm by WickedDum »
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: [SOLVED] Adding an LCL Component...at runtime
« Reply #1 on: October 10, 2016, 08:24:53 pm »
I did it.  VISIBLE it is!!!

Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: [SOLVED] Adding an LCL Component...at runtime
« Reply #2 on: October 10, 2016, 08:39:48 pm »
I would like to add or even change an LCL component based on a specific input from a user.  Is this possible?

The LCL makes this eminently possible.
Usually the biggest headache is the subsequent adjusting of the the layout of a user-customisable form.
Adding/removing controls that take up much screen space has a major effect on the positioning of remaining/existing controls.
Are you happy for parts of your form to scroll out of view?
Do you want to constrain user-changes to always happen within the normally visible area?
What extent of user-customisation are you prepared to program and maintain?
If the user changes the font/default language/high dpi setting etc., will that mess up the layout irretrievably?
How can the user undo her changes if the needed reset-control is now not in view? etc.
Often the simpler a form is (apparently) to use and customise, the more complex the code engine behind it (not always, of course, but often enough to make you think twice about adding too many customisable features).

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: [SOLVED] Adding an LCL Component...at runtime
« Reply #3 on: October 10, 2016, 09:19:20 pm »
Good questions, Mr. howardpc.

It appears others contemplate the multitude of results of one's actions before they start!

Usually the biggest headache is the subsequent adjusting of the the layout of a user-customizable form.
The layout (which includes its properties) of the regular form is enough to drive one nuts!!  Not to mention the time it takes...

Thanks for your thought-out input!
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

 

TinyPortal © 2005-2018