From sysrpl at gmail.com Thu Apr 1 08:58:24 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 1 Apr 2021 02:58:24 -0400 Subject: [Lazarus] Clipboard Data Goes Away Message-ID: On Linux Gtk2, over time I have noticed a problem where data copied to the clipboard by a Lazarus application does not persist on the clipboard after the Lazarus program has exited. While writing this application that captures image data to the clipboard, the data on the clipboard is only available to other applications while mine is running. If I exit my program the clipboard data goes away. The same problem occurs if the clipboard data is text rather than a bitmap. Is this a known issue on Linux LCL Gtk2? Is there a workaround? Thank you for your attention. -------------- next part -------------- An HTML attachment was scrubbed... URL: From l at c-m-w.me.uk Thu Apr 1 09:24:58 2021 From: l at c-m-w.me.uk (Colin Western) Date: Thu, 1 Apr 2021 08:24:58 +0100 (BST) Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: Message-ID: <795207543.360698.1617261898270@email.ionos.co.uk> This is the way the linux clipboard works - the data is kept with the source program, so goes when the program closes. Colin > On 01/04/2021 07:58 Anthony Walter via lazarus wrote: > > > On Linux Gtk2, over time I have noticed a problem where data copied to the clipboard by a Lazarus application does not persist on the clipboard after the Lazarus program has exited. > > While writing this application (https://cache.getlazarus.org/images/desktop/capture-tool.png) that captures image data to the clipboard, the data on the clipboard is only available to other applications while mine is running. If I exit my program the clipboard data goes away. The same problem occurs if the clipboard data is text rather than a bitmap. > > Is this a known issue on Linux LCL Gtk2? Is there a workaround? > > Thank you for your attention. > > -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus From sysrpl at gmail.com Thu Apr 1 09:26:47 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 1 Apr 2021 03:26:47 -0400 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: Message-ID: I noticed a recent discussion touching on this problem posted by Bo Berglund on November 20, 2020 to this same mailing list. Andreas Schneider replied in that thread, 'Pasting basically asks the application that "copied" it to get the content. If that app is gone in the meantime, there's nothing to paste anymore.' Also, Colin Western replied this is how Linux applications work, 'the data is kept with the source program, so goes when the program closes'. I disagree. I've tested several Gtk2 applications, including older versions of Gimp and Geany. Both these programs have clipboard copy functions and the data on the clipboard from those applications my tests show their clipboard data persists after they have been closed. So it would seem that Gtk2 the clipboard works correctly and handles persisting data after an application has exited. I stepped through the LCL source and it looks like the clipboard code is using some Gtk clipboard functions, and not using X windows functions, thereby introducing a possible problem, but I am unsure if the LCL is using the Gtk clipboard correctly. That is, the LCL might be using some Gtk clipboard functions which seem to work well, but exhibit the problematic behaviour I've described. -------------- next part -------------- An HTML attachment was scrubbed... URL: From l at c-m-w.me.uk Thu Apr 1 09:42:59 2021 From: l at c-m-w.me.uk (Colin Western) Date: Thu, 1 Apr 2021 08:42:59 +0100 (BST) Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: Message-ID: <1830908332.361221.1617262979037@email.ionos.co.uk> I am very confident that the X11 behaviour is that the data goes with the application. It might be that more recent desktops/toolkits have some work around, but the gtk2 functions lazarus uses only copy data externally when asked for by an X11 messaage and this is all gtk2 provides. Colin > On 01/04/2021 08:26 Anthony Walter via lazarus wrote: > > > I noticed a recent discussion touching on this problem posted by Bo Berglund on November 20, 2020 to this same mailing list. > > Andreas Schneider replied in that thread, 'Pasting basically asks the application that "copied" it to get the content. If that app is gone in the meantime, there's nothing to paste anymore.' > > Also, Colin Western replied this is how Linux applications work, 'the data is kept with the source program, so goes when the program closes'. > > I disagree. > > I've tested several Gtk2 applications, including older versions of Gimp and Geany. Both these programs have clipboard copy functions and the data on the clipboard from those applications my tests show their clipboard data persists after they have been closed. So it would seem that Gtk2 the clipboard works correctly and handles persisting data after an application has exited. > > I stepped through the LCL source and it looks like the clipboard code is using some Gtk clipboard functions, and not using X windows functions, thereby introducing a possible problem, but I am unsure if the LCL is using the Gtk clipboard correctly. That is, the LCL might be using some Gtk clipboard functions which seem to work well, but exhibit the problematic behaviour I've described. > -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus From michael at freepascal.org Thu Apr 1 09:44:26 2021 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 1 Apr 2021 09:44:26 +0200 (CEST) Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: Message-ID: On Thu, 1 Apr 2021, Anthony Walter via lazarus wrote: > I noticed a recent discussion touching on this problem posted by Bo > Berglund on November 20, 2020 to this same mailing list. > > Andreas Schneider replied in that thread, 'Pasting basically asks the > application that "copied" it to get the content. If that app is gone in the > meantime, there's nothing to paste anymore.' > > Also, Colin Western replied this is how Linux applications work, 'the data > is kept with the source program, so goes when the program closes'. > > I disagree. > > I've tested several Gtk2 applications, including older versions of Gimp > and Geany. Both these programs have clipboard copy functions and the data > on the clipboard from those applications my tests show their clipboard data > persists after they have been closed. So it would seem that Gtk2 the > clipboard works correctly and handles persisting data after an application > has exited. > > I stepped through the LCL source and it looks like the clipboard code is > using some Gtk clipboard functions, and not using X windows functions, > thereby introducing a possible problem, but I am unsure if the LCL is using > the Gtk clipboard correctly. That is, the LCL might be using some Gtk > clipboard functions which seem to work well, but exhibit the problematic > behaviour I've described. I think the programs you tested use some extra functions, because as these 2 persons already said: under X11, the selection is owned by the program, not by X11. See e.g. https://www.uninformativ.de/blog/postings/2017-04-02/0/POSTING-en.html https://wiki.ubuntu.com/ClipboardPersistence for an explanation. Basically: if you don't communicate with a persistent clipboard app, then nothing will happen to persist your selection. Michael. From sysrpl at gmail.com Thu Apr 1 09:45:16 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 1 Apr 2021 03:45:16 -0400 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: <1830908332.361221.1617262979037@email.ionos.co.uk> References: <1830908332.361221.1617262979037@email.ionos.co.uk> Message-ID: Perhaps there is a Linux service that can be used by applications to hand over and take ownership of clipboard data, and applications such as those I mentioned are using it in order to solve the problem I am describing? -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Thu Apr 1 09:48:07 2021 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 1 Apr 2021 09:48:07 +0200 (CEST) Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: <1830908332.361221.1617262979037@email.ionos.co.uk> Message-ID: On Thu, 1 Apr 2021, Anthony Walter via lazarus wrote: > Perhaps there is a Linux service that can be used by applications to hand > over and take ownership of clipboard data, and applications such as those I > mentioned are using it in order to solve the problem I am describing? > See my earlier reply for some links. Michael. From sysrpl at gmail.com Thu Apr 1 09:55:46 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 1 Apr 2021 03:55:46 -0400 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: <1830908332.361221.1617262979037@email.ionos.co.uk> Message-ID: Thanks Michael. It looks as if this problem was fixed in Gtk2 by version 2.6. The developers added this function to work around this problem: void gtk_clipboard_store (GtkClipboard *clipboard); Stores the current clipboard data somewhere so that it will stay around after the application has quit. Parameters clipboard a GtkClipboard Since: 2.6 Looking at the LCL source, it seems the Gtk3 LCL is using this function to save the clipboard data after the program exists, but it's not being used in the Gtk2 LCL. With this function, the problem I've described should be fixable in LCL Gtk2. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Thu Apr 1 10:35:05 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 1 Apr 2021 04:35:05 -0400 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: <1830908332.361221.1617262979037@email.ionos.co.uk> Message-ID: Here is a follow-up. I wrote a simple test using LCL Gtk2 and gtk_clipboard_store. This test allows the clipboard data to persist after my program exited. Button1 click sets the clipboard data. If Button2 clicked the data will persist after the program exits. If Button2 is not clicked, the data does not persist. Curiously, as the LCL Gtk2 currently stands, gtk_clipboard_store() does not work. I suspect the LCL is not using the same GdkAtom clipboard as returned by gtk_clipboard_get(GDK_SELECTION_CLIPBOARD). uses Gtk2, Gdk2; { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var S: string; begin S := Edit1.Text; gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), PChar(S), Length(S)) end; procedure TForm1.Button2Click(Sender: TObject); begin gtk_clipboard_store(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); end; procedure TForm1.Button3Click(Sender: TObject); begin Close; end; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From l at c-m-w.me.uk Thu Apr 1 18:51:35 2021 From: l at c-m-w.me.uk (C Western) Date: Thu, 1 Apr 2021 17:51:35 +0100 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: <1830908332.361221.1617262979037@email.ionos.co.uk> Message-ID: (You have definitely educated me) I tried something similar on one of my own applications, and it doesn't work for me either. I suspect sometihing more elaborate is required, as I don't think the LCL does calls gtk_clipboard_set_text, even for text. Reading the documentation for gtk_clipboard_set_can_store suggests this should be called also, but a quick trial of this didn't work either. Colin On 01/04/2021 09:35, Anthony Walter via lazarus wrote: > Here is a follow-up. > > I wrote a simple test using LCL Gtk2 and gtk_clipboard_store. This > test allows the clipboard data to persist after my program exited. > Button1 click sets the clipboard data. If Button2 clicked the data > will persist after the program exits. If Button2 is not clicked, the > data does not persist. Curiously, as the LCL Gtk2 currently stands, > gtk_clipboard_store() does not work. I suspect the LCL is not > using the same GdkAtom clipboard as returned by > gtk_clipboard_get(GDK_SELECTION_CLIPBOARD). > > uses >   Gtk2, Gdk2; > > { TForm1 } > > procedure TForm1.Button1Click(Sender: TObject); > var >   S: string; > begin >   S := Edit1.Text; > gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), > PChar(S), Length(S)) > end; > > procedure TForm1.Button2Click(Sender: TObject); > begin > gtk_clipboard_store(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); > end; > > procedure TForm1.Button3Click(Sender: TObject); > begin >   Close; > end; > > From sysrpl at gmail.com Thu Apr 1 20:55:44 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 1 Apr 2021 14:55:44 -0400 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: <1830908332.361221.1617262979037@email.ionos.co.uk> Message-ID: Colin, After some research I've found that LCL Gtk2 isn't using gtk_clipboard_x functions, rather it's using gtk_selection_x functions. There are gtk_clipboard functions to do the same thing as gtk_selection functions, but because the gtk_clipboard functions are not being used, the gtk_clipboard_store function does not work with the LCL Gtk2 clipboard. I've written a mini clipboard class that allows for multiple formats on the clipboard at the same time and it works well and also allows clipboard data to persist after my application closes, but my design does not conform to the WS (widgetset) model used by the LCL, and thus operates outside of the LCL. In the end, I'm confident that if LCL Gtk2 were written to use gtk_clipboard functions instead of gtk_selection functions, the problem could be fixed. I do not mean to place blame on any of the LCL Gtk2 developers, as the gtk_clipboard functions were most likely developed and released sometime after the first few iterations of Gtk2. Particularly, the gtk_clipboard_set_can_store did not exist until Gtk 2.6. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Fri Apr 2 09:12:04 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 02 Apr 2021 09:12:04 +0200 Subject: [Lazarus] Clipboard Data Goes Away References: Message-ID: On Thu, 1 Apr 2021 03:26:47 -0400, Anthony Walter via lazarus wrote: >I noticed a recent discussion touching on this problem posted by Bo >Berglund on November 20, 2020 to this same mailing list. > I'm back... In fact I have a *related* clipboard issue inside Lazarus itself: Working in Lazarus via a VNC connection to a RaspberryPi (Lazarus is on the RPi). If I try to search for a string which I have copied in Windows the following happens: - String copied in Windows - Use Ctrl-V in Lazarus and the string is pasted into the code editor OK - This shows that the string is in the clipboard - String again copied in Windows - Hit F3 in Lazarus to start a search, a bogus search term appears - Use Ctrl-V to paste the copied string into the Lazarus search dialog - Nothing happens... - Go back to windows and re-copy the string - In Lazarus select the bogus search item in the dialog - Try to replace it with Ctrl-V - Nothing happens... - Finally go back to Windows and again copy the search string - Now in Lazarus use Backspace to erase the bogus search item in the existing search dialog which was not closed - Hit Ctrl-V to paste the search string - NOW FINALLY! The string is pasted into the search dialog It seems like the clipboard is cleared (or replaced) by the following opertations in Lazarus: - Using F3 to start a search operation with nothing selected in the source - Selecting the bogus word in the search dialog in order to replace it Why this behaviour? I am constantly being hit with this when I am porting a Windows application from Delphi to Linux-FreePascal. I have the project open in Windows and the converted project in Linux and trying to navigate via searches is just so cumbersome with this behaviour. -- Bo Berglund Developer in Sweden From marc at dommelstein.nl Fri Apr 2 10:08:20 2021 From: marc at dommelstein.nl (Marc Weustink) Date: Fri, 02 Apr 2021 10:08:20 +0200 Subject: [Lazarus] Clipboard Data Goes Away In-Reply-To: References: Message-ID: <9AB8CCFB-C654-4AC4-AA40-56FB4358EB39@dommelstein.nl> Just s general warning, it doesn't say anything about your observations. Be careful with drawing conclusions when using vnc. The past year I've been working remote and I'm using vnc to access my desktop at work. Transferring clipboard data most times work, but sometimes it is a pain. It won't copy or paste the right selection. Reconnecting vnc usually solves the issue. This is independent of the source or target application. So the issue you observed might be caused by vnc or it might be indeed an issue in Lazarus Marc On April 2, 2021 9:12:04 AM GMT+02:00, Bo Berglund via lazarus wrote: >On Thu, 1 Apr 2021 03:26:47 -0400, Anthony Walter via lazarus > wrote: > >>I noticed a recent discussion touching on this problem posted by Bo >>Berglund on November 20, 2020 to this same mailing list. >> >I'm back... >In fact I have a *related* clipboard issue inside Lazarus itself: > >Working in Lazarus via a VNC connection to a RaspberryPi (Lazarus is on >the >RPi). > >If I try to search for a string which I have copied in Windows the >following >happens: > >- String copied in Windows >- Use Ctrl-V in Lazarus and the string is pasted into the code editor >OK >- This shows that the string is in the clipboard > >- String again copied in Windows >- Hit F3 in Lazarus to start a search, a bogus search term appears >- Use Ctrl-V to paste the copied string into the Lazarus search dialog >- Nothing happens... > >- Go back to windows and re-copy the string >- In Lazarus select the bogus search item in the dialog >- Try to replace it with Ctrl-V >- Nothing happens... > >- Finally go back to Windows and again copy the search string >- Now in Lazarus use Backspace to erase the bogus search item in the >existing >search dialog which was not closed >- Hit Ctrl-V to paste the search string >- NOW FINALLY! The string is pasted into the search dialog > >It seems like the clipboard is cleared (or replaced) by the following >opertations in Lazarus: >- Using F3 to start a search operation with nothing selected in the >source >- Selecting the bogus word in the search dialog in order to replace it > >Why this behaviour? I am constantly being hit with this when I am >porting a >Windows application from Delphi to Linux-FreePascal. >I have the project open in Windows and the converted project in Linux >and trying >to navigate via searches is just so cumbersome with this behaviour. > > >-- >Bo Berglund >Developer in Sweden > >-- >_______________________________________________ >lazarus mailing list >lazarus at lists.lazarus-ide.org >https://lists.lazarus-ide.org/listinfo/lazarus From bo.berglund at gmail.com Fri Apr 2 10:55:21 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 02 Apr 2021 10:55:21 +0200 Subject: [Lazarus] Clipboard Data Goes Away References: <9AB8CCFB-C654-4AC4-AA40-56FB4358EB39@dommelstein.nl> Message-ID: <48md6gpb58v27ktbvrvvam4aokngg97nji@4ax.com> On Fri, 02 Apr 2021 10:08:20 +0200, Marc Weustink via lazarus wrote: >Just s general warning, it doesn't say anything about your observations. > >Be careful with drawing conclusions when using vnc. The past year I've been working remote and I'm using vnc to access my desktop at work. Transferring clipboard data most times work, but sometimes it is a pain. It won't copy or paste the right selection. Reconnecting vnc usually solves the issue. >This is independent of the source or target application. > >So the issue you observed might be caused by vnc or it might be indeed an issue in Lazarus Just as a test with Lazarus on Windows I repeated the sequences I described when copying the same text as before on Windows (in Notepad++) and then using Ctrl-F or F3 inside Lazarus on Windows in order to start a new search. The search dialog was showing a nonrelated search string but Ctrl-V worked just fine to replace it with my copied text. Here of course VNC is not involved and all operations happened in Windows. So I now went into the VNC session on Linux and there I opened a text editor in addition to Lazarus. I entered text into the text editor and then coped one word there. Back into Lazarus (still in Linux) I used both Ctrl-F and F3 to start search dialogs and in both cases there was an unrelated search term coming up, but also in both cases using Ctrl-V to paste my previously copied text worked fine! So I must concur with your observation that this case is a VNC clipboard issue! Good to know, but disturbing nevertheless... Now I remember having read that Linux has more than one clipboard, possibly VNC is using the "wrong" one? But it still works when just copying text from Windows and pasting it directly into the Lazarus code editor in Linux... Just not into the search dialog. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Apr 8 17:24:30 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 08 Apr 2021 17:24:30 +0200 Subject: [Lazarus] Viewing config data in a tree style Message-ID: Alluding to the current freepascal list thread about "Directory Tree"... I wonder if there is some simple way to visually display, edit and save configuration data that contain settings, which are structured like ini files with sections and items? I am porting an application written in Delphi (hence only for Windows) into Lazarus on Linux. The config data from the registry are displayed in a multi-level tree, much like how the Windows Registry Editor displays the reg data. The multi-level registry stuff is not so easy to transfer into an ini structured conf file so I am going to flatten it out by having one level of sections and naming them such that the relations are apparent. Rather than creating something from scratch I would like to know if there are some existing controls I can use in Lazarus where I ideally could just load the control from file and save to file too. And of course edit the name/value pairs easily. The Lazarus Tool/Options displays a similarly looking dialog if the right hand panes are replaced by simple lists of name/value pairs.... Any suggestions? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Apr 8 23:24:31 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 08 Apr 2021 23:24:31 +0200 Subject: [Lazarus] How to reduce size of lazarus itself? Message-ID: I just checked out 2.0.12 on a RaspberryPi4 and built it using my existing fpc 3.2.0. The size of the executable is 271,368,224 bytes, which reduces to 30,127,876 after using strip -s on it (takes away all the symbols). Since I am never ever going to be debugging lazarus itself, is there some setting I can use to NOT include the symbols in the first place? I want a lean and fast binary... Obviously since Lazarus rebuilds itself when packages are installed in the IDE, this setting must be part of the installation somehow. -- Bo Berglund Developer in Sweden From lazarus at mfriebe.de Fri Apr 9 00:46:53 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 9 Apr 2021 00:46:53 +0200 Subject: [Lazarus] How to reduce size of lazarus itself? In-Reply-To: References: Message-ID: On 08/04/2021 23:24, Bo Berglund via lazarus wrote: > I just checked out 2.0.12 on a RaspberryPi4 and built it using my existing fpc > 3.2.0. > The size of the executable is 271,368,224 bytes, which reduces to 30,127,876 > after using strip -s on it (takes away all the symbols). > > Since I am never ever going to be debugging lazarus itself, is there some > setting I can use to NOT include the symbols in the first place? > I want a lean and fast binary... > > Obviously since Lazarus rebuilds itself when packages are installed in the IDE, > this setting must be part of the installation somehow. > > Settings are taken from Tools > configure build lazarus. Put -O3 -g- in there. From bo.berglund at gmail.com Fri Apr 9 07:51:35 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 09 Apr 2021 07:51:35 +0200 Subject: [Lazarus] How to reduce size of lazarus itself? References: Message-ID: On Fri, 9 Apr 2021 00:46:53 +0200, Martin Frb via lazarus wrote: >On 08/04/2021 23:24, Bo Berglund via lazarus wrote: >> I just checked out 2.0.12 on a RaspberryPi4 and built it using my existing fpc >> 3.2.0. >> The size of the executable is 271,368,224 bytes, which reduces to 30,127,876 >> after using strip -s on it (takes away all the symbols). >> >> Since I am never ever going to be debugging lazarus itself, is there some >> setting I can use to NOT include the symbols in the first place? >> I want a lean and fast binary... >> >> Obviously since Lazarus rebuilds itself when packages are installed in the IDE, >> this setting must be part of the installation somehow. >> >> >Settings are taken from Tools > configure build lazarus. > >Put >-O3 -g- > >in there. So I did this on my RPi4 and it worked fine, the executable is now not in need of strip -s anymore. But when I tried to do the same on my Windows Lazarus 2.0.8 it resulted in Lazarus now starting up with ONLY the code editor window and the top Lazarus bar visible! All of the other windows I have adjusted around the code editor are gone! No more Object inspector, Messages, Project Inspector, Code Explorer... How come they disappeared? In RPi4 I did this in a newly installed Lazarus where I have not yet opened a project whereas on the Windows 2.0.8 I did it in Lazarus being in use with a project loaded (which Lazarus seems always to do). -- Bo Berglund Developer in Sweden From fjf.vanleeuwen at quicknet.nl Fri Apr 9 12:36:54 2021 From: fjf.vanleeuwen at quicknet.nl (frans) Date: Fri, 9 Apr 2021 12:36:54 +0200 Subject: [Lazarus] Lazbuild gives error Message-ID: Hi, After updated my SVN lazarus directory I want to rebuild lazarus using lazbuild --build-all. But lazbuild gives the error *(lazarus) invalid lazarus directory "C:\lazarus": directory not found*. The message is correct, I don't have a C:\lazarus directory. But why is lazbuild searching for that directory? My SVN directory is D:\SVN\LAZARUS and my OS is Windows10. -- mvg Frans van Leeuwen M 06-51695390 -- Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Fri Apr 9 20:53:32 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 09 Apr 2021 20:53:32 +0200 Subject: [Lazarus] How to reduce size of lazarus itself? References: Message-ID: On Fri, 09 Apr 2021 07:51:35 +0200, Bo Berglund via lazarus wrote: >On Fri, 9 Apr 2021 00:46:53 +0200, Martin Frb via lazarus > wrote: > >>On 08/04/2021 23:24, Bo Berglund via lazarus wrote: >>> I just checked out 2.0.12 on a RaspberryPi4 and built it using my existing fpc >>> 3.2.0. >>> The size of the executable is 271,368,224 bytes, which reduces to 30,127,876 >>> after using strip -s on it (takes away all the symbols). >>> >>> Since I am never ever going to be debugging lazarus itself, is there some >>> setting I can use to NOT include the symbols in the first place? >>> I want a lean and fast binary... >>> >>> Obviously since Lazarus rebuilds itself when packages are installed in the IDE, >>> this setting must be part of the installation somehow. >>> >>> >>Settings are taken from Tools > configure build lazarus. >> >>Put >>-O3 -g- >> >>in there. > >So I did this on my RPi4 and it worked fine, the executable is now not in need >of strip -s anymore. > >But when I tried to do the same on my Windows Lazarus 2.0.8 it resulted in >Lazarus now starting up with ONLY the code editor window and the top Lazarus bar >visible! >All of the other windows I have adjusted around the code editor are gone! >No more Object inspector, Messages, Project Inspector, Code Explorer... > >How come they disappeared? > >In RPi4 I did this in a newly installed Lazarus where I have not yet opened a >project whereas on the Windows 2.0.8 I did it in Lazarus being in use with a >project loaded (which Lazarus seems always to do). > Luckily I have started making backups of the files in the pcp directory so I could restore the environmentoptions.xml file from the backup and now the display is OK. -- Bo Berglund Developer in Sweden From lazarus at mfriebe.de Fri Apr 9 21:18:02 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 9 Apr 2021 21:18:02 +0200 Subject: [Lazarus] How to reduce size of lazarus itself? In-Reply-To: References: Message-ID: On 09/04/2021 20:53, Bo Berglund via lazarus wrote: > On Fri, 09 Apr 2021 07:51:35 +0200, Bo Berglund via lazarus > wrote: > > >> But when I tried to do the same on my Windows Lazarus 2.0.8 it resulted in >> Lazarus now starting up with ONLY the code editor window and the top Lazarus bar >> visible! >> All of the other windows I have adjusted around the code editor are gone! >> No more Object inspector, Messages, Project Inspector, Code Explorer... >> >> How come they disappeared? >> No idea. None of the options should affect the config. Maybe -O3 triggers a bug, or is buggy. Try with -O2 or -O1 instead. Or try with fpc 3.2.2. The -g- is the main factor in getting rid of the debug info. The -O* is more about execution speed. Mind I have not checked, but I believe the following should also work (in case those options are enabled elsewhere) -CR-r-i-o-t-   -Sa- and  -Si From jean.suzineau at wanadoo.fr Sat Apr 10 01:29:05 2021 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Sat, 10 Apr 2021 01:29:05 +0200 Subject: [Lazarus] Viewing config data in a tree style In-Reply-To: References: Message-ID: <737bb199-b002-890b-f26f-319d53bfa4e0@wanadoo.fr> In response to James Richter on fpc mailing list, I made this small example for displaying an selecting files in a tree. (written on Ubuntu and tested on Windows) https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte/tools/FileTree In your case, maybe  your configuration could be converted to a JSON file ? https://wiki.freepascal.org/fcl-json From bo.berglund at gmail.com Sun Apr 11 11:29:36 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 11 Apr 2021 11:29:36 +0200 Subject: [Lazarus] AutoSave does not save project file... Message-ID: I have installed AutoSave from the OnlinePackageManager on all of my numerous Lazarus installations and in general it works well. I started to do this following several Lazarus crashes where I lost modified code and had to try restoring from memory... However, when I write console (simple program) applications I have noted that AutoSave does not save the lpr file! And when looking closely the lpi file in GUI apps is also not saved. Since lpr is the only file in simple programs AutoSave does not help from disaster if a crash happens. Is there a way to configure or modify AutoSave so it also saves the main project files? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sun Apr 11 21:04:53 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 11 Apr 2021 21:04:53 +0200 Subject: [Lazarus] AutoSave does not save project file... References: Message-ID: On Sun, 11 Apr 2021 11:29:36 +0200, Bo Berglund via lazarus wrote: >Is there a way to configure or modify AutoSave so it also saves the main project >files? I looked at the Autosave sources on github and found this in the save timer: procedure TAutoSave.OnTimer(Sender: TObject); begin if Settings = nil then begin if LazarusIDE <> nil then //wait until IDE startup begin Settings := TSettings.Create(AppendPathDelim(LazarusIDE.GetPrimaryConfigPath) + cAutoSaveConfigFile); FTimer.StopTimer; FTimer.Interval := Settings.AutoSaveInteval*1000; FTimer.StartTimer; end; end else begin if Settings.EnableAutoSave then LazarusIDE.DoSaveAll([sfDoNotSaveVirtualFiles, sfCanAbort, sfQuietUnitCheck]); end; end; So it calls LazarusIDE.DoSaveAll, which means that somehow whan DoSaveAll Lazarus itself fails to save the project file itself.... Can this be fixed? -- Bo Berglund Developer in Sweden From editor at blaisepascal.eu Mon Apr 19 22:38:01 2021 From: editor at blaisepascal.eu (editor at blaisepascal.eu) Date: Mon, 19 Apr 2021 22:38:01 +0200 Subject: [Lazarus] OPM Error CEF4Delphi Message-ID: <003701d7355b$e46e02f0$ad4a08d0$@blaisepascal.eu> Because of an article in our Blaise Pascal Magazine from Michael van Canneyt I tried to use the OPM. I found that when I use the installer for the CEF4Delphi package something is not working correctly: I use Lazarus 2.0.12 and /or the trunk version. In both is the same Error: If you try to install CEF4Delphi by the OPM and click the install button – drop down menu there are two options from repository and from external source. If you choose external source you will get an error message “None of the checked repository packages are available.” DETLEF D. OVERBEEK WITH KIND REGARDS, MED VENLIG HILSEN, MET VRIENDELIJKE GROET, CORDIALEMENT, CORDIALI SALUTI, LE SALUDA ATENTAMENTE, MIT FREUNDLICHEN GRÜSSEN, С ИСКРЕННИМ УВАЖЕНИЕМ CONTACT: MOBILE PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK CELL PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK EDELSTENENBAAN 21, 3402 XA IJSSELSTEIN / NETHERLANDS www.BlaisePascalMagazine.eu BLAISE PASCAL MAGAZINE WILL NOT SELL OR SHARE YOUR EMAIL OR POSTAL ADDRESS WITH UNRELATED THIRD PARTIES. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 9051 bytes Desc: not available URL: From getmem1 at gmail.com Tue Apr 20 09:48:56 2021 From: getmem1 at gmail.com (=?UTF-8?B?QmFsw6F6cyBTesOpa2VseQ==?=) Date: Tue, 20 Apr 2021 10:48:56 +0300 Subject: [Lazarus] OPM Error CEF4Delphi In-Reply-To: <003701d7355b$e46e02f0$ad4a08d0$@blaisepascal.eu> References: <003701d7355b$e46e02f0$ad4a08d0$@blaisepascal.eu> Message-ID: Hi Detlef, Because of an article in our Blaise Pascal Magazine from Michael van > Canneyt I tried to use the OPM. > > I found that when I use the installer for the CEF4Delphi package something > is not working correctly: > > I use Lazarus 2.0.12 and /or the trunk version. In both is the same Error: > > If you try to install CEF4Delphi by the OPM and click the install button – > drop down menu > > there are two options from repository and from external source. > > If you choose external source you will get an error message > > “None of the checked repository packages are available.” > External repositories are disabled by default, because users did not like the idea that OPM connects to various external sites. To enable it please go to OPM->Options->General->Check for package updates, then change from "Never" to something else. I also updated the central repository with has the latest version of CEF4Delphi 90.5.4.0, now you can install directly from there. Thanks for the feedback! regards, Balázs -------------- next part -------------- An HTML attachment was scrubbed... URL: From editor at blaisepascal.eu Tue Apr 20 09:51:53 2021 From: editor at blaisepascal.eu (editor at blaisepascal.eu) Date: Tue, 20 Apr 2021 09:51:53 +0200 Subject: [Lazarus] lazarus Digest, Vol 159, Issue 8 In-Reply-To: References: Message-ID: <00a701d735ba$082f5d70$188e1850$@blaisepascal.eu> Thank you for your answer: however I forgot to tell you that I did change that to every few minutes and even this morning it still does not work. DETLEF D. OVERBEEK WITH KIND REGARDS, MED VENLIG HILSEN, MET VRIENDELIJKE GROET, CORDIALEMENT, CORDIALI SALUTI, LE SALUDA ATENTAMENTE, MIT FREUNDLICHEN GRÜSSEN, С ИСКРЕННИМ УВАЖЕНИЕМ CONTACT: MOBILE PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK CELL PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK EDELSTENENBAAN 21, 3402 XA IJSSELSTEIN / NETHERLANDS www.BlaisePascalMagazine.eu BLAISE PASCAL MAGAZINE WILL NOT SELL OR SHARE YOUR EMAIL OR POSTAL ADDRESS WITH UNRELATED THIRD PARTIES. -----Original Message----- From: lazarus [mailto:lazarus-bounces at lists.lazarus-ide.org] On Behalf Of lazarus-request at lists.lazarus-ide.org Sent: dinsdag 20 april 2021 09:49 To: lazarus at lists.lazarus-ide.org Subject: lazarus Digest, Vol 159, Issue 8 Send lazarus mailing list submissions to lazarus at lists.lazarus-ide.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.lazarus-ide.org/listinfo/lazarus or, via email, send a message with subject or body 'help' to lazarus-request at lists.lazarus-ide.org You can reach the person managing the list at lazarus-owner at lists.lazarus-ide.org When replying, please edit your Subject line so it is more specific than "Re: Contents of lazarus digest..." Today's Topics: 1. OPM Error CEF4Delphi (editor at blaisepascal.eu) 2. Re: OPM Error CEF4Delphi (Balázs Székely) ---------------------------------------------------------------------- Message: 1 Date: Mon, 19 Apr 2021 22:38:01 +0200 From: To: Subject: [Lazarus] OPM Error CEF4Delphi Message-ID: <003701d7355b$e46e02f0$ad4a08d0$@blaisepascal.eu> Content-Type: text/plain; charset="utf-8" Because of an article in our Blaise Pascal Magazine from Michael van Canneyt I tried to use the OPM. I found that when I use the installer for the CEF4Delphi package something is not working correctly: I use Lazarus 2.0.12 and /or the trunk version. In both is the same Error: If you try to install CEF4Delphi by the OPM and click the install button – drop down menu there are two options from repository and from external source. If you choose external source you will get an error message “None of the checked repository packages are available.” DETLEF D. OVERBEEK WITH KIND REGARDS, MED VENLIG HILSEN, MET VRIENDELIJKE GROET, CORDIALEMENT, CORDIALI SALUTI, LE SALUDA ATENTAMENTE, MIT FREUNDLICHEN GRÜSSEN, С ИСКРЕННИМ УВАЖЕНИЕМ CONTACT: MOBILE PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK CELL PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK EDELSTENENBAAN 21, 3402 XA IJSSELSTEIN / NETHERLANDS www.BlaisePascalMagazine.eu BLAISE PASCAL MAGAZINE WILL NOT SELL OR SHARE YOUR EMAIL OR POSTAL ADDRESS WITH UNRELATED THIRD PARTIES. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 9051 bytes Desc: not available URL: ------------------------------ Message: 2 Date: Tue, 20 Apr 2021 10:48:56 +0300 From: Balázs Székely To: editor at blaisepascal.eu, Lazarus mailing list Subject: Re: [Lazarus] OPM Error CEF4Delphi Message-ID: Content-Type: text/plain; charset="utf-8" Hi Detlef, Because of an article in our Blaise Pascal Magazine from Michael van > Canneyt I tried to use the OPM. > > I found that when I use the installer for the CEF4Delphi package > something is not working correctly: > > I use Lazarus 2.0.12 and /or the trunk version. In both is the same Error: > > If you try to install CEF4Delphi by the OPM and click the install > button – drop down menu > > there are two options from repository and from external source. > > If you choose external source you will get an error message > > “None of the checked repository packages are available.” > External repositories are disabled by default, because users did not like the idea that OPM connects to various external sites. To enable it please go to OPM->Options->General->Check for package updates, then change from "Never" to something else. I also updated the central repository with has the latest version of CEF4Delphi 90.5.4.0, now you can install directly from there. Thanks for the feedback! regards, Balázs -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus ------------------------------ End of lazarus Digest, Vol 159, Issue 8 *************************************** From jmlandmesser at gmx.de Tue Apr 20 11:56:28 2021 From: jmlandmesser at gmx.de (John Landmesser) Date: Tue, 20 Apr 2021 11:56:28 +0200 Subject: [Lazarus] lazarus Digest, Vol 159, Issue 8 In-Reply-To: <00a701d735ba$082f5d70$188e1850$@blaisepascal.eu> References: <00a701d735ba$082f5d70$188e1850$@blaisepascal.eu> Message-ID: Am 20.04.21 um 09:51 schrieb Detlef Overbeek via lazarus: > Thank you for your answer: > however I forgot to tell you that I did change that to every few minutes and even this morning it still does not work. I could compile and install this  package on Manjaro Linux: Lazarus 2.1.0 r63838M FPC 3.3.1 x86_64-linux-gtk2 Perhaps try a new ~/.lazarus profile? John From michael at freepascal.org Tue Apr 20 14:20:34 2021 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 20 Apr 2021 14:20:34 +0200 (CEST) Subject: [Lazarus] Mustache templates implementation Message-ID: Hello , For my job I needed a Mustache templates library in pascal. Since dmustache (part of mORMot) fails the official mustache tests and did not work on the platform I needed it for, I wrote my own implementation. The result has been committed to packages/fcl-mustache, in case someone else has a need for it. Basic Features: - TMustache Component, can be dropped on a form. - Compiles the template, so repeated output should be fast. - Passes all official testcases (including weird whitespace rules). - JSON data input by default. - Output easily configurable. Extra: - Integration with FPExprPars engine for expressions: {{[age + 2]}} will work. - You can use datasets as source of data. - Written to be easily extendable with other features. - Unit tested. Demos available, there is a complete usable command-line program that has all features enabled. Enjoy, Michael. From editor at blaisepascal.eu Tue Apr 20 22:49:50 2021 From: editor at blaisepascal.eu (editor at blaisepascal.eu) Date: Tue, 20 Apr 2021 22:49:50 +0200 Subject: [Lazarus] Installing CEF4Delphi Message-ID: <003801d73626$b5589ea0$2009dbe0$@blaisepascal.eu> I have installed an svn version of lazarus and tried that one. I also chose the options menu. I set it to “Every few minutes”. Nothing else was changed. After that I wanted to install. I had the opportunity to The reaction with External repository was after several tries that it could be installed. Whilst before that it was said nothing was available. Now it says dependency “dcpcrypt.lpk” not found Cannot install package. After that I tried again and did not do any typing I was doing in this email. Now it Ran And I was able to install it. Lesson 1: It’s not in version 2.0.12 Mattias told me it will take a while before the new stable version will arrive. Lesson2: Do not type during the installation process. I tell you this because I am making an update of the article from Michael Canneyt DETLEF D. OVERBEEK WITH KIND REGARDS, MED VENLIG HILSEN, MET VRIENDELIJKE GROET, CORDIALEMENT, CORDIALI SALUTI, LE SALUDA ATENTAMENTE, MIT FREUNDLICHEN GRÜSSEN, С ИСКРЕННИМ УВАЖЕНИЕМ CONTACT: MOBILE PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK CELL PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK EDELSTENENBAAN 21, 3402 XA IJSSELSTEIN / NETHERLANDS www.BlaisePascalMagazine.eu BLAISE PASCAL MAGAZINE WILL NOT SELL OR SHARE YOUR EMAIL OR POSTAL ADDRESS WITH UNRELATED THIRD PARTIES. -----Original Message----- From: lazarus [mailto:lazarus-bounces at lists.lazarus-ide.org] On Behalf Of lazarus-request at lists.lazarus-ide.org Sent: dinsdag 20 april 2021 09:49 To: lazarus at lists.lazarus-ide.org Subject: lazarus Digest, Vol 159, Issue 8 Send lazarus mailing list submissions to lazarus at lists.lazarus-ide.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.lazarus-ide.org/listinfo/lazarus or, via email, send a message with subject or body 'help' to lazarus-request at lists.lazarus-ide.org You can reach the person managing the list at lazarus-owner at lists.lazarus-ide.org When replying, please edit your Subject line so it is more specific than "Re: Contents of lazarus digest..." Today's Topics: 1. OPM Error CEF4Delphi (editor at blaisepascal.eu) 2. Re: OPM Error CEF4Delphi (Balázs Székely) ---------------------------------------------------------------------- Message: 1 Date: Mon, 19 Apr 2021 22:38:01 +0200 From: To: Subject: [Lazarus] OPM Error CEF4Delphi Message-ID: <003701d7355b$e46e02f0$ad4a08d0$@blaisepascal.eu> Content-Type: text/plain; charset="utf-8" Because of an article in our Blaise Pascal Magazine from Michael van Canneyt I tried to use the OPM. I found that when I use the installer for the CEF4Delphi package something is not working correctly: I use Lazarus 2.0.12 and /or the trunk version. In both is the same Error: If you try to install CEF4Delphi by the OPM and click the install button – drop down menu there are two options from repository and from external source. If you choose external source you will get an error message “None of the checked repository packages are available.” DETLEF D. OVERBEEK WITH KIND REGARDS, MED VENLIG HILSEN, MET VRIENDELIJKE GROET, CORDIALEMENT, CORDIALI SALUTI, LE SALUDA ATENTAMENTE, MIT FREUNDLICHEN GRÜSSEN, С ИСКРЕННИМ УВАЖЕНИЕМ CONTACT: MOBILE PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK CELL PHONE: +31 (0) 6 21 23 62 68 / SKYPE: DETLEF.OVERBEEK EDELSTENENBAAN 21, 3402 XA IJSSELSTEIN / NETHERLANDS www.BlaisePascalMagazine.eu BLAISE PASCAL MAGAZINE WILL NOT SELL OR SHARE YOUR EMAIL OR POSTAL ADDRESS WITH UNRELATED THIRD PARTIES. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 9051 bytes Desc: not available URL: ------------------------------ Message: 2 Date: Tue, 20 Apr 2021 10:48:56 +0300 From: Balázs Székely To: editor at blaisepascal.eu, Lazarus mailing list Subject: Re: [Lazarus] OPM Error CEF4Delphi Message-ID: Content-Type: text/plain; charset="utf-8" Hi Detlef, Because of an article in our Blaise Pascal Magazine from Michael van > Canneyt I tried to use the OPM. > > I found that when I use the installer for the CEF4Delphi package > something is not working correctly: > > I use Lazarus 2.0.12 and /or the trunk version. In both is the same Error: > > If you try to install CEF4Delphi by the OPM and click the install > button – drop down menu > > there are two options from repository and from external source. > > If you choose external source you will get an error message > > “None of the checked repository packages are available.” > External repositories are disabled by default, because users did not like the idea that OPM connects to various external sites. To enable it please go to OPM->Options->General->Check for package updates, then change from "Never" to something else. I also updated the central repository with has the latest version of CEF4Delphi 90.5.4.0, now you can install directly from there. Thanks for the feedback! regards, Balázs -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus ------------------------------ End of lazarus Digest, Vol 159, Issue 8 *************************************** From getmem1 at gmail.com Wed Apr 21 14:32:12 2021 From: getmem1 at gmail.com (=?UTF-8?B?QmFsw6F6cyBTesOpa2VseQ==?=) Date: Wed, 21 Apr 2021 15:32:12 +0300 Subject: [Lazarus] Installing CEF4Delphi In-Reply-To: <003801d73626$b5589ea0$2009dbe0$@blaisepascal.eu> References: <003801d73626$b5589ea0$2009dbe0$@blaisepascal.eu> Message-ID: > > I have installed an svn version of lazarus and tried that one. > I also chose the options menu. I set it to “Every few minutes”. Nothing > else was changed. > After that I wanted to install. I had the opportunity to > > The reaction with External repository was after several tries that it > could be installed. > Whilst before that it was said nothing was available. > Now it says dependency “dcpcrypt.lpk” not found > Cannot install package. > After that I tried again and did not do any typing I was doing in this > email. > Now it Ran And I was able to install it. > Lesson 1: It’s not in version 2.0.12 Mattias told me it will take a while > before the new stable version will arrive. > Lesson2: Do not type during the installation process. > > I tell you this because I am making an update of the article from Michael > Canneyt > Yes, unfortunately a small bug related to openssl remained unnoticed, so the "Install from external source" is not working properly in 2.0.12. Thanks again for testing and for your feedback. -------------- next part -------------- An HTML attachment was scrubbed... URL: From leobronstain at gmail.com Thu Apr 22 13:38:06 2021 From: leobronstain at gmail.com (Leyba Bronstain) Date: Thu, 22 Apr 2021 14:38:06 +0300 Subject: [Lazarus] Linux: Unknown property "ParentBackground" Message-ID: <90d8170b-cad6-89b2-bd98-3f614461f742@gmail.com> Hi guys Seems to be I found the bug. Test case: - create new project on Windows - put the groupbox on the form - set to Groupbox.ParentBackgroud property value False and save project - open project on Linux Let's get error (see attachment): Stream=TForm1: Root=:TForm1 Component Class: TGroupBox Error reading GroupBox1.ParentBackground: Unknown property: "ParentBackground" Stream position: 199 I think this is a bug /-- with best regards, Zoltanleo aka Док/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ScreenShot075.png Type: image/png Size: 39730 bytes Desc: not available URL: From leobronstain at gmail.com Thu Apr 22 13:43:03 2021 From: leobronstain at gmail.com (Leyba Bronstain) Date: Thu, 22 Apr 2021 14:43:03 +0300 Subject: [Lazarus] Linux: Unknown property "ParentBackground" In-Reply-To: <90d8170b-cad6-89b2-bd98-3f614461f742@gmail.com> References: <90d8170b-cad6-89b2-bd98-3f614461f742@gmail.com> Message-ID: <72c81fec-874e-feaf-4887-5638ef064ed8@gmail.com> I'm use fpc trunk and Lazarus trunk (rev. 65050) Link to screenshot https://imgur.com/RFC3Ckm -- /-- with best regards, Zoltanleo aka Док/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From leobronstain at gmail.com Fri Apr 23 07:02:57 2021 From: leobronstain at gmail.com (Leyba Bronstain) Date: Fri, 23 Apr 2021 08:02:57 +0300 Subject: [Lazarus] Linux: Unknown property "ParentBackground" In-Reply-To: <9ff3f680-1b8b-e7f3-5292-29d4b4d95f71@yandex.ru> References: <90d8170b-cad6-89b2-bd98-3f614461f742@gmail.com> <9ff3f680-1b8b-e7f3-5292-29d4b4d95f71@yandex.ru> Message-ID: <779243f5-e06f-0f05-2a4c-0b247e97cf54@gmail.com> Solved https://forum.lazarus.freepascal.org/index.php/topic,54283.msg403257.html#msg403257 -- /-- with best regards, Zoltanleo aka Док/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu Apr 29 17:49:43 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 29 Apr 2021 17:49:43 +0200 Subject: [Lazarus] How to save screenshot to jpg and png format files Message-ID: <2pkl8gt1drps103b5e5evl71imk7jai0uh@4ax.com> I have an application which can capture a regon of the desktop into an image. It uses TBgraBitmap since it has a method for grabbing data from the screen. So I can assign this to the clipboard and also save to a file: var MyCapture : TBgraBitmap; Clip: TRect; ... begin ... Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); MyCapture := TBgraBitmap.Create(); MyCapture.TakeScreenShot(Clip); Clipboard.Assign(MyCapture.Bitmap); MyCapture.Bitmap.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); MyCapture.Free; ... end; But the SaveToFile results in a file that is NOT a jpeg file at all... How could I save it to a specific (known) format, like jpg or png? -- Bo Berglund Developer in Sweden From ryansmithhe at gmail.com Thu Apr 29 17:59:57 2021 From: ryansmithhe at gmail.com (R.Smith) Date: Thu, 29 Apr 2021 17:59:57 +0200 Subject: [Lazarus] How to save screenshot to jpg and png format files In-Reply-To: <2pkl8gt1drps103b5e5evl71imk7jai0uh@4ax.com> References: <2pkl8gt1drps103b5e5evl71imk7jai0uh@4ax.com> Message-ID: On 2021/04/29 17:49, Bo Berglund via lazarus wrote: > I have an application which can capture a regon of the desktop into an image. > It uses TBgraBitmap since it has a method for grabbing data from the screen. > > So I can assign this to the clipboard and also save to a file: > > var > MyCapture : TBgraBitmap; > Clip: TRect; > ... > begin > ... > Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); > MyCapture := TBgraBitmap.Create(); > MyCapture.TakeScreenShot(Clip); > Clipboard.Assign(MyCapture.Bitmap); > MyCapture.Bitmap.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); > MyCapture.Free; > ... > end; > > But the SaveToFile results in a file that is NOT a jpeg file at all... > > How could I save it to a specific (known) format, like jpg or png? > Essentially you are asking a BGRA Bitmap to save itself to file, it is irrelevant whether the file ends in .jpg or .moonmission (although a TPicture or some custom image components may check the file extension). What you need is to create a JPEG object, put the data in it and then use its JPEG-machinery to save the file. I haven't tested this, typing from my head so may make syntax errors or such, but the idea is sound: var   jpg : TJPEGImage; ...     jpg := TJPEGImage.Create;     jpg.Assign(MyCapture.Bitmap);    ... perhaps adjust the JPEG quality parameters etc.     jpg.SaveToFIle('somefile.jpg');     jpg.Free; ... Note that this "jpg.SaveToFIle('somefile.jpg')" statement will ALWAYS save JPEG data to the file, even if the given filename ends in  .png or .bmp or .mooseknuckle From pch at ap-i.net Thu Apr 29 18:49:06 2021 From: pch at ap-i.net (Patrick Chevalley) Date: Thu, 29 Apr 2021 16:49:06 +0000 Subject: [Lazarus] How to save screenshot to jpg and png format files In-Reply-To: <2pkl8gt1drps103b5e5evl71imk7jai0uh@4ax.com> References: <2pkl8gt1drps103b5e5evl71imk7jai0uh@4ax.com> Message-ID: <70631af63106f5d5574fb4735867e7c6@ap-i.net> Hi, Replace : MyCapture.Bitmap.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); by : MyCapture.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); This work because Bgrabitmap set automatically the image writer based on the extension. Patrick 29 avril 2021 17:49 "Bo Berglund via lazarus" a écrit: > I have an application which can capture a regon of the desktop into an image. > It uses TBgraBitmap since it has a method for grabbing data from the screen. > > So I can assign this to the clipboard and also save to a file: > > var > MyCapture : TBgraBitmap; > Clip: TRect; > ... > begin > ... > Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); > MyCapture := TBgraBitmap.Create(); > MyCapture.TakeScreenShot(Clip); > Clipboard.Assign(MyCapture.Bitmap); > MyCapture.Bitmap.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); > MyCapture.Free; > ... > end; > > But the SaveToFile results in a file that is NOT a jpeg file at all... > > How could I save it to a specific (known) format, like jpg or png? > > -- > Bo Berglund > Developer in Sweden > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From bo.berglund at gmail.com Fri Apr 30 10:17:19 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 30 Apr 2021 10:17:19 +0200 Subject: [Lazarus] How to save screenshot to jpg and png format files References: <2pkl8gt1drps103b5e5evl71imk7jai0uh@4ax.com> <70631af63106f5d5574fb4735867e7c6@ap-i.net> Message-ID: On Thu, 29 Apr 2021 16:49:06 +0000, Patrick Chevalley via lazarus wrote: > >Replace : >MyCapture.Bitmap.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); >by : >MyCapture.SaveToFile(ChangeFileExt(ParamStr(0), '.jpg')); > >This work because Bgrabitmap set automatically the image writer based on the extension. > Correct! I could remove *all* the extra code I had added to create jpg, png and bmp containers. Instead I could save directly from the MyCapture object, which has built-in magic to save files correctly based on the commonly used extesnions in the file name. Problem solved, thanks! -- Bo Berglund Developer in Sweden