Forum > Databases
[Solved] TBufDataset: Fielddefs Editor at Runtime
(1/1)
CharlyTango:
Given is a TBufDataset Component.
Which has the ability to define fields aka TFielddefs using the Lazarus GUI at DesignTime.
Q: How do i call/open the Fielddefs Editor at Runtime ?
cdbc:
Hi
Well, TDataset surfaces a property 'FieldDefs' which is a 'TCollection' descendant and as such has 'Add' & 'Remove' methods. You can just call them in your code, in this respect, /you/ are the 'FieldsDefs-Editor' ::)
Regards Benny
CharlyTango:
--- Quote from: cdbc on June 05, 2024, 01:41:39 am ---You can just call them in your code, in this respect, /you/ are the 'FieldsDefs-Editor' ::)
--- End quote ---
I know how to write code to manipulate Fielddefs.
But i don't want to reinvent a working editor. "It's not broken -- i don't want to fix it". I want to use it instead.
The Question is how to use this wellknown editor in a runtime application.
At least in which unit i can find it.
cdbc:
Hi
Look at the code where it's used and then follow this back up to where it registers itself as an editor, there you have the unit. My guess is, it's hiding in the 'Ide-Intf' department 8)
Regards Benny
dsiders:
--- Quote from: cdbc on June 05, 2024, 07:49:13 am ---Look at the code where it's used and then follow this back up to where it registers itself as an editor, there you have the unit. My guess is, it's hiding in the 'Ide-Intf' department 8)
--- End quote ---
It is. And it's intimately entwined with the IDE dialogs and its design surface. Not quite plug-and-play reusable, but it's a start.
$(lazarusdir)/components/ideintf/fieldseditor.pas
Navigation
[0] Message Index