Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 30/6/22 a les 14:47, Luca Olivetti via lazarus ha escrit: El 30/6/22 a les 13:45, Luca Olivetti via lazarus ha escrit: I'm puzzled: now I removed the vampyre lib from the ide, in a form I need ImagingComponent and ImagingClassed. I drop a TPicture with a png image and it is blank at runtime. This time it is streamed as TPortableNetworkGraphic *but* FindClassName cannot find it. How is that possible? AAAGH Because the Vampyre library explicitly deletes it {$IFDEF COMPONENT_SET_LCL} // Unregister Lazarus´ default PNG loader which crashes on some PNG files TPicture.UnregisterGraphicClass(TPortableNetworkGraphic); {$ENDIF} Two years later I forgot about this issue and I found it again with lazarus 3.2 and a freshly downloade vampyre imaging library (which is still at version 0.80 in the online package manager, though I see that the line is still there in the github repository). Probably my fault for not reporting the issue to Vampyre, I just hope my memory serves me better next time. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Getting started with SQLite with Lazarus on Linux Mint
El 10/7/24 a les 12:59, Arí Ricardo Ody via lazarus ha escrit: Hello! I'm trying to use SQLite with Lazarus on a Linux Mint. It is asking for a module ¨libsqlite3.so¨ (without the quotes). I installed sqlite on my linux with apt. I'm not finding ¨libsqlite3.so¨ anywhere on my SSD, and I also couldn't figure out which directory I should put it in if I found it. At most I can find a module ¨libsqlite3.so.0¨ in the /usr/lib directory. Would anyone help me, please? I suppose it's a debian derivative, so sudo apt install libsqlite3-dev Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Multiple versions of the same package and its dependencies?
El 4/6/24 a les 15:52, Werner Pamler via lazarus ha escrit: This is with lazarus 3.2 btw, I didn't yet try 3.4 Hard disk space is cheap. Make a second ("secondary") installation of Lazarus in which you can install the other version of zeos. That's an option, yes, in fact I already keep several versions of lazarus du -sh laz_* 2,9Glaz_1_6 3,0Glaz_1_8 5,8Glaz_2_0 4,6Glaz_2_2 4,0Glaz_3_2 (I also have 1_4 in a different directory plus some more special versions in virtual machines). I just wanted to know if I can specify an hard requirement on a specific version of a package and have lazarus automatically resolve it. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Multiple versions of the same package and its dependencies?
El 4/6/24 a les 15:17, Michael Van Canneyt via lazarus ha escrit: Shouldn't lazarus already know the different versions of all the packages? This is with lazarus 3.2 btw, I didn't yet try 3.4 The zeos packages themselves need to indicate the min/max versions of the packages they depend on. Then, if lazarus needs to decide the dependencies, it will select the correct ones if it knows them. Yes, they do, they specify a min/max corresponding to the version, i.e.: zcomponent 7.1.4 requires zplain >=7.1 <=7.1 zparsesql >=7.1 <=7.1 zdbc >=7.1 <=7.1 zcore >=7.1 <=7.1 zplain requires zcore >=7.1 <=7.1 zparsesql requires zcore >=7.1 <=7.1 zdbc requires zplain >=7.1 <=7.1 zparsesql >=7.1 <=7.1 zcore >=7.1 <=7.1 but I have to open the lpk of all the packages every time I want to switch from 7.1.4 to 7.2.12 and viceversa otherwise lazarus complains about missing packages. I used the versioning extensively, and it works fine, but every package must "play nice" before it can work correctly. Maybe the problem is because the packages only specify major/minor instead of major/minor/revision? Another question is, my projects using zeos automatically acquired the version I used when I wrote them (e.g. zcomponent >=6.5), since both 7.1 and 7.2 (and 8.0) satisfy the requirement, which version will the project actually use? The last one I opened the lpk, the one installed in the ide or the higher version available? Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Multiple versions of the same package and its dependencies?
Hello, I have a problem with one project and zeosdbo, so I'm trying different versions of zeosdbo. In the project inspector I change the min/max version of the required package (zcomponent) so it uses the one I want to try. Lazarus knows all versions of the zcomponent package so it doesn't flag the requirement as missing, however zcomponent itself depends on other packages of the same version and lazarus marks them as missing until I open the lpk one by one. This happens every time I try to change the version of the required zcomponent. Shouldn't lazarus already know the different versions of all the packages? This is with lazarus 3.2 btw, I didn't yet try 3.4 Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] "Execute before" is executed after resource generation?
El 24/5/24 a les 18:05, Marc Weustink via lazarus ha escrit: And even if I use a different rc file with {$R myspec.rc}, if the source file with the directive doesn't change it won't be automtically recompiled so no regeneration of the resource file would take place, even if one of the files in myspec.rc has changed, right? Yes. The IDE/Compiler have no knowledge what you put in the .rc If you don't want the have it rebuild every time you need some logic in your "rc builder" you call in the prebuild step But if I use the "resources" section in the project options *and* put the file in the project, the IDE could check that the file changed and regenerate the resource file ;-) (which is what I supposed it did: even if the wiki page doesn't say it explicitly it seems to imply so). Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] "Execute before" is executed after resource generation?
El 23/5/24 a les 21:46, Luca Olivetti via lazarus ha escrit: El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit: In this case, don't use the project.res, but use your own. You can include multiple resource files. So you can generate it before. I just followed the instructions here (and have been doing it for many years, even if this is the first time I tried to generate the file with "Execute before"): https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources though it doesn't say exactly when it is regenerated ("depending on the actions taken in the IDE") it also says "it is therefore a good idea to add the files that are indicated here to the project file as well". And even if I use a different rc file with {$R myspec.rc}, if the source file with the directive doesn't change it won't be automtically recompiled so no regeneration of the resource file would take place, even if one of the files in myspec.rc has changed, right? Bye Marc On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus wrote: El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit: On 5/22/24 15:03, Luca Olivetti via lazarus wrote: Hello, I'm trying to use the "Compiler commands" -> "Execute before" to generate a file that will be embedded as a resource in the executable, but it seems the command is executed after the resources are compiled (there's a message complaining that the file is not found and in fact when I execute the program the resource is not available). Is there a way around it, other than executing the command manually? If you mean the project .res file: That is updated on save, which is independent of compile. Ouch, so my projects that embed files as resources (and I also added those files to the project to be sure they're tracked by lazarus) are working by pure luck. Or not, since a save happens anyway when the file is modified with the lazarus editor and I use compile or build, right? What happens if I edit the file with an external editor, it's not currently opened in lazarus (so it won't prompt me to reload it) and I press compile/build/run? Will the .res be regenerated or not? As I said, for the problem at hand I changed the logic, but I'd like to be sure that my project work by design and not by chance. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] "Execute before" is executed after resource generation?
El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit: In this case, don't use the project.res, but use your own. You can include multiple resource files. So you can generate it before. I just followed the instructions here (and have been doing it for many years, even if this is the first time I tried to generate the file with "Execute before"): https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources though it doesn't say exactly when it is regenerated ("depending on the actions taken in the IDE") it also says "it is therefore a good idea to add the files that are indicated here to the project file as well". Bye Marc On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus wrote: El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit: On 5/22/24 15:03, Luca Olivetti via lazarus wrote: Hello, I'm trying to use the "Compiler commands" -> "Execute before" to generate a file that will be embedded as a resource in the executable, but it seems the command is executed after the resources are compiled (there's a message complaining that the file is not found and in fact when I execute the program the resource is not available). Is there a way around it, other than executing the command manually? If you mean the project .res file: That is updated on save, which is independent of compile. Ouch, so my projects that embed files as resources (and I also added those files to the project to be sure they're tracked by lazarus) are working by pure luck. Or not, since a save happens anyway when the file is modified with the lazarus editor and I use compile or build, right? What happens if I edit the file with an external editor, it's not currently opened in lazarus (so it won't prompt me to reload it) and I press compile/build/run? Will the .res be regenerated or not? As I said, for the problem at hand I changed the logic, but I'd like to be sure that my project work by design and not by chance. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 16:11, Luca Olivetti via lazarus ha escrit: El 23/5/24 a les 15:43, zeljko ha escrit: No such error when using gtk2, but I prefer qt5. It is KDE problem (probably bug), disable in IDE options -> Windows -> "IDE title shows project directory" and it'll work. Thank you, I'll try that if it happens again. Strangely enough, it doesn't happen (even with that option active) if I rebuild clean the ide for a different widgetset (I tried gtk2 and qt6) then rebuild it for qt5. Spoke to soon: right after sending the email, I tried opening a file and the error reappeared. Disabling the option solved it. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 15:43, zeljko ha escrit: No such error when using gtk2, but I prefer qt5. It is KDE problem (probably bug), disable in IDE options -> Windows -> "IDE title shows project directory" and it'll work. Thank you, I'll try that if it happens again. Strangely enough, it doesn't happen (even with that option active) if I rebuild clean the ide for a different widgetset (I tried gtk2 and qt6) then rebuild it for qt5. When it happens if I just rebuild for qt5 (without changing the widgetset) it doesn't solve the problem. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] "Execute before" is executed after resource generation?
El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit: On 5/22/24 15:03, Luca Olivetti via lazarus wrote: Hello, I'm trying to use the "Compiler commands" -> "Execute before" to generate a file that will be embedded as a resource in the executable, but it seems the command is executed after the resources are compiled (there's a message complaining that the file is not found and in fact when I execute the program the resource is not available). Is there a way around it, other than executing the command manually? If you mean the project .res file: That is updated on save, which is independent of compile. Ouch, so my projects that embed files as resources (and I also added those files to the project to be sure they're tracked by lazarus) are working by pure luck. Or not, since a save happens anyway when the file is modified with the lazarus editor and I use compile or build, right? What happens if I edit the file with an external editor, it's not currently opened in lazarus (so it won't prompt me to reload it) and I press compile/build/run? Will the .res be regenerated or not? As I said, for the problem at hand I changed the logic, but I'd like to be sure that my project work by design and not by chance. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 12:58, Mattias Gaertner via lazarus ha escrit: On 5/23/24 12:47, Luca Olivetti via lazarus wrote: [...] No, it's not supposed to be a GUI program. I added it now, it compiles, but then I have the problem reported in the BGRAbitmap bugtracker (and I wonder why it compiled fine without the interfaces unit and the gtk2 widgetset). I "solved" the "too many libraries" problem using the nogui widgetset. It's a solution I'm not really comfortable with but it seems to work. I wonder why, back when when I originally wrote the program with lazarus 2.0.12, neither the "interfaces" unit was needed nor the project pulled so many libraries. Depends on what you use from BGRA and what that uses from the LCL. I just use it to convert an image to jpeg and scale it to a fixed size, or to generate a jpeg image with a text in it. The use case is to manage user's avatars from a web application, if an image is provided then it's used as the avatar, otherwise a dummy avatar is generated with the user's initials. Most of the LCL requires the interfaces unit. I understand that, what I don't understand is why I didn't need it with lazarus 2.0.12 (and why the program could be build with gtk2 even without the interfaces unit). Keep in mind that the nogui widgetset is for most part an empty stub. That's why I'm not really comfortable with it, though it seems to be enough for this application. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 12:33, Luca Olivetti via lazarus ha escrit: El 23/5/24 a les 12:26, Marco van de Voort via lazarus ha escrit: Op 23-5-2024 om 12:15 schreef Luca Olivetti via lazarus: Warning: linker: /usr/bin/ld: /home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: in function `REGISTERCUSTOMIMAGELISTRESOLUTION': wsimglist.pp(265,0) Error: linker: undefined reference to `WSRegisterCustomImageListResolution' BTW, this is related to https://github.com/bgrabitmap/bgrabitmap/issues/253 Do you have the interfaces unit early in your .lpr USES list? No, it's not supposed to be a GUI program. I added it now, it compiles, but then I have the problem reported in the BGRAbitmap bugtracker (and I wonder why it compiled fine without the interfaces unit and the gtk2 widgetset). I "solved" the "too many libraries" problem using the nogui widgetset. It's a solution I'm not really comfortable with but it seems to work. I wonder why, back when when I originally wrote the program with lazarus 2.0.12, neither the "interfaces" unit was needed nor the project pulled so many libraries. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 12:26, Marco van de Voort via lazarus ha escrit: Op 23-5-2024 om 12:15 schreef Luca Olivetti via lazarus: Warning: linker: /usr/bin/ld: /home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: in function `REGISTERCUSTOMIMAGELISTRESOLUTION': wsimglist.pp(265,0) Error: linker: undefined reference to `WSRegisterCustomImageListResolution' BTW, this is related to https://github.com/bgrabitmap/bgrabitmap/issues/253 Do you have the interfaces unit early in your .lpr USES list? No, it's not supposed to be a GUI program. I added it now, it compiles, but then I have the problem reported in the BGRAbitmap bugtracker (and I wonder why it compiled fine without the interfaces unit and the gtk2 widgetset). Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 12:01, Luca Olivetti via lazarus ha escrit: El 23/5/24 a les 10:38, Luca Olivetti via lazarus ha escrit: I rebuilt the ide again with qt5 and the problem is gone. Weird. El 23/5/24 a les 10:37, Luca Olivetti via lazarus ha escrit: Forgot to say, this is under debian 12 x86_64 with plasma desktop. As per the subject, if I compile the ide with qt5 I cannot open anything (projects, units, etc.), since the file open dialog gives an error (localizer, approximate translation) "cannot create worker KIO process. Couldn't create a socket to launch the KIO process for the 'tags' protocol". No such error when using gtk2, but I prefer qt5. But now I cannot build my (old) project, I get a bunch of linker errors from LCLBase regarding missing WSRegister* symbols, like Warning: linker: /usr/bin/ld: /home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: in function `REGISTERCUSTOMIMAGELISTRESOLUTION': wsimglist.pp(265,0) Error: linker: undefined reference to `WSRegisterCustomImageListResolution' BTW, this is related to https://github.com/bgrabitmap/bgrabitmap/issues/253 Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 10:38, Luca Olivetti via lazarus ha escrit: I rebuilt the ide again with qt5 and the problem is gone. Weird. El 23/5/24 a les 10:37, Luca Olivetti via lazarus ha escrit: Forgot to say, this is under debian 12 x86_64 with plasma desktop. As per the subject, if I compile the ide with qt5 I cannot open anything (projects, units, etc.), since the file open dialog gives an error (localizer, approximate translation) "cannot create worker KIO process. Couldn't create a socket to launch the KIO process for the 'tags' protocol". No such error when using gtk2, but I prefer qt5. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything
El 23/5/24 a les 10:37, Luca Olivetti via lazarus ha escrit: Forgot to say, this is under debian 12 x86_64 with plasma desktop. As per the subject, if I compile the ide with qt5 I cannot open anything (projects, units, etc.), since the file open dialog gives an error (localizer, approximate translation) "cannot create worker KIO process. Couldn't create a socket to launch the KIO process for the 'tags' protocol". No such error when using gtk2, but I prefer qt5. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] lazarus 3.2 and qt5, cannot open anything
As per the subject, if I compile the ide with qt5 I cannot open anything (projects, units, etc.), since the file open dialog gives an error (localizer, approximate translation) "cannot create worker KIO process. Couldn't create a socket to launch the KIO process for the 'tags' protocol". No such error when using gtk2, but I prefer qt5. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] "Execute before" is executed after resource generation?
El 22/5/24 a les 15:03, Luca Olivetti via lazarus ha escrit: Hello, I'm trying to use the "Compiler commands" -> "Execute before" to generate a file that will be embedded as a resource in the executable, but it seems the command is executed after the resources are compiled (there's a message complaining that the file is not found and in fact when I execute the program the resource is not available). Is there a way around it, other than executing the command manually? never mind, now I generate the file inside my program. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] "Execute before" is executed after resource generation?
Hello, I'm trying to use the "Compiler commands" -> "Execute before" to generate a file that will be embedded as a resource in the executable, but it seems the command is executed after the resources are compiled (there's a message complaining that the file is not found and in fact when I execute the program the resource is not available). Is there a way around it, other than executing the command manually? Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 11:47, Martin Frb via lazarus ha escrit: On 22/04/2024 11:13, Luca Olivetti via lazarus wrote: That doesn't answer my question: then how is it possible that I can step into the lcl with gdb and -gl even if I don't specify "-gl" in additions and overrides? Because your LCL is probably build with STABS. And gdb can read stabs, but FpDebug can't. That would explain it, provided it's fpc default (in this case for win32). For the record: it is *not* necessary to add -gw3 to "configure build lazarus", it's enough to put it in the "additions and overrides". Yes, it's either, or, or both. Well, since putting it in "configure build lazarus" didn't work (at least it didn't solve my problem), while putting it in "additions and overrides" did, I don't consider them equivalent. In any case, problem solved, until next time I decide to change something ;-) (which I should refrain to do :-D) Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 11:29, Luca Olivetti via lazarus ha escrit: That doesn't answer my question: then how is it possible that I can step into the lcl with gdb and -gl even if I don't specify "-gl" in additions and overrides? Adding "-gw3" to the options in "Tools->Configure build lazarus" allows me to step into the LCL. I tried that before but building lazarus failed (I don't remember the exact error). That doesn't explain why I didn't need to to that with gdb and -gl. Spoke too soon: while I can step into the LCL directly, if I put a breakpoint in one of my packages (in a function which is called by the LCL, it implements a THelpManager), fpdebug doesn't stop at the breakpoint. For it to work I have to add -gw3 to the "additions and overrides" (and, sorry to repeat myself, I didn't need to to that with gdb and -gl). For the record: it is *not* necessary to add -gw3 to "configure build lazarus", it's enough to put it in the "additions and overrides". Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 11:31, Mattias Gaertner via lazarus ha escrit: On 22.04.24 10:37, Luca Olivetti via lazarus wrote: [...] First of all, the fpc release units have no debug information, so normally there is nothing to pick. I have no problem with rtl/fcl units, as I explained, I compile them with debug info (either -gl or -gw3) and I can step into them. Yes, you compiled them yourself, because the fpc *release* does not include debug information. That's what I said: I use a self compiled version with debug information [...] Then why I can step into the LCL with gdb and -gl? ... and not with fpdebug? no, only if I add "-gw3" to the additions and overrides (which I didn't need to do with gdb and -gl). Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 11:22, Luca Olivetti via lazarus ha escrit: El 22/4/24 a les 11:13, Luca Olivetti via lazarus ha escrit: El 22/4/24 a les 11:02, Martin Frb via lazarus ha escrit: On 22/04/2024 10:37, Luca Olivetti via lazarus wrote: But if they have it would be super useful to have a setting "use the debug setting of the system unit", but there is not. You can add the -gw3 flag depending on build mode: https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Add_a_flag_to_project_and_all_packages Then why I can step into the LCL with gdb and -gl? I'm already using the additions and overrides but I don't currently specify any debug option there. packages (even if rebuild) have their own settings what debug info type they use. This is in each package's options. LCL and many packages also include the settings that you specify in "Tools > Configure build Lazarus". So you can specify the setting there. Or you can specify in "Additions and Overrides" with Target packagname, or * That doesn't answer my question: then how is it possible that I can step into the lcl with gdb and -gl even if I don't specify "-gl" in additions and overrides? Adding "-gw3" to the options in "Tools->Configure build lazarus" allows me to step into the LCL. I tried that before but building lazarus failed (I don't remember the exact error). That doesn't explain why I didn't need to to that with gdb and -gl. Spoke too soon: while I can step into the LCL directly, if I put a breakpoint in one of my packages (in a function which is called by the LCL, it implements a THelpManager), fpdebug doesn't stop at the breakpoint. For it to work I have to add -gw3 to the "additions and overrides" (and, sorry to repeat myself, I didn't need to to that with gdb and -gl). Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 11:13, Luca Olivetti via lazarus ha escrit: El 22/4/24 a les 11:02, Martin Frb via lazarus ha escrit: On 22/04/2024 10:37, Luca Olivetti via lazarus wrote: But if they have it would be super useful to have a setting "use the debug setting of the system unit", but there is not. You can add the -gw3 flag depending on build mode: https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Add_a_flag_to_project_and_all_packages Then why I can step into the LCL with gdb and -gl? I'm already using the additions and overrides but I don't currently specify any debug option there. packages (even if rebuild) have their own settings what debug info type they use. This is in each package's options. LCL and many packages also include the settings that you specify in "Tools > Configure build Lazarus". So you can specify the setting there. Or you can specify in "Additions and Overrides" with Target packagname, or * That doesn't answer my question: then how is it possible that I can step into the lcl with gdb and -gl even if I don't specify "-gl" in additions and overrides? Adding "-gw3" to the options in "Tools->Configure build lazarus" allows me to step into the LCL. I tried that before but building lazarus failed (I don't remember the exact error). That doesn't explain why I didn't need to to that with gdb and -gl. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 11:02, Martin Frb via lazarus ha escrit: On 22/04/2024 10:37, Luca Olivetti via lazarus wrote: But if they have it would be super useful to have a setting "use the debug setting of the system unit", but there is not. You can add the -gw3 flag depending on build mode: https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Add_a_flag_to_project_and_all_packages Then why I can step into the LCL with gdb and -gl? I'm already using the additions and overrides but I don't currently specify any debug option there. packages (even if rebuild) have their own settings what debug info type they use. This is in each package's options. LCL and many packages also include the settings that you specify in "Tools > Configure build Lazarus". So you can specify the setting there. Or you can specify in "Additions and Overrides" with Target packagname, or * That doesn't answer my question: then how is it possible that I can step into the lcl with gdb and -gl even if I don't specify "-gl" in additions and overrides? Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Stepping into the LCL with fpdebug
El 22/4/24 a les 10:10, Mattias Gaertner via lazarus ha escrit: On 22.04.24 09:54, Luca Olivetti via lazarus wrote: [...] make clean install OPT=-gw3 INSTALL_PREFIX=d:\pp-fpdebug (different path so I can keep the two versions) and I can step inside the rtl, just not inside the LCL. Since the packages are automatically built when I build the project, I think they should pick the -gw3 setting, shouldn't they? First of all, the fpc release units have no debug information, so normally there is nothing to pick. I have no problem with rtl/fcl units, as I explained, I compile them with debug info (either -gl or -gw3) and I can step into them. But if they have it would be super useful to have a setting "use the debug setting of the system unit", but there is not. You can add the -gw3 flag depending on build mode: https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Add_a_flag_to_project_and_all_packages Then why I can step into the LCL with gdb and -gl? I'm already using the additions and overrides but I don't currently specify any debug option there. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Stepping into the LCL with fpdebug
Hello, up until now I used gdb with -gl and, if in the project options I selected -gl, I could step inside the LCL. For the rtl/fcl I compile fpc this way make clean install OPT=-g INSTALL_PREFIX=d:\pp-debug and I specify the resulting compiler in Lazarus' tools->options. Now I'm switching to fpdebug, it needs -gw3 but I cannot step into the LCL. I compile fpc with make clean install OPT=-gw3 INSTALL_PREFIX=d:\pp-fpdebug (different path so I can keep the two versions) and I can step inside the rtl, just not inside the LCL. Since the packages are automatically built when I build the project, I think they should pick the -gw3 setting, shouldn't they? I thought that the problem was the "Use external debug symbols file (-Xg)" but even without that option I cannot step inside the LCL. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] [fpc-devel] Unicode RTL
El 28/7/23 a les 16:35, Michael Van Canneyt via lazarus ha escrit: But if all these terribly unhappy and depressed users have a better name, I'm all ears. So far, nothing catchy has been offered. What about "Futura RTL"? Short, catchy and...completely meaningless in this context :-D Great song, though https://www.youtube.com/watch?v=RXjE4q3Hyd4 Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 27/7/23 a les 17:16, Maxim Ganetsky via lazarus ha escrit: 27.07.2023 18:02, Luca Olivetti via lazarus пишет: El 3/7/23 a les 13:33, Mattias Gaertner via lazarus ha escrit: You can then open that copy in the RC1. Please test: Now that, with Martin, I found the casue of the problem with the fpbebugger, now I have a different problem: the TSpeedButtons cut the text that previously fit. See this picture: https://postimg.cc/k61b0wCx the upper toolbar is in lazarus 2.6, the lower one with 3.0 RC1. The rest of the layout of the form seems OK. Please create an issue and attach a test project there. Done https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40410 Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 3/7/23 a les 13:33, Mattias Gaertner via lazarus ha escrit: You can then open that copy in the RC1. Please test: Now that, with Martin, I found the casue of the problem with the fpbebugger, now I have a different problem: the TSpeedButtons cut the text that previously fit. See this picture: https://postimg.cc/k61b0wCx the upper toolbar is in lazarus 2.6, the lower one with 3.0 RC1. The rest of the layout of the form seems OK. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 26/7/23 a les 17:42, Martin Frb via lazarus ha escrit: So FpDebug did not find the source file. I found the issue: it's the -Xg (use external debug symbols file) option. I wonder why it doesn't work under windows but it does under linux. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 26/7/23 a les 17:26, Luca Olivetti via lazarus ha escrit: El 26/7/23 a les 17:18, Luca Olivetti via lazarus ha escrit: Are there ways to reproduce it ? Could sources be shared? The projects I tested no, I'll see if I can find a simpler project with the same issue. I found a simple project that I can share but I'm not sure it's a good idea to send it here (the zip file is 143K). I can reproduce the issue with a lazarus build with "make clean ; make bigide" and a fresh pcp. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 26/7/23 a les 17:18, Luca Olivetti via lazarus ha escrit: Are there ways to reproduce it ? Could sources be shared? The projects I tested no, I'll see if I can find a simpler project with the same issue. I found a simple project that I can share but I'm not sure it's a good idea to send it here (the zip file is 143K). Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 26/7/23 a les 16:50, Martin Frb via lazarus ha escrit: What happens to the breakpoint icon when you start the debugger? Before you start the debugger, it should have a "?". Yes, state "?(On)" When you start it, what happens. A pause simbol (two vertical white bars in a red circle), state "Pending (On)" (under linux the state is just "Enabled"). You can also check in the breakpoint-windows, if you make the first column wide enough there is some text. That's what I reported as "state" above -- If you remove the breakpoint (can be done while the app is running / after you checked the above), is there a "small blue dot" in the gutter? On the very same line as the breakpoint had been? No, not even under linux Gdb would accept breakpoints at non-code lines. FpDebug needs the breakpoint on a code line. It's on a code line, not a blank line nor a comment. Note that if condition then exit; /// this exit is only a codeline in -O- // with -O1 its optimized away Both breakpoints I tested are on an assignment that cannot be optimized away -- Are there ways to reproduce it ? Could sources be shared? The projects I tested no, I'll see if I can find a simpler project with the same issue. Otherwise I'll send instructions to produce log files. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 26/7/23 a les 16:36, Maxim Ganetsky via lazarus ha escrit: I would recommend to checkout not the tag, but the tip of `fixes_3_0` branch. It already contains a number of important fixes. If it can still be reproduced with it, please create an issue. OK, I did a "git checkout fixes_3_0" then rebuilt the "ide with packages" (from within the old one) with the "clean all" option. Same problem: the breakpoints don't work in an existing project using the fpdebug backend. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release Candidate 1 of 3.0
El 3/7/23 a les 13:33, Mattias Gaertner via lazarus ha escrit: - Compile, debug and run I don't remember the exact wording but, when converting the settings from lazarus 2.2 (which I copied in a different directory), it offered to use the fpdebug backend. Then, when compiling a *existing* project, it tells me to use a suitable debugging format (with -gw3 selected, previously I used gdb with -g). I accept but the breakpoints don't work. I tried the other two options with the same result. With gdb backend and -g the breakpoints work. With a *new* project the breakpoints work even with the fpdebug backend. This is under win32, under linux (64 bits), the breakpoints work even in the old project (the same one I used to test under win32). In both cases (win/linux) I got lazarus' sources with git checking out the tag lazarus_3_0_RC1, "make bigide" then (not without problems) I rebuilt it with my set of packages. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] [fpc-devel] Unicode RTL
El 24/7/23 a les 23:20, Michael Van Canneyt via lazarus ha escrit: To this end, it would be helpful to add a paragraph on the wiki page underlining how to retain the single-byte RTL; or, if no user action is necessary, mention that, to set minds at ease. Thank you for this hard work! No user action is necessary. But your advice is good: I have added this to the page, and made clear that the RTL as it currently exists, is still the default RTL. So those of us that don't need delphi compatibility can be sure that nothing will break? Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] TThread.Queue vs Application.QueueAsyncCall
El 18/7/23 a les 13:50, Mattias Gaertner via lazarus ha escrit: On 17.07.23 19:01, Luca Olivetti via lazarus wrote: Hello, TThread.Queue and Application.QueueAsyncCall more or less do the same thing (even if they use two different queues that are managed at different times in the main thread). When it's better to use one or the other? Application.QueueAsyncCall has a Data: PtrInt parameter to pass some context and it is always called later, so this is useful for doing something after the current LCL event. TThread.Queue has aThread parameter, so the call is removed when the thread is freed, and when you call it from the main thread it will execute immediately, so this is for worker threads to asynchronously do something in the main thread. Yes, but they both allow the thread to run something asynchronously in the main thread (at different times but that's not really a concern). Both put the method in a list and try to wake the main thread (if possible). The main difference I see is that passing volatile data(*) is a little more convoluted with TThread.Queue(**) than with Application.QueueAsyncCall, but apart from that I see no big differences, that's why I'm asking when it's better to use one or the other (or if it doesn't really matter). (*) i.e. data that the thread can potentially modify *before* the main thread executes the method, but you want the main thread to see the data as it was when it was queued, like the example here https://wiki.freepascal.org/Asynchronous_Calls#Record_passed_to_async_function (**) you need to create a class instance that stores the data and frees itself after executing the method.Maybe, due to the overhead of doing that, it's better to use QueueAsyncCall in these cases. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] TThread.Queue vs Application.QueueAsyncCall
Hello, TThread.Queue and Application.QueueAsyncCall more or less do the same thing (even if they use two different queues that are managed at different times in the main thread). When it's better to use one or the other? When you're not using Lazarus' TApplication obviously you cannot use QueueAsyncCall, but for a gui application which one is preferable? Just curious, after having used "Synchronize" forever (the only option when I began using delphi, apart from PostMessage), I recently switched to QueueAsyncCall so that a thread can go on without waiting and now I discovered TThread.Queue. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Some source editor context menu items broken
El 21/5/23 a les 11:05, Luca Olivetti via lazarus ha escrit: El 21/5/23 a les 10:48, Michael Van Canneyt via lazarus ha escrit: Any solutions ? I found this issue a while ago (and I think I reported it here but I cannot find the message right now) found it https://lists.lazarus-ide.org/pipermail/lazarus/2019-May/236611.html Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Some source editor context menu items broken
El 21/5/23 a les 10:48, Michael Van Canneyt via lazarus ha escrit: Any solutions ? I found this issue a while ago (and I think I reported it here but I cannot find the message right now) and even if the context menu is greyed out, the "F2" key still works to rename the identifier. No idea about the "find identifier references" sorry. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
El 18/4/23 a les 15:41, Luca Olivetti via lazarus ha escrit: El 18/4/23 a les 12:25, Giuliano Colla via lazarus ha escrit: I did look in vain for that radiobutton. The only one available (Lazarus 2.2.6) is "clean common files": Strange that it's a only checkbox and not a radiobutton. In 2.2.6 (win32/linux qt5) I see a radiobutton with the options "Automatically", "Clean common files", "Clean all", then there's a checkbox "Switch after building to automatically". Maybe it's a problem with gtk2? Nope, I rebuild the ide with gtk2 and the radiobutton is still there. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
El 18/4/23 a les 12:25, Giuliano Colla via lazarus ha escrit: I did look in vain for that radiobutton. The only one available (Lazarus 2.2.6) is "clean common files": Strange that it's a only checkbox and not a radiobutton. In 2.2.6 (win32/linux qt5) I see a radiobutton with the options "Automatically", "Clean common files", "Clean all", then there's a checkbox "Switch after building to automatically". Maybe it's a problem with gtk2? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 28/3/23 a les 0:45, Luca Olivetti via lazarus ha escrit: El 28/3/23 a les 0:01, Michael Van Canneyt ha escrit: My bad, I made a typo, it should have been MyException:=ExceptionClass(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message) Thank you. Actually it is MyException:=TExceptionClass(Exception(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message); or MyException:=TExceptionClass(ut.FatalException.ClassType).Create(Exception(ut.FatalException).message) (TObject already has a ClassType, no need to cast it to Exception). with ExceptionClass= class of exception; Actually, I never write it like this in one statement, Yep, it's quite a mouthful, I had to break it up to spot the error :-) I save the class pointer and message in local variables, do cleanup first and then use the class pointer and message later to raise an exception. But the effect is the same: you create a copy with the same class and message as the original. But not with the same detail (i.e. any extra fields are missing). Not that I'm really interested in them (usually I just use the message), but still... Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 28/3/23 a les 0:01, Michael Van Canneyt ha escrit: My bad, I made a typo, it should have been MyException:=ExceptionClass(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message) Thank you. Actually it is MyException:=TExceptionClass(Exception(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message); with ExceptionClass= class of exception; Actually, I never write it like this in one statement, Yep, it's quite a mouthful, I had to break it up to spot the error :-) I save the class pointer and message in local variables, do cleanup first and then use the class pointer and message later to raise an exception. But the effect is the same: you create a copy with the same class and message as the original. But not with the same detail (i.e. any extra fields are missing). Not that I'm really interested in them (usually I just use the message), but still... Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 17:26, Luca Olivetti via lazarus ha escrit: El 27/3/23 a les 16:50, Michael Van Canneyt ha escrit: Ehm. In case of an exception, ut will never be freed ? That's what I said. I was looking for a way to free it *and* raise the exception in the context of the main thread. If I move the ut.free before the raise, the exception has already been freed and it's invalid, causing a sigsev, if I enclose it in a try..finally the exception handler will be called after the finally has freed the thread (and the exception, so it's the same problem). Normally, I'd do Raise Exception(ut.fatalexception.classtype).Create(ut.fatalexception.message); Actually I'd have to first create the exception, then free ut, then raise the exception (keep in mind that FatalException is a TObject and it isn't necessarily of class Exception), otherwise a direct raise as you wrote would not free ut. MyException:=nil; if ut.FatalException<>nil then begin if ut.FatalException is Exception then MyException:=Exception(ut.FatalException).Create(Exception(ut.FatalException).message) Ouch, I left out the ClassType, but if I change it to MyException:=Exception(Exception(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message) it's an instant segfault. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 16:50, Michael Van Canneyt ha escrit: Ehm. In case of an exception, ut will never be freed ? That's what I said. I was looking for a way to free it *and* raise the exception in the context of the main thread. If I move the ut.free before the raise, the exception has already been freed and it's invalid, causing a sigsev, if I enclose it in a try..finally the exception handler will be called after the finally has freed the thread (and the exception, so it's the same problem). Normally, I'd do Raise Exception(ut.fatalexception.classtype).Create(ut.fatalexception.message); Actually I'd have to first create the exception, then free ut, then raise the exception (keep in mind that FatalException is a TObject and it isn't necessarily of class Exception), otherwise a direct raise as you wrote would not free ut. MyException:=nil; if ut.FatalException<>nil then begin if ut.FatalException is Exception then MyException:=Exception(ut.FatalException).Create(Exception(ut.FatalException).message) else MyException:=Exception.create(ut.FatalException.ClassName); end; ut.free; if MyException<>nil then raise MyException; But it still doesn't work, since this way MyException is a copy of FatalException (i.e. it's no different than MyException:=Exception(ut.FatalExcaption), so freeing ut, which in turn frees ut.FatalException, makes it invalid and causes a sigsev. The best I could do is store the exception message and raise a new one. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 16:13, Michael Van Canneyt via lazarus ha escrit: On Mon, 27 Mar 2023, Luca Olivetti via lazarus wrote: El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: [*] instead of opening the query I spawn a thread that opens it, wait for it to finish while executing Application.ProcessMessages and eventually reraise the exception that was generated inside the thread. Speaking of which, I encapsulated it in a procedure (TWaitForm is the spash screen, Aproc is a procedure of object, TExecInThread simply calls AProc in its execute method): procedure ExecWithSplash(AProc:TThreadProc); var wf:TWaitForm; ut:TExecInThread; begin Wf:=TWaitForm.Create(Application); WF.Show; ut:=TExecInThread.create(AProc); while not ut.Finished Application.ProcessMessages wf.free; if ut.FatalException<>nil then raise(ut.FatalException); ut.free; Ehm. In case of an exception, ut will never be freed ? That's what I said. I was looking for a way to free it *and* raise the exception in the context of the main thread. If I move the ut.free before the raise, the exception has already been freed and it's invalid, causing a sigsev, if I enclose it in a try..finally the exception handler will be called after the finally has freed the thread (and the exception, so it's the same problem). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 15:55, Jean SUZINEAU via lazarus ha escrit: Le 27/03/2023 à 14:40, Luca Olivetti via lazarus a écrit : The problem here is, if AProc raises an exception, I cannot free the thread causing a leak. May be you can create a new exception class specifically for ExecWithSplash, instantiate it and put all the information of ut.FatalException in the new exception instance before raising it? Creating a specific exception class wouldn't solve the problem on how to make a deep copy of the original exception. I can just store the message an raise it again, losing the rest of the details, i.e.: ExceptionMessage:=''; if ut.FatalException<>nil then ExceptionMessage:=Exception(ut.FatalException).Message; ut.free; if ExceptionMessage<>'' then raise Exception.create(ExceptionMessage); The goal is to easily substitute the original code: try dosomething; dosomethingelse; except end; with try ExecWithSplash(@doit); except ... end; procedure TMyDatamodule.doit; begin dosomething; dosomethingelse; end; Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 15:40, Mattias Gaertner via lazarus ha escrit: procedure ExecWithSplash(AProc:TThreadProc); var wf:TWaitForm; ut:TExecInThread; begin Wf:=TWaitForm.Create(Application); WF.Show; ut:=TExecInThread.create(AProc); while not ut.Finished Application.ProcessMessages wf.free; if ut.FatalException<>nil then raise(ut.FatalException); ut.free; end; The problem here is, if AProc raises an exception, I cannot free the thread causing a leak. What does TExecInThread.Execute do? As I said, it just calls AProc (which the constructor stored in FProc) procedure TExecInThread.Execute; begin FProc() end; constructor TExecInThread.create(AProc:TThreadProc); begin FProc:=AProc; inherited create(false); end; Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: [*] instead of opening the query I spawn a thread that opens it, wait for it to finish while executing Application.ProcessMessages and eventually reraise the exception that was generated inside the thread. Speaking of which, I encapsulated it in a procedure (TWaitForm is the spash screen, Aproc is a procedure of object, TExecInThread simply calls AProc in its execute method): procedure ExecWithSplash(AProc:TThreadProc); var wf:TWaitForm; ut:TExecInThread; begin Wf:=TWaitForm.Create(Application); WF.Show; ut:=TExecInThread.create(AProc); while not ut.Finished Application.ProcessMessages wf.free; if ut.FatalException<>nil then raise(ut.FatalException); ut.free; end; The problem here is, if AProc raises an exception, I cannot free the thread causing a leak. Since I don't want to expose the thread to the caller, so that it can free it in its exception handler, how can I copy FatalException so I can free the thread and only then raise the exception? I cannot simply assign it to a local variable since the TThread destructor also frees FatalException. Encapsulating it in a try..finally block also doesn't work try if ut.FatalException<>nil then raise(ut.FatalException); finally ut.free; end Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 12:07, Giuliano Colla ha escrit: In a similar scenario my solution has been that of an horrible hack. It's a hack, but it works. I've put in a corner of my window a label of just one character, and, with a frequent timer (200 ms in my case) I update the caption. I'm using a sequence of "-" "\" " |" "/" "-" to display a rotating bar. Usually users do not even notice, but if they do it's harmless. This way I trigger an event which will force a paint operation, and all pending graphic updates are performed. Maybe this works also for you. You should just tune the timer to the speed of your animation. Thank you, but I don't think it would work (at least under windows I'm sure it doesn't), since in order to process the timer events the main loop must be processing events, and it's not doing that if the program is stuck in a lengthy operation. As per Sven's indication, I'm now doing all the painting in the main thread and delegated the lengthy operation to a thread. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 11:06, Sven Barth via lazarus ha escrit: Luca Olivetti via lazarus <mailto:lazarus@lists.lazarus-ide.org>> schrieb am Mo., 27. März 2023, 10:34: El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: > > Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : >> procedure TUpdateThread.Execute; >> begin >> while not Terminated do >> begin >> FWaitForm.ShowProgress; >> Sleep(30); >> end; >> end; > > Usually I use TThread.Synchronize to ensure that the graphic code is run > by the main thread. > > But it won't work if your main thread is blocking. Exactly > > May be you should do the inverse move the lengthy operation to a > separate thread and keep the main thread for the splash screen ? Yes, I usually do that, but in this case it's not possible (the lengthy operation is just a TSQLQuery.open that I cannot delegate to a different thread). You need to find a way then, because the GUI handling *must* be done in the main thread. Opening the query in a thread[*] seems to have no ill effects, so that's what I'm doing now. [*] instead of opening the query I spawn a thread that opens it, wait for it to finish while executing Application.ProcessMessages and eventually reraise the exception that was generated inside the thread. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 10:34, Luca Olivetti via lazarus ha escrit: El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : procedure TUpdateThread.Execute; begin while not Terminated do begin FWaitForm.ShowProgress; Sleep(30); end; end; Usually I use TThread.Synchronize to ensure that the graphic code is run by the main thread. But it won't work if your main thread is blocking. Exactly May be you should do the inverse move the lengthy operation to a separate thread and keep the main thread for the splash screen ? Yes, I usually do that, but in this case it's not possible (the lengthy operation is just a TSQLQuery.open that I cannot delegate to a different thread). Sorry, in this project I'm using zeos, so it's TZQuery.open. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : procedure TUpdateThread.Execute; begin while not Terminated do begin FWaitForm.ShowProgress; Sleep(30); end; end; Usually I use TThread.Synchronize to ensure that the graphic code is run by the main thread. But it won't work if your main thread is blocking. Exactly May be you should do the inverse move the lengthy operation to a separate thread and keep the main thread for the splash screen ? Yes, I usually do that, but in this case it's not possible (the lengthy operation is just a TSQLQuery.open that I cannot delegate to a different thread). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux
Hello, I'd like to show a splash screen with an animation during a lengthy operation. I cannot rely on a timer to show the animation since the message loop isn't running, so I'm using a thread to directly paint over the form, i.e.: WaitForm.Show; Application.ProcessMessages; ... procedure TWaitForm.FormShow(Sender: TObject); begin FUpdateThread:=TUpdateThread.Create(self); end; ... procedure TUpdateThread.Execute; begin while not Terminated do begin FWaitForm.ShowProgress; Sleep(30); end; end; ... procedure TWaitForm.ShowProgress; begin PaintBox1.Canvas.Clear; //WaitAnimation is an image list WaitAnimation.Draw(PaintBox1.Canvas,0,0,FImageIndex); FImageIndex:=FImageIndex+1; if FImageIndex>=WaitAnimation.Count then FImageIndex:=0; end; This works wonderfully under windows (which is my intended target, so no problem here), but under Linux it doesn't work (tested with gtk2, gtk3 and qt5). In fact, even the "Show; Application.ProcessMessages" is erratic, sometimes it shows the form, sometimes it doesn't. Lazarus 2.2.6/fpc 3.2.2 Any idea? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 24/2/23 a les 11:10, Michael Van Canneyt via lazarus ha escrit: No. RecalcBufListSize does not necessarily fetch all the records. It fetches as much records as needed: 10 by default, but classes such as TDBGrid may set the number of needed records to the number of visible grid lines. It can be that TBufDataset fetches all records on open, there is a property that controls this. But it can also fetch on an as-neede basis. FEOF is simply initialized from the first batch. But it is maintained based on the result of GetNextRecord. Check the MoveBy procedure. Only when GetNextRecord returns false, is FEOF set to True (line 2005). Thank you! With these insights (and a lot of sweat, blood and tears ;-)) I managed to write a descendant dataset that does what I want. Not 100% complete yet but getting there. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 17:16, Michael Van Canneyt ha escrit: write a TDataset descendant tailor made for this application, any pointer on how to write a minimal descendant? I'm looking at the TMemDataset implementation as an example, is it a good one? As good as any other. The idea is to substitute open and scrolling (next/prior/locate/etc.) with the appropriate sql statements to just retrieve a small buffer of data around the current record (I can do that easily enough), though I'm not sure that would be enough to fool the TDBGrid. I don't know what the grid exactly does, so I cannot advise. I did some tests and the grid is not a problem (it only fetches the records that are visible), the TDataset is: either I am blind or the only way for the TDataset to realize there is data is to fetch every record and allocate the corresponding buffers. That's because FRecordCount/FBof/FEof are private procedure TDataSet.DoInternalOpen; begin InternalOpen; FInternalOpenComplete := True; {$ifdef dsdebug} Writeln ('Calling internal open'); {$endif} {$ifdef dsdebug} Writeln ('Calling RecalcBufListSize'); {$endif} FRecordCount := 0; RecalcBufListSize; <-- this will fetch all the records FBOF := True; FEOF := (FRecordCount = 0); <--- FRecordCount must be set end; There's no point overriding GetNextRecords/GetNextRecord/GetPriorRecords/GetPriorRecord (called by RecalcBufListSize) since I cannot directly modify the private fields of the TDataSet. Any idea? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 17:16, Michael Van Canneyt ha escrit: Even if such a component existed, I don't think it would fit my use-case. Why do you think so ? Paging is exactly what you want to do. Not exactly, I mean, yes, it is paging but it has to be "transparent", I don't want to add "previous page" and "next page" buttons. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 13:52, Michael Van Canneyt via lazarus ha escrit: On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit: But IMO: in the first place you should ask yourself if displaying 10.000 records is what you actually want to do. No, I just need to display 20 or so records, the problem is I'd like the user to be able to scroll over the whole table, so I'd have to hook a lot of events in the TDBGrid (if that's even possible, otherwise I'd have to implement a replacement) and get rid of the TDBNavigator and implement a custom one in its place. The LCL could do with a pager component. Seems to be standard when Web pages display grids/tables, so users should be used to it :-) Even if such a component existed, I don't think it would fit my use-case. Maybe I should just write a TDataset descendant tailor made for this application, any pointer on how to write a minimal descendant? I'm looking at the TMemDataset implementation as an example, is it a good one? The idea is to substitute open and scrolling (next/prior/locate/etc.) with the appropriate sql statements to just retrieve a small buffer of data around the current record (I can do that easily enough), though I'm not sure that would be enough to fool the TDBGrid. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 12:24, Jean SUZINEAU via lazarus ha escrit: Le 23/02/2023 à 11:37, Luca Olivetti via lazarus a écrit : No, that's not possible, in any case polling isn't a problem: it's the same application that modifies the table, and it only does the "refresh" when necessary. That's exactly a use case for my orm ( https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte ) It's working with the Observer design pattern, no need to poll Thank you, but from a quick look it doesn't seem to solve the problem at hand. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 11:25, Marco van de Voort via lazarus ha escrit: Maybe upgrade to a DBMS (like firebird, mssql,postgres) that supports notifications so that you don't have to poll, but get a notification if something changes? No, that's not possible, in any case polling isn't a problem: it's the same application that modifies the table, and it only does the "refresh" when necessary. The problem is that it happens quite frequently (mind me, in a test environment, in the field the updates happen once or twice a minute, but I'm still not comfortable with the refresh taking too long). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit: But IMO: in the first place you should ask yourself if displaying 10.000 records is what you actually want to do. No, I just need to display 20 or so records, the problem is I'd like the user to be able to scroll over the whole table, so I'd have to hook a lot of events in the TDBGrid (if that's even possible, otherwise I'd have to implement a replacement) and get rid of the TDBNavigator and implement a custom one in its place. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 9:43, Michael Van Canneyt via lazarus ha escrit: Something like this: https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode This is not something that the grid handles. This is a dataset feature. Yes, I supposed so At this moment I know of no FPC/Lazarus dataset component that handles this automatically. bummer :-( Note the remark on that page: "Although FireDAC minimizes the number of generated and executed SQL commands in LDW mode, it still produces a heavier DB load than TFDQuery. So, application developers should carefully choose when to use TFDTable and LDW mode. " This is exactly why FPC does not have a database table component. It's horribly inefficient. OTOH a TDBGrid is a very convenient way to display data. I my application I just use it to display (in read-only mode) an sqlite table that holds less than 1000 records and it could be updated quite frequently (hence the need for the frequent TDataset.refresh), and it works fast enough with that limited amount of records. Now I need to expand the table to 1 records and the performance is unacceptable. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] db grid/dataset components that only load currently visible records?
El 23/2/23 a les 9:04, Luca Olivetti via lazarus ha escrit: Hello, do you know of any component/dataset combo that works like a TDBGrid but doesn't load all the records from the db when doing a refresh, just the ones that are currently visible, yet offering seamless scrolling? I looked in the wiki but I couldn't find any. Something like this: https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] db grid/dataset components that only load currently visible records?
Hello, do you know of any component/dataset combo that works like a TDBGrid but doesn't load all the records from the db when doing a refresh, just the ones that are currently visible, yet offering seamless scrolling? I looked in the wiki but I couldn't find any. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
El 21/2/23 a les 13:48, Bo Berglund via lazarus ha escrit: Any ideas what has gone wrong? no idea really, I'm not familiar with fppkg. I can only say that in lazarus my "fppkg configuration file" setting is empty, if I invoke "fppkg list" from the command line it works both under windows and linux, though under linux it shows that the installed rtl is 3.2.0 (even if I'm using fpc 3.2.2). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
El 21/2/23 a les 11:12, Bo Berglund via lazarus ha escrit: So it is definitely about the Lazarus version 2.2.4! I know that this won't help you, but just for the record I have Lazarus 2.2.4 both under windows and linux and no popup on either. Both self compiled with fpc 3.2.2 (32 bits fpc from installer under windows, 64 bits fpc self compiled under linux). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Using packages for often used units across projects?
El 12/2/23 a les 14:44, Bo Berglund via lazarus ha escrit: I found the wiki page: https://wiki.lazarus.freepascal.org/Lazarus_Packages it seems not to describe my use case, I believe. Actually it does, if you follow the heading "5.4 Creating a package for your common units" right at the beginning of the page https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_package_for_your_common_units Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] LazReport, how to mix data from multiple datasets?
El 11/1/23 a les 10:20, Luca Olivetti via lazarus ha escrit: El 10/1/23 a les 16:39, Luca Olivetti via lazarus ha escrit: For the record: in the report designer the band has a "Dataset" property and you can assign to it the name of a TRfDbDataset on the form. I tried that previously and it didn't seem to work. After some painful debugging (which involved a complete rebuild of the lazarus ide, don't ask me why, I'd like to know), I found out that the property value, in spite of being there in the lrf file, wasn't being read, but in the next debug session it was. Again, don't ask me why, but now everything seems to be ok. Ouch, that last problem was my fault: since I embed the files as resources, and obviously without a rebuild it wouldn't work. Bye Bye Hello, I see that I cannot use more than one dataset in a report (actually I can, the problem is that the second dataset show always the same line, repeated for how many rows there are in the first one i.e.: ds1 row1 ds1 row2 ds1 row3 ds2 row1 ds2 row1 ds2 row1 ) Previously I used two reports and combined them into a third one, i.e.: with CombinedReport do begin reports.clear; reports.add(FirstReport); reports.add(SecondReport); end; The problem is that the second report starts on a new page, while I need it to stay on the same page: *** Report header (or page header on subsequent pages) --- first dataset header ... first dataset data --- second dataset header ... second dataset data page footer The first dataset is supposed to occupy about half the page. Is there a way to do that? How? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] LazReport, how to mix data from multiple datasets?
El 10/1/23 a les 16:39, Luca Olivetti via lazarus ha escrit: For the record: in the report designer the band has a "Dataset" property and you can assign to it the name of a TRfDbDataset on the form. I tried that previously and it didn't seem to work. After some painful debugging (which involved a complete rebuild of the lazarus ide, don't ask me why, I'd like to know), I found out that the property value, in spite of being there in the lrf file, wasn't being read, but in the next debug session it was. Again, don't ask me why, but now everything seems to be ok. Bye Hello, I see that I cannot use more than one dataset in a report (actually I can, the problem is that the second dataset show always the same line, repeated for how many rows there are in the first one i.e.: ds1 row1 ds1 row2 ds1 row3 ds2 row1 ds2 row1 ds2 row1 ) Previously I used two reports and combined them into a third one, i.e.: with CombinedReport do begin reports.clear; reports.add(FirstReport); reports.add(SecondReport); end; The problem is that the second report starts on a new page, while I need it to stay on the same page: *** Report header (or page header on subsequent pages) --- first dataset header ... first dataset data --- second dataset header ... second dataset data page footer The first dataset is supposed to occupy about half the page. Is there a way to do that? How? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] LazReport, how to mix data from multiple datasets?
Hello, I see that I cannot use more than one dataset in a report (actually I can, the problem is that the second dataset show always the same line, repeated for how many rows there are in the first one i.e.: ds1 row1 ds1 row2 ds1 row3 ds2 row1 ds2 row1 ds2 row1 ) Previously I used two reports and combined them into a third one, i.e.: with CombinedReport do begin reports.clear; reports.add(FirstReport); reports.add(SecondReport); end; The problem is that the second report starts on a new page, while I need it to stay on the same page: *** Report header (or page header on subsequent pages) --- first dataset header ... first dataset data --- second dataset header ... second dataset data page footer The first dataset is supposed to occupy about half the page. Is there a way to do that? How? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazreport: how to print something when there are no records?
El 13/12/22 a les 12:53, Luca Olivetti via lazarus ha escrit: As per the subject, I'd like LazReport to print "No records to print" (or whatever else I want to print) when there are no records in the dataset. How do I do that? I found a way: add a record summary band with my text and in the OnBeginBand event I set its visible property to false if there are records in the dataset. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazreport: how to print something when there are no records?
As per the subject, I'd like LazReport to print "No records to print" (or whatever else I want to print) when there are no records in the dataset. How do I do that? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to fix slow screen refresh of TListbox?
El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit: On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus wrote: El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: But how to jump to the end of the text on screen? TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 Did not work, but this does work: Strange, I've been using it for many years (and still use it) to ensure the last line is visible. synRxData.CaretY := synRxData.Lines.Count; -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to fix slow screen refresh of TListbox?
El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: But how to jump to the end of the text on screen? TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to fix slow screen refresh of TListbox?
El 11/11/22 a les 17:56, Bo Berglund via lazarus ha escrit: I have never used TSynEdit before so I tried dropping one onto my form and it looked a bit "strange" with a wide margin to the left... > How does it work (especially the margin that steals space)? Play with the properties in the project inspector, you can remove the gutter (gutter.visible -> false), the margin (by setting RightEdge to a very big value, say 800) and customize much of its appearance.. Note that I do not need an editor as such, just somewhere to show the log lines, and possibly also a way to copy certain lines or text sections to paste somewhere else. Me too. Just set the readonly property to true and that's it. Then just treat it like a TMemo (using the Lines property). It has some more goodies that aren't available in a Tmemo. As I said, I was using a TMemo for logging and it was too slow under windows, I switched to a TSynEdit and had great improvement in performance. BTW this application is on Windows and I am using Lazarus 2.0.12 and FPC 3.2.0 So you'll probably see an improvement by using a TSynEdit (or maybe not, the only way to know is to try it). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to fix slow screen refresh of TListbox?
El 11/11/22 a les 16:29, Bo Berglund via lazarus ha escrit: I have noticed that after a while the display becomes very sluggish when data arrives and I think that is due to the way the component operates. You could try using a TSynEdit instead of a TListBox: some years ago I switched from TMemo to TSynEdit to do some logging in a similar (though I add lines instead of assigning the complete text, also, I delete the oldest line when there are 5000 lines) because I found that, under windows, TSynEdit is an order of magnitude (or more) faster than TMemo. No difference under linux though, and maybe it's no longer true nowadays. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] GStreamer API unit added
El 9/11/22 a les 3:06, Aruna Hewapathirane via lazarus ha escrit: This time it tries to link but dies saying can't find : /usr/bin/ld.bfd: cannot find -lgstreamer-1.0 In debian/ubuntu based distributions you'll have to install the libgstreamer1.0-dev package: $ apt-file search libgstreamer-1.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1404.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1602.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1603.0 libgstreamer1.0-dev: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so libgstreamer1.0-dev: /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1602.0-gdb.py libgstreamer1.0-dev: /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1603.0-gdb.py Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] pas2js and server sent events
El 26/8/22 a les 9:27, Ondrej Pokorny ha escrit: Hello Luca, better send the message to pas2js mailing list directly: https://lists.freepascal.org/mailman/listinfo/pas2js/ Ouch, I forgot there ir a pas2js list and I'm even subscribed to it. Done. Sorry for the noise. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] pas2js and server sent events
Hello, I see that pas2js has support for websockets, but I cannot find if it also supports server sent events. A couple of years ago I implemented an application with sse where I used fpWeb and plain html+javascript in the browser. Now I need to implement a more complex application and I'd like to use pas2js, if it supports sse I can reuse the old server class, if it doesn't I'll have to reimplement it as a websocket server. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?
El 24/8/22 a les 13:15, Luca Olivetti via lazarus ha escrit: El 24/8/22 a les 12:50, Michael Van Canneyt ha escrit: https://bugs.freepascal.org/view.php?id=33737 I added a couple of comments to that bug (that I cannot reopen). I reopened it. If you can implement a patch that checks forcedClosed for postgres, I will be glad to check & apply it... As you can see from the bug report, I tried, I failed, I gave up :-( I'll use the nuclear option that I used 4 years ago, i.e. brutally close the app if the connection to the database is severed, then a watchdog app will restart it. In this case the client app and the postgresql server will run in the same pc so it shouldn't be a big issue (crossing fingers). Wait, it seems it's a simple fix. I'll attach a patch later if I see it works. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?
El 24/8/22 a les 12:50, Michael Van Canneyt ha escrit: https://bugs.freepascal.org/view.php?id=33737 I added a couple of comments to that bug (that I cannot reopen). I reopened it. If you can implement a patch that checks forcedClosed for postgres, I will be glad to check & apply it... As you can see from the bug report, I tried, I failed, I gave up :-( I'll use the nuclear option that I used 4 years ago, i.e. brutally close the app if the connection to the database is severed, then a watchdog app will restart it. In this case the client app and the postgresql server will run in the same pc so it shouldn't be a big issue (crossing fingers). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?
El 17/5/18 a les 9:50, Luca Olivetti via Lazarus ha escrit: El 15/05/18 a les 21:43, Luca Olivetti via Lazarus ha escrit: El 15/05/18 a les 21:11, Michael Van Canneyt via Lazarus ha escrit: I will need to check this, but the purpose of Close(True) is exactly to ignore errors while closing for a reconnect. It was introduced and tested in the case of MySQL, but normally should work on any database. Can you please post a small sample program in the bugtracker ? Done https://bugs.freepascal.org/view.php?id=33737 I added a couple of comments to that bug (that I cannot reopen). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 30/6/22 a les 18:20, Werner Pamler via lazarus ha escrit: But isn't this the same problem? When Vampyre is not installed, and the streamer sees the TImageingPNG classname there is no way how to find the end of the Picture.Data block. Wouldn't it be better (if at all possible) to add a dependency on the unit that registered the class for streaming? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 30/6/22 a les 13:45, Luca Olivetti via lazarus ha escrit: I'm puzzled: now I removed the vampyre lib from the ide, in a form I need ImagingComponent and ImagingClassed. I drop a TPicture with a png image and it is blank at runtime. This time it is streamed as TPortableNetworkGraphic *but* FindClassName cannot find it. How is that possible? AAAGH Because the Vampyre library explicitly deletes it {$IFDEF COMPONENT_SET_LCL} // Unregister Lazarus´ default PNG loader which crashes on some PNG files TPicture.UnregisterGraphicClass(TPortableNetworkGraphic); {$ENDIF} Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 24/6/22 a les 9:48, Luca Olivetti via lazarus ha escrit: El 24/6/22 a les 0:19, Mattias Gaertner via lazarus ha escrit: but why did it find the class for writing and not for reading it back? Also, once solved that, if it streams it using a class provided by a package, shouldn't the project have a dependency automatically added on that package? Both should read+write valid png files, otherwise there is a bug. I was stepping though the method TPicture.ReadData(Stream: TStream) and I saw that GraphicClassName was "TImagingPNG" but the line GraphicClass := GetPicFileFormats.FindClassName(GraphicClassName) returned nil I'm puzzled: now I removed the vampyre lib from the ide, in a form I need ImagingComponent and ImagingClassed. I drop a TPicture with a png image and it is blank at runtime. This time it is streamed as TPortableNetworkGraphic *but* FindClassName cannot find it. How is that possible? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Differentiate between insert and append in TDataset events
Hello, using a TDbGrid, I want to take different actions if the user is inserting or appending a record (in this case to automatically assign the ordering field so that the record appears in the right row after post). The method TDataSet.DoInsertAppend just differentiates them internally, there is no flag/parameter to indicate it to the events (i.e. BeforeInsert, OnNewRecord, AfterInsert), I suppose because delphi does it that wey. Now, since I'm using zeos, I see that if it's inserting, the RecNo in AfterInsert is the same as it was in BeforeInsert, while they are different during an append. I suppose that depends on the TDataset and database used, so it may not hold true if I switch to a different dataset or database. Is there a better, proper, way to discriminate between the two cases? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazarus 2.2 and FormResize
With Lazarus 2.0.12 the OnResize event for a form was fired while resizing, but in 2.2.2 it's fired only when the resizing is done (only under windows, under linux it behaves the same as before). However, if I put, say, a panel with top,left,bottom,right anchoring, its OnResize event is fired while resizing. Is there a way to restore the previous behaviour for a form? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 26/6/22 a les 13:44, Werner Pamler via lazarus ha escrit: Am 26.06.2022 um 13:20 schrieb Luca Olivetti via lazarus: El 26/6/22 a les 11:36, Werner Pamler via lazarus ha escrit: Am 26.06.2022 um 10:54 schrieb Luca Olivetti via lazarus: VampyreImaginPackage 0.80 Mine is v0.82 which is the current version in OPM. According to their release notes there are changes related to PNG saving. My online package manager only has 0.80, the repository is http://packages.lazarus-ide.org Ah, I had installed the git version, and then OPM displays the installed version number... You can find the author's github version (v0.82) at https://github.com/galfar/imaginglib (if you don't use git, you can download also a zip from there). Even if version 0.82 solves the stream read error, the underlying problem is still there: it hijacks the format used for streaming TPicture but there is no dependency added to the projects when you add a TPicture. I don't know if that's even possible, but it is a problem nevertheless. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 26/6/22 a les 11:36, Werner Pamler via lazarus ha escrit: Am 26.06.2022 um 10:54 schrieb Luca Olivetti via lazarus: VampyreImaginPackage 0.80 Mine is v0.82 which is the current version in OPM. According to their release notes there are changes related to PNG saving. My online package manager only has 0.80, the repository is http://packages.lazarus-ide.org Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 26/6/22 a les 1:08, Werner Pamler via lazarus ha escrit: It doesn't even work at designtime (see above). Try attached demo project. The "paw" image was inserted into a TImage after installation of Vampyre. All I had to do to get it working is to add Vampyre to the project requirements and to add ImagingComponents to the uses clause (or check the box "Add package unit to uses section" in the package options, then the formats will be registered for runtime automatically). With the VampyreImaginPackage 0.80 not installed in the ide, I can open the project, see a blank image and when I try to run it: "Project project1 raised exception class 'EReadError' with message: Stream read error" With the package installed I get the error as soon as I try to open the project (as well as when I try to run it). I cannot install the VampyreImagingPackageExt Warning: linker: /usr/bin/ld: /home/luca/Datos/laz_2_2/onlinepackagemanager/packages/VampyreImaging/Packages/lib/VampyreImagingPackageExt/3.2.2/x86_64-linux/default/ZLibDelphi.o: undefined reference to symbol 'deflateInit_' (in fact, I never installed it, yet it streamed the pictures as TImagingPMG) Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 24/6/22 a les 17:27, Werner Pamler via lazarus ha escrit: Ah, of course. (I thought I had searched for "Register" in unit graphics...). Now I saw that Vampyre also uses these TPicture class methods to finally register their formats for TPicture. Thus, everything should be fine. No, it isn't: it doesn't find the class when reading. When you copy and paste a TImage you'll have a stream read error, as well as when reopening the project. But still the situation is not very satisfying. Yes, I find it suboptimal that the picture format can be hijacked without adding a dependency on the needed package to correctly read it back. Of course it's my fault since I installed it in the ide without a real need, but I still think there's something wrong. First observation after installing VampyreImagingPackageExt (the other package, VampyreImagingPackage, has no registration unit): I add TImage to a form and load the Lazarus "paw" to it. Works fine at designtime, but at runtime the image is empty. As the OP already noted Vampyre's TImagingPNG class is not found. This is because the Vampyre formats are registered only at designtime, but not at runtime of a project. It doesn't even work at designtime (see above). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
[sorry for the top post, I'm answering from my phone] I think it does, otherwise the TPicture in the TImage wouldn't be streamed as TImagingPNG. OTOH, if I read the TPicture code correctly, there's only one registration so I don't understand how it is possible that it finds the class for writing but not for reading. 24 jun. 2022 11:09:36 Werner Pamler via lazarus : > Vampyre does not take care of the FPC image type registration. But that's not > the problem.. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 24/6/22 a les 0:19, Mattias Gaertner via lazarus ha escrit: but why did it find the class for writing and not for reading it back? Also, once solved that, if it streams it using a class provided by a package, shouldn't the project have a dependency automatically added on that package? Both should read+write valid png files, otherwise there is a bug. I was stepping though the method TPicture.ReadData(Stream: TStream) and I saw that GraphicClassName was "TImagingPNG" but the line GraphicClass := GetPicFileFormats.FindClassName(GraphicClassName) returned nil Are you sure, that the VampyreImaging lib is supposed to be installed in the IDE and to replace the default png TPicture? Actually I'm not, since it works fine for what I need without installing it, but in its options IDE Integration is marked as "Designtime and runtime". Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 23/6/22 a les 21:40, Mattias Gaertner via lazarus ha escrit: On Thu, 23 Jun 2022 20:38:59 +0200 Luca Olivetti via lazarus wrote: [...] I don't understand why the ide prefers one class over the other, I guess they are all treated the same and the one registered last wins? Correct. See TPicture.RegisterFileFormat Not that it's going to matter now that I uninstalled the package, but why did it find the class for writing and not for reading it back? Also, once solved that, if it streams it using a class provided by a package, shouldn't the project have a dependency automatically added on that package? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 23/6/22 a les 13:29, Luca Olivetti via lazarus ha escrit: I self build lazarus from the git sources, so maybe it is something in my environment. I found the cause: it's the VampyreImaging library. If I install it in the ide, it will stream png as "TImagingPNG" instead of "TPortableNetworkGraphic" but then it cannot read that format back (the method TPicture.ReadData doesn't find the corresponding class). I suppose it does the same for all other image type that the VampyreImaging library supports. I just uninstalled it from the ide and left it as a dependency for the projects where I need it (that's what I did with the previous version of lazarus, maybe I encountered the same problem and forgot about it). I don't understand why the ide prefers one class over the other, I guess they are all treated the same and the one registered last wins? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 23/6/22 a les 13:29, Luca Olivetti via lazarus ha escrit: I tested under both linux(qt5) and windows and the behavior is the same (the only difference is that under windows I use fpc 3.2.0 with lazarus 2.0.12 and 3.2.2 with 2.2.2, while under windows I use fpc 3.2.2 for both). Windows 32 bits and Linux 64 bits. That doesn't make sense: under *linux* I use the same fpc for both lazarus versions. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Strange issue with TImage and lazarus 2.2.2
Before reporting an issue, I wanted to ask. I have a strange issue with TImage and lazarus 2.2.2: if (at designtime) I load a png or a jpg image in a TImage but at runtime it is blank. Worse, if I copy paste it, I get a streaming read error on Data (either when pasting or when running the program, the latter not always). Only .ico seems to work with lazarus 2.2.2. Now, if I open the same project in lazarus 2.0.12, the image is blank, I load a picture and it works. Then I open the modified project with lazarus 2.2.2, at designtime the image is blank, but when the program is run I can see the image I loaded with lazarus 2.0.12. I self build lazarus from the git sources, so maybe it is something in my environment. I tested under both linux(qt5) and windows and the behavior is the same (the only difference is that under windows I use fpc 3.2.0 with lazarus 2.0.12 and 3.2.2 with 2.2.2, while under windows I use fpc 3.2.2 for both). Windows 32 bits and Linux 64 bits. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus