Hi Fabio, I'd like to share how i implemented similar behavior of TDbCtrlGrid, so maybe you can be interested. If not just ignore.
First i create a TFrame in Lazarus put the controls that i need to be there. In the control i want to display the instances of the frame i create at runtime according to a configuration This way i have the easy of use of Lazarus designer with a lot of flexibility. I created an control ( https://code.google.com/p/luipack/source/browse/trunk/luicontrols/jsonmediators.pas) that does the above. The frame class (TJSONBooleanRadioButtonViewFrame) is hardcoded but it can be decoupled by using an interface. To implement TDbCtrlGrid like control with this approach seems easier then you are trying: - Define an interface with what you need to configure the DbCtrls like IDbCtrlItem = interface SetDatasource(Datasource: TDataSource); end; - Create a control that has a TFrameClass property - When the TFrameClass is set, check if implements IDbCtrlItem - At runtime create as many TFrameClass instances as needed configuring them at initialization through the IDbCtrlItem interface - Bind to dataset events and update the controls accordingly Luiz 2014-03-04 10:41 GMT-03:00 Fabio Luis Girardi <[email protected]>: > Hi Mattias!! > > This solution don't work too. > > > 2014-03-04 9:46 GMT-03:00 Fabio Luis Girardi <[email protected]>: > > Maybe RemoveHandlerAddClicked is a replacement? >> >> >> 2014-03-04 9:43 GMT-03:00 Fabio Luis Girardi <[email protected]>: >> >> mytesthelper.pas(40,20) Error: identifier idents no member >>> "RemoveHandlerComponentAdded" >>> >>> Lazarus 1.3 >>> >>> >>> >>> 2014-03-03 18:56 GMT-03:00 Mattias Gaertner <[email protected]>: >>> >>> On Mon, 3 Mar 2014 16:47:30 -0300 >>>> Fabio Luis Girardi <[email protected]> wrote: >>>> >>>> > Hi!! >>>> > >>>> > Attached the code of my prototype of TDBCtrlGrid. It works as >>>> expected on >>>> > Delphi (except the function GetDesignerDropTarget that don't exists on >>>> > Delphi TWinControl), but it don't works as expected on Lazarus. >>>> >>>> On second thought the LCL method is not very flexible. >>>> I added a general designer event. >>>> >>>> See >>>> >>>> http://wiki.lazarus.freepascal.org/Extending_the_IDE#Example:_When_dropping_a_new_component_move_control_to_a_child >>>> >>>> Please test. >>>> >>>> Mattias >>>> >>>> -- >>>> _______________________________________________ >>>> Lazarus mailing list >>>> [email protected] >>>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus >>>> >>> >>> >>> >>> -- >>> The best regards, >>> >>> Fabio Luis Girardi >>> PascalSCADA Project >>> http://sourceforge.net/projects/pascalscada >>> http://www.pascalscada.com >>> >> >> >> >> -- >> The best regards, >> >> Fabio Luis Girardi >> PascalSCADA Project >> http://sourceforge.net/projects/pascalscada >> http://www.pascalscada.com >> > > > > -- > The best regards, > > Fabio Luis Girardi > PascalSCADA Project > http://sourceforge.net/projects/pascalscada > http://www.pascalscada.com > > -- > _______________________________________________ > Lazarus mailing list > [email protected] > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > >
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
