* * *

Author Topic: I would like the PickList in TItemProp to be enhanced.  (Read 567 times)

jamie

  • Hero Member
  • *****
  • Posts: 786
I would like the PickList in TItemProp to be enhanced.
« on: January 27, 2018, 03:04:20 pm »
Currently the Picklist inside the TItemProp class has a PickList:TstringList for which you need to
populate the list..

 This works fine as it is however, the population list is also used elsewhere in many places in most cases and it
does cause duplication of memory. So using a constant array of strings helps this out however, you still need
to add this to the Picklist which just simply duplicates it and in many cases many times!

 I purpose that we have a enhanced version of the TstringList (Subclass) that does some overrides to allow
a reference to the constant array of strings..

 So this is what happens:

   Have a property to allow references to a static string array
   
   Property Staticstrings:TStrings;

  and also a index property that can allow where they are to be shown:

    1. Before any normal striings like the list;
    2. Inserted betweed normal strings in the list;
    3,.Or at the End of the list..

 This way one can have an empty list but point to a static list or have the static list attached itself
at the end or insert itself at the beginning of existing or additional strings added the normal way..

 By doing this you can have many of these list simply point to a fixed single instant that shows up in
various places used in list controls.

  if you use a Tstringlist base control as is now, it should still work with existing code.

 I am always in search of saving space and speeding things up, making a reference to fixed array that is
used all over is a great idea but we cases where controls/objects are using TStringlist to show these and they
just duplicate the load and it takes CPU time to load them of course!
 
 What do you think ?


jamie

  • Hero Member
  • *****
  • Posts: 786
Re: I would like the PickList in TItemProp to be enhanced.
« Reply #1 on: January 28, 2018, 01:05:24 am »
Well. after creating a TEnStringList to do as I wanted, which works nicely, I find out that the
TPiclListCellEditor already creates its own TSrings base for which it just loads it into the
systems TComobBox...

 So there isn't any advantage here for this particular situation...
 
 Oh well, at least I can put this one I made on the back burner for later ;)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus