Recent

Author Topic: [Solved] TBufDataset: Fielddefs Editor at Runtime  (Read 728 times)

CharlyTango

  • Jr. Member
  • **
  • Posts: 70
[Solved] TBufDataset: Fielddefs Editor at Runtime
« on: June 04, 2024, 09:58:12 pm »
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 ?
« Last Edit: June 06, 2024, 02:38:50 pm by CharlyTango »
Lazarus stable, Win32/64

cdbc

  • Hero Member
  • *****
  • Posts: 1497
    • http://www.cdbc.dk
Re: TBufDataset: Fielddefs Editor at Runtime
« Reply #1 on: June 05, 2024, 01:41:39 am »
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
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

CharlyTango

  • Jr. Member
  • **
  • Posts: 70
Re: TBufDataset: Fielddefs Editor at Runtime
« Reply #2 on: June 05, 2024, 07:34:03 am »
You can just call them in your code, in this respect, /you/ are the 'FieldsDefs-Editor'  ::)

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.
Lazarus stable, Win32/64

cdbc

  • Hero Member
  • *****
  • Posts: 1497
    • http://www.cdbc.dk
Re: TBufDataset: Fielddefs Editor at Runtime
« Reply #3 on: June 05, 2024, 07:49:13 am »
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
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

dsiders

  • Hero Member
  • *****
  • Posts: 1208
Re: TBufDataset: Fielddefs Editor at Runtime
« Reply #4 on: June 05, 2024, 08:44:44 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)

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
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

 

TinyPortal © 2005-2018