[fpc-devel] [PATCH] FCL-DB: Extend TLookupList so it can be used as picklist source

Alexander Klenin klenin at gmail.com
Tue Oct 14 17:32:51 CEST 2008


Attached patch does two things:
1) Makes TLookupList.FList protected instead of private
2) Adds new TLookupList methods to access all values and to find key by value

These are required to implement picklist editor for lookup fields
in DBGrid component of Lazarus, see:
http://bugs.freepascal.org/view.php?id=12347
http://wiki.lazarus.freepascal.org/Lazarus_0.9.26_todo
(where this feature was once targeted for 0.9.26, but postponed)
and a recent thread in Lazarus mailing list.

Note that although the code is rather straightforward and was copied
almost directly
from the patch in the bug report above, it was only compile-tested.
This is because the existing db test suite (fcl-db\tests) gives many failures,
so I hestitate to add more tests until those are resolved.

-- 
Alexander S. Klenin
Insight Experts Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db_lookuplist.patch
Type: application/octet-stream
Size: 1555 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20081015/c7bebaa4/attachment.obj>


More information about the fpc-devel mailing list