Re: [Lazarus] How TDBGrid works
A simple way is to make BufferCount=RecordCount so all record will be in buffer, it will be fast and easy to use and good for even couple of thousands records but not a real solution. Regards, Ara -- http://www.fastmail.com - Email service worth paying for. Try it for free -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How TDBGrid works
On Sunday 08 May 2016 04:31:29 Jesus Reyes A. wrote: > En Sat, 07 May 2016 01:26:38 -0500, Martin Schreiber > > escribió: > > On Friday 06 May 2016 23:20:41 Aradeonas wrote: > >> Thanks. > >> > >> So what is the best way to provide those 100 to 1100 record at least > >> without Dataset calling AfterScroll event? > >> I want to not make any event while scrolling my custom Grid so other > >> connected DB controls change their values otherwise while Im scrolling > >> my custom grid it will cause calling all connected DB controls to update > >> their values. > >> I hope it is more clear now. > > > > If the wanted record is in window of TDataLink.FirstRecord..FirstRecord + > > BufferCount - 1 you can temporarily switch the record which supplies the > > field data by setting TDatalink.ActiveRecord which doesn't fire any > > events. I > > assume you know that. ;-) > > See for example the MSEgui functions TGridDatalink.GetDisplay*Buffer(), > > BeginGridRow() and EndGridRow(). > > https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/m > >sedbedit.pas > > Good luck by trying that while FirstRecord is "pointing" to record 1000 > AND keeping RecNo at 1, maybe I misunderstood something. > Then the "wanted record" is *not* in in window of TDataLink.FirstRecord..FirstRecord + BufferCount - 1 a dataset with direct data access like TMSEBufDataset or the problematic DisableControls()/EnableControls() trick is necessary. Martin -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How TDBGrid works
En Sat, 07 May 2016 01:26:38 -0500, Martin Schreiber escribió: On Friday 06 May 2016 23:20:41 Aradeonas wrote: Thanks. So what is the best way to provide those 100 to 1100 record at least without Dataset calling AfterScroll event? I want to not make any event while scrolling my custom Grid so other connected DB controls change their values otherwise while Im scrolling my custom grid it will cause calling all connected DB controls to update their values. I hope it is more clear now. If the wanted record is in window of TDataLink.FirstRecord..FirstRecord + BufferCount - 1 you can temporarily switch the record which supplies the field data by setting TDatalink.ActiveRecord which doesn't fire any events. I assume you know that. ;-) See for example the MSEgui functions TGridDatalink.GetDisplay*Buffer(), BeginGridRow() and EndGridRow(). https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/msedbedit.pas Good luck by trying that while FirstRecord is "pointing" to record 1000 AND keeping RecNo at 1, maybe I misunderstood something. Jesus Reyes A. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Cannot compile trunk from rev. 52266
On Sat, May 7, 2016 at 9:38 PM, Marco van de Voort wrote: > svn blame points to r52209, Juha Oops, right. Fixed in r52287. Thanks for noticing. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Cannot compile trunk from rev. 52266
On Tue, May 03, 2016 at 09:57:55AM +0200, Torsten Bonde Christiansen wrote: > > With the rev. 52266 it is no longer possible to compile trunk due to the > following error: > > /home/torsten/FreePascal/lazarus/packager/openinstalledpkgdlg.pas(204,30) > Error: (4025) Incompatible type for arg no. 1: Got "TStringArray", > expected "TListViewDataItem" > /home/torsten/FreePascal/lazarus/ide/listviewfilteredit.pas(132,14) > Hint: (5039) Found declaration: Add(const TListViewDataItem):LongInt; > openinstalledpkgdlg.pas(233) Fatal: (10026) There were 1 errors > compiling module, stopping > Fatal: (1018) Compilation aborted > Makefile:4004: recipe for target 'lazarus' failed > > From the looks of it, the code in "openinstalledpkgdlg.pas" was not > updated to support the changes made in "listviewfilteredit.pas Another one (still in r52286): (fpc trunk, lazarus trunk) C:\repo\lazarus\components\sparta\dockedformeditor\source\sparta_reg_dockedformeditor.pas(49,70) Error: (4025) Incompatible type for arg no. 1: Got "TSpartaMainIDE.class OnModifiedSender(TObject);", expected "" C:\repo\lazarus\components\ideintf\units\i386-win32\win32\propedits.ppu:propedits.pp(6600,31) Hint: (5039) Found declaration: AddHandlerModified(const TPropHookModified); sparta_reg_dockedformeditor.pas(67) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted svn blame points to r52209, Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How TDBGrid works
On Saturday 07 May 2016 11:03:28 Aradeonas wrote: > > > A possible workaround could be to call TDataset.DisableControls(), to > > fetch the needed records and to restore the DB cursor position before > > calling EnableControls(). I fear it is not efficient and has > > sideeffects. > > What side effects do you think about? > Maybe changed record buffer window which could trigger recentering of grids. You must try it, the buffer and scrolling system is complicated... Martin -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How TDBGrid works
> The easy one is probably to make two independent connections to the > database. More elaborated solutions would be for example copy all said > records to a memdataset and only connect that to a dbgrid, OR put the > records in a non-dataset enabled component, like a TDrawGrid or > TStringGrid, browsing that will not trigger any dataset events so > other db controls will be unaffected, etc. The problem here is I think > synchronizing stuff, you will have a funny time getting the updates to > those records into the original source. Jesus I'm afraid your way is not memory efficent. > If the wanted record is in window of > TDataLink.FirstRecord..FirstRecord + BufferCount - 1 you can > temporarily switch the record which supplies the field data by setting > TDatalink.ActiveRecord which doesn't fire any events. I assume you > know that. ;-) See for example the MSEgui functions > TGridDatalink.GetDisplay*Buffer(), BeginGridRow() and EndGridRow(). > https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/msedbedit.pas > If the wanted records are anywhere in the dataset you need a dataset > with random row data access. TMSEBufDataset supports it, please see > the TMSEBufDataset.Current* properties. > https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/msebufdataset.pas > The MSEgui dropdownlist DB-edits use this approach for lookups if > Dropdown.OptionsDB odb_directdata is set. Glad to hear from you Martin. Happy to see MSE support this and I will look it up. > A possible workaround could be to call TDataset.DisableControls(), to > fetch the needed records and to restore the DB cursor position before > calling EnableControls(). I fear it is not efficient and has > sideeffects. What side effects do you think about? Regards, Ara -- http://www.fastmail.com - IMAP accessible web-mail -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Flexible exporter for grid-like components
Am 06.05.2016 um 22:51 schrieb Bart: Don't you have svn commit (to LCL)? Only for "components". -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus