From pascaldragon at googlemail.com Mon Feb 1 07:52:35 2021 From: pascaldragon at googlemail.com (Sven Barth) Date: Mon, 1 Feb 2021 07:52:35 +0100 Subject: [Lazarus] using a weird DLL In-Reply-To: References: Message-ID: duilio foschi via lazarus schrieb am So., 31. Jan. 2021, 23:23: > I would like to use a function exported from a DLL. The DLL was written in > C++ (Visual Studio 2015). > > Inside the original code the function is declared as > > public bool GetSkinFeatures(Bitmap Input_Bitmap, Rectangle > ROI_Rect, double[] ExtractedFeatures) > > Anybody knows how to use it from Lazarus? > Can you also show the declarations of Bitmap and Rectangle? Is the function declared inside an "extern "C"" block? Regards, Sven > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octopushole at gmail.com Mon Feb 1 11:21:54 2021 From: octopushole at gmail.com (duilio foschi) Date: Mon, 1 Feb 2021 11:21:54 +0100 Subject: [Lazarus] Fwd: using a weird DLL In-Reply-To: References: Message-ID: for Sven: >Is the function declared inside an "extern "C"" block? no The code says: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; using System.Drawing; using System.Drawing.Imaging; namespace SkinAnalyzer { public class ImageProcessing { //-------------------------------------------------------------------------------------------- public ImageProcessing() { // init., if necessary } //-------------------------------------------------------------------------------------------- // get the features public bool GetSkinFeatures(Bitmap Input_Bitmap, Rectangle ROI_Rect, double[] ExtractedFeatures) { // check the parameters if (Input_Bitmap == null) return false; if (Input_Bitmap.PixelFormat != PixelFormat.Format8bppIndexed && Input_Bitmap.PixelFormat != PixelFormat.Format24bppRgb && Input_Bitmap.PixelFormat != PixelFormat.Format32bppArgb && Input_Bitmap.PixelFormat != PixelFormat.Format32bppRgb) return false; // get the input pixels Rectangle rect1 = new Rectangle(0, 0, Input_Bitmap.Width, Input_Bitmap.Height); BitmapData input_data = Input_Bitmap.LockBits(rect1, ImageLockMode.ReadOnly, Input_Bitmap.PixelFormat); IntPtr ptr1 = input_data.Scan0; int bytesbpp = 0; // bytes_per_pixel switch (Input_Bitmap.PixelFormat) { On Mon, Feb 1, 2021 at 10:08 AM duilio foschi wrote: > I am corrected. The DLL is written in c#. It seems that Bitmap and > Rectangle are common predefined/usable objects in C#. > > Re Bitmap, I found these notes: > "Surely you cannot expect C# Bitmap to be binary compatible with Delphi > TBitmap? You need to pass around an HBITMAP. On the Delphi side you use > ReleaseHandle to get the HBITMAP. On the C# side it would be > Image.FromHbitmap" > > Re Rectangle, I found nothing interesting :( > > However it seems natural to expect that Rectangle it is given by a pointer > to a fixed array of 2 points= 4 integers= 16 bytes in all. > > Thank you > Duilio > > On Mon, Feb 1, 2021 at 7:52 AM Sven Barth > wrote: > >> duilio foschi via lazarus schrieb am >> So., 31. Jan. 2021, 23:23: >> >>> I would like to use a function exported from a DLL. The DLL was written >>> in C++ (Visual Studio 2015). >>> >>> Inside the original code the function is declared as >>> >>> public bool GetSkinFeatures(Bitmap Input_Bitmap, Rectangle >>> ROI_Rect, double[] ExtractedFeatures) >>> >>> Anybody knows how to use it from Lazarus? >>> >> >> Can you also show the declarations of Bitmap and Rectangle? Is the >> function declared inside an "extern "C"" block? >> >> Regards, >> Sven >> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascaldragon at googlemail.com Mon Feb 1 11:30:38 2021 From: pascaldragon at googlemail.com (Sven Barth) Date: Mon, 1 Feb 2021 11:30:38 +0100 Subject: [Lazarus] Fwd: using a weird DLL In-Reply-To: References: Message-ID: duilio foschi via lazarus schrieb am Mo., 1. Feb. 2021, 11:22: > > On Mon, Feb 1, 2021 at 10:08 AM duilio foschi > wrote: > >> I am corrected. The DLL is written in c#. It seems that Bitmap and >> Rectangle are common predefined/usable objects in C#. >> > You can't trivially use a C# (or .NET in general) library in native code. (It essentially involves hosting the CLR and then invoking the code) RemObjects for example provides bridges for the managed and unmanaged code, but I don't know whether it supports Lazarus and it isn't free (as in beer) anyway. ( https://hydra.remobjects.com/hydra/default.aspx ) Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolf.wetjen at mail.de Tue Feb 2 11:22:08 2021 From: rolf.wetjen at mail.de (Rolf Wetjen) Date: Tue, 2 Feb 2021 11:22:08 +0100 Subject: [Lazarus] Some IDE/LHelp issues Message-ID: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> Maybe someone can help with a few issues around LHelp in the IDE: 1) When LHelp opens (regardless if opens with Tools->CHM-Help or F1 context help) it opens with 11 tabs. Some of them have a caption, some of them are [unknown]. The [unknown] ones come up with an error message "ms-its:xyz.chm::/index.html not found!" 2) One of [unknown] tabs is completely empty: "ms-its:toc.chm::/index.html not found!" 3) There are two lcl tabs. One show a message "Loaded: ms-its:lcl.chm::/index.html in ... ms", the other one doesn't show a load message. 3) There's no possibility to search in all files simultanously. May be this is the missing toc.chm::/index.html? 4) The first context search is a racing car. All following context searches are a bicycle. Time for a coffee. I'd like to check for this. Is there any documentation about the structure of the chm files reagarding the missing index.html? What's the meaning of the database definition fields in Tools-Settins-Help? There are entries for 8 databases. What about the missing ones. How does the IDE calls LHelp? Any ideas? Rolf From jmlandmesser at gmx.de Tue Feb 2 12:49:21 2021 From: jmlandmesser at gmx.de (John Landmesser) Date: Tue, 2 Feb 2021 12:49:21 +0100 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> Message-ID: <778a5b1d-ef4c-5457-c809-89f3ef82c5a2@gmx.de> Am 02.02.21 um 11:22 schrieb Rolf Wetjen via lazarus: > Maybe someone can help with a few issues around LHelp in the IDE: > > 1) When LHelp opens (regardless if opens with Tools->CHM-Help or F1 > context help) it opens with 11 tabs. > Some of them have a caption, some of them are [unknown]. The [unknown] > ones come up with an error message "ms-its:xyz.chm::/index.html not > found!" > > 2) One of [unknown] tabs is completely empty: > "ms-its:toc.chm::/index.html not found!" > > 3) There are two lcl tabs. One show a message "Loaded: > ms-its:lcl.chm::/index.html in ... ms", the other one doesn't show a > load message. > > 3) There's no possibility to search in all files simultanously. May be > this is the missing toc.chm::/index.html? > > 4) The first context search is a racing car. All following context > searches are a bicycle. Time for a coffee. > > I'd like to check for this. > > Is there any documentation about the structure of the chm files > reagarding the missing index.html? > What's the meaning of the database definition fields in > Tools-Settins-Help? There are entries for 8 databases. What about the > missing ones. > How does the IDE calls LHelp? > > Any ideas? > > Rolf > General Info at: https://wiki.lazarus.freepascal.org/IDE_Window:_Help_Options plus: https://wiki.lazarus.freepascal.org/Installing_Help_in_the_IDE#Installing_CHM_help_.28Lazarus_1.0_and_later.29 see here chapter: fpdoc entries of RTL and FCL to svn checkout all chm-help-files I have your questions too for a long time but i'm just a hobbyist so i can live these lack of knowledge. Regards John Landmesser From andrey.sobol.nn at gmail.com Tue Feb 2 12:58:52 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Tue, 2 Feb 2021 14:58:52 +0300 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> Message-ID: Hello Rolf, > 1) When LHelp opens (regardless if opens with Tools->CHM-Help or F1 > context help) it opens with 11 tabs. > Some of them have a caption, some of them are [unknown]. The [unknown] > ones come up with an error message "ms-its:xyz.chm::/index.html not found!" That is my TODO for lHelp, You can get some of last patches here https://bugs.freepascal.org/view.php?id=38250 , but it not in a repo now. > 2) One of [unknown] tabs is completely empty: > "ms-its:toc.chm::/index.html not found!" I don`t what about it. I can get a new chm`s here for try. https://forum.lazarus.freepascal.org/index.php/topic,53114.0.html It is without a structural errors. > 3) There are two lcl tabs. One show a message "Loaded: > ms-its:lcl.chm::/index.html in ... ms", the other one doesn't show a > load message. I think I am going fix that later. > 3) There's no possibility to search in all files simultanously. May be > this is the missing toc.chm::/index.html? Patch sub 1 is not applied yet. > 4) The first context search is a racing car. All following context > searches are a bicycle. Time for a coffee. Fixed: https://bugs.freepascal.org/view.php?id=38276 > I'd like to check for this. > > Is there any documentation about the structure of the chm files > reagarding the missing index.html? > What's the meaning of the database definition fields in > Tools-Settins-Help? There are entries for 8 databases. What about the > missing ones. > How does the IDE calls LHelp? > > Any ideas? A full list of changes and mistakes :) https://bugs.freepascal.org/view_all_bug_page.php?filter=60193d8bebd3d Andrey. -- Andrey From jmlandmesser at gmx.de Tue Feb 2 13:14:06 2021 From: jmlandmesser at gmx.de (John Landmesser) Date: Tue, 2 Feb 2021 13:14:06 +0100 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <778a5b1d-ef4c-5457-c809-89f3ef82c5a2@gmx.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> <778a5b1d-ef4c-5457-c809-89f3ef82c5a2@gmx.de> Message-ID: <2e78e8af-fce1-7891-371d-3afeebf5e2f7@gmx.de> Am 02.02.21 um 12:49 schrieb John Landmesser via lazarus: > Am 02.02.21 um 11:22 schrieb Rolf Wetjen via lazarus: >> Maybe someone can help with a few issues around LHelp in the IDE: >> >> 1) When LHelp opens (regardless if opens with Tools->CHM-Help or F1 >> context help) it opens with 11 tabs. >> Some of them have a caption, some of them are [unknown]. The [unknown] >> ones come up with an error message "ms-its:xyz.chm::/index.html not >> found!" >> >> 2) One of [unknown] tabs is completely empty: >> "ms-its:toc.chm::/index.html not found!" >> >> 3) There are two lcl tabs. One show a message "Loaded: >> ms-its:lcl.chm::/index.html in ... ms", the other one doesn't show a >> load message. >> >> 3) There's no possibility to search in all files simultanously. May be >> this is the missing toc.chm::/index.html? >> >> 4) The first context search is a racing car. All following context >> searches are a bicycle. Time for a coffee. >> >> I'd like to check for this. >> >> Is there any documentation about the structure of the chm files >> reagarding the missing index.html? >> What's the meaning of the database definition fields in >> Tools-Settins-Help? There are entries for 8 databases. What about the >> missing ones. >> How does the IDE calls LHelp? >> >> Any ideas? >> >> Rolf >> > General Info at: > > https://wiki.lazarus.freepascal.org/IDE_Window:_Help_Options > > plus: > > https://wiki.lazarus.freepascal.org/Installing_Help_in_the_IDE#Installing_CHM_help_.28Lazarus_1.0_and_later.29 > > > see here chapter: > > fpdoc entries of RTL and FCL > > to svn checkout all chm-help-files > > > I have your questions too for a long time but i'm just a hobbyist so i > can live these lack of knowledge. > > Regards > > John Landmesser > > Have a look at this: [john1 at manjaro fpcdocs]$ svn info Pfad: . Wurzelpfad der Arbeitskopie: /home/john1/lazarus/docs/chm/fpcdocs URL: https://svn.freepascal.org/svn/fpcdocs/trunk Relative URL: ^/trunk Basis des Projektarchivs: https://svn.freepascal.org/svn/fpcdocs UUID des Projektarchivs: 583a4693-3df7-0310-a210-d425ad3023e7 Revision: 1800 Knotentyp: Verzeichnis Plan: normal Letzter Autor: michael Letzte geänderte Rev: 1800 Letztes Änderungsdatum: 2021-01-31 18:15:57 +0100 (So, 31. Jan 2021) From bo.berglund at gmail.com Wed Feb 3 00:03:20 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 03 Feb 2021 00:03:20 +0100 Subject: [Lazarus] How to copy specific region of desktop? Message-ID: I wonder if there is a (preferably cross-platform) method to: 1) Select a region of the current desktop by placing a rectangle over it with the mouse. 2) Copy the part of the desktop within the rectangle as an image to the clipboard. If so what functions do I need to accomplish the selection and the copy? I am using Lazarus 2.0.10 and Fpc 3.2.0 on Windows 10 and Ubuntu 18.04.5 -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed Feb 3 08:36:13 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 03 Feb 2021 08:36:13 +0100 Subject: [Lazarus] How to copy specific region of desktop? References: Message-ID: <9ekk1g5psok7u8kn8djnq9n5nv5nh2lj5g@4ax.com> On Wed, 03 Feb 2021 00:03:20 +0100, Bo Berglund via lazarus wrote: >I wonder if there is a (preferably cross-platform) method to: > >1) Select a region of the current desktop by placing a rectangle over it with >the mouse. > >2) Copy the part of the desktop within the rectangle as an image to the >clipboard. > >If so what functions do I need to accomplish the selection and the copy? > >I am using Lazarus 2.0.10 and Fpc 3.2.0 on Windows 10 and Ubuntu 18.04.5 > I realized this probably is better handled on the Lazarus *forum* than in the mail list so I created a thread there. Please respond on the forum if you want to contribute. https://forum.lazarus.freepascal.org/index.php?topic=53167 Thanks. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed Feb 3 14:36:38 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 03 Feb 2021 14:36:38 +0100 Subject: [Lazarus] How to make a TStaticText control appear on top of the form? Message-ID: I have a very special transparent form where there is a small opaque area in one corner. Here I have two TStaticText controls which are showing the size of the form and displays an X respectively. These are updated during resizing so the form state is visible. This works fine on my Win10 computer but when I copy the application to my wife's laptop they are hidden apparently below the main form when I start the app... Very strange, the same binary behaves differently on two HP laptops both running Windows 10 and both a little more than one year old. How can I force these controls on top of the form so they are always visible? -- Bo Berglund Developer in Sweden From fpc at pascalprogramming.org Wed Feb 3 14:46:39 2021 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Wed, 3 Feb 2021 14:46:39 +0100 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> Message-ID: <49725e90-aab8-07d3-4286-cc712e15e2eb@pascalprogramming.org> Op 2021-02-02 om 11:22 schreef Rolf Wetjen via lazarus: > 2) One of [unknown] tabs is completely empty: > "ms-its:toc.chm::/index.html not found!" > Toc.chm is a master index of the CHMs, with a hardcoded list of known chms. It is as meant to function as default page (TOC) of the FPC textmode IDE, to provide a way to navigate to each CHM's toc. I don't think this is needed for Lazarus, as each helpfile has its own tab and thus place to show the TOC. From rolf.wetjen at mail.de Thu Feb 4 14:39:31 2021 From: rolf.wetjen at mail.de (Rolf Wetjen) Date: Thu, 4 Feb 2021 14:39:31 +0100 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> Message-ID: <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> Hi Andy I've patched LHelp.exe with lhelp_index_combine_04.patch. The "unknown" tab issue is partly solved. Now all tabs have a caption. There's one strange behaviour: [FPDoc Documentation], [Programmer' Guide], [Reference Guide] and [User's Guide] doesn't show the default page if LHelp is called from the IDE via Help/CHM help or via context F1. They show an empty page. But it shows the default page if I open prog.chm for example in LHelp via File/Open. An other difference: Calling LHelp via context F1 doesn't show the toc.  Tested with F1 on "TForm". Rolf From andrey.sobol.nn at gmail.com Thu Feb 4 16:21:49 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Thu, 4 Feb 2021 18:21:49 +0300 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> Message-ID: <3c2a3ca6-2d6a-8638-e7c1-b4f60576f6af@gmail.com> On 04.02.2021 16:39, Rolf Wetjen via lazarus wrote: > Hi Andy > > I've patched LHelp.exe with lhelp_index_combine_04.patch. > > The "unknown" tab issue is partly solved. Now all tabs have a caption. > There's one strange behaviour: > [FPDoc Documentation], [Programmer' Guide], [Reference Guide] and > [User's Guide] doesn't show the default page if LHelp is called from the > IDE via Help/CHM help or via context F1. They show an empty page. But it > shows the default page if I open prog.chm for example in LHelp via > File/Open. > > An other difference: Calling LHelp via context F1 doesn't show the toc. > Tested with F1 on "TForm". > > Rolf There is not a final version, I work at that yet. The main change is a full merged indexes (Binary index and FTSI) for an one page mode. -- Andrey From andrey.sobol.nn at gmail.com Thu Feb 4 16:22:06 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Thu, 4 Feb 2021 18:22:06 +0300 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> Message-ID: On 04.02.2021 16:39, Rolf Wetjen via lazarus wrote: > Hi Andy > > I've patched LHelp.exe with lhelp_index_combine_04.patch. > > The "unknown" tab issue is partly solved. Now all tabs have a caption. > There's one strange behaviour: > [FPDoc Documentation], [Programmer' Guide], [Reference Guide] and > [User's Guide] doesn't show the default page if LHelp is called from the > IDE via Help/CHM help or via context F1. They show an empty page. But it > shows the default page if I open prog.chm for example in LHelp via > File/Open. > > An other difference: Calling LHelp via context F1 doesn't show the toc. > Tested with F1 on "TForm". > > Rolf There is not a final version, I work at that yet. The main change is a full merged indexes (Binary index and FTSI) for an one page mode. -- Andrey From bo.berglund at gmail.com Thu Feb 4 18:43:55 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 04 Feb 2021 18:43:55 +0100 Subject: [Lazarus] How to make a TStaticText control appear on top of the form? References: Message-ID: On Wed, 03 Feb 2021 14:36:38 +0100, Bo Berglund via lazarus wrote: >Very strange, the same binary behaves differently on two HP laptops both running >Windows 10 and both a little more than one year old. > >How can I force these controls on top of the form so they are always visible? > So I found out what causes this to happen: On my laptop the screen setting is 100%, whereas on the other laptop it is at 125%. Changing that laptop back to 100% makes the missing controls appear on this laptop too. Question: --------- How come some Lazarus controls cannot display on Windows 10 if the screen is set to 125% sizing? Is this by design or is it just overlooked? The monitor is 1920x1080. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Feb 6 11:46:55 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 06 Feb 2021 11:46:55 +0100 Subject: [Lazarus] Lazarus configuration - portable between versions? Message-ID: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Every time I am setting up a new Lazarus version on one of my computers I have to struggle to configure the IDE as I want it. It concerns desktop, font sizes, tab behaviour, colors and a number of other things like key shortcuts etc. I believe these are stored inside the pcp/environmentoptions.xml file. My question now is: Can I simply copy the file from the pcp directory of the previous version of Lazarus or are the config files version dependent and incompatible? Right now I am setting up 2.0.10 on Ubuntu Mate where I already have 2.0.6 and 2.0.8 Maybe there is an "import settings" function somewhere I have yet to find? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Feb 6 12:00:21 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 06 Feb 2021 12:00:21 +0100 Subject: [Lazarus] Lazarus configuration - portable between versions? References: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Message-ID: On Sat, 06 Feb 2021 11:46:55 +0100, Bo Berglund via lazarus wrote: >Every time I am setting up a new Lazarus version on one of my computers I have >to struggle to configure the IDE as I want it. > >It concerns desktop, font sizes, tab behaviour, colors and a number of other >things like key shortcuts etc. I believe these are stored inside the >pcp/environmentoptions.xml file. > >My question now is: >Can I simply copy the file from the pcp directory of the previous version of >Lazarus or are the config files version dependent and incompatible? By looking inside the file on my old installationm I see clearly that this is not the file I can modify, lots of version dependent paths inside... >Right now I am setting up 2.0.10 on Ubuntu Mate where I already have 2.0.6 and >2.0.8 > >Maybe there is an "import settings" function somewhere I have yet to find? I probably need the editoroptions.xml file instead... Is *that* file useful? I see it contains a lot less version dependent paths but also a lot less settings... -- Bo Berglund Developer in Sweden From juha.manninen62 at gmail.com Sat Feb 6 12:25:06 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sat, 6 Feb 2021 13:25:06 +0200 Subject: [Lazarus] Lazarus configuration - portable between versions? In-Reply-To: References: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Message-ID: On Sat, Feb 6, 2021 at 1:00 PM Bo Berglund via lazarus < lazarus at lists.lazarus-ide.org> wrote: > By looking inside the file on my old installationm I see clearly that this > is > not the file I can modify, lots of version dependent paths inside... > What paths are version dependent? Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryansmithhe at gmail.com Sat Feb 6 12:29:19 2021 From: ryansmithhe at gmail.com (R.Smith) Date: Sat, 6 Feb 2021 13:29:19 +0200 Subject: [Lazarus] Lazarus configuration - portable between versions? In-Reply-To: References: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Message-ID: <85534adc-243c-019e-8698-1ab8552d9237@gmail.com> > I probably need the editoroptions.xml file instead... > Is *that* file useful? I see it contains a lot less version dependent paths but > also a lot less settings... Version dependant? Perhaps you mean installation dependant? From lazarus at mfriebe.de Sat Feb 6 15:39:06 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 6 Feb 2021 15:39:06 +0100 Subject: [Lazarus] Lazarus configuration - portable between versions? In-Reply-To: References: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Message-ID: <47d9f5ac-9970-2021-d08e-2da658e60110@mfriebe.de> On 06/02/2021 12:00, Bo Berglund via lazarus wrote: > On Sat, 06 Feb 2021 11:46:55 +0100, Bo Berglund via lazarus > wrote: > >> Every time I am setting up a new Lazarus version on one of my computers I have >> to struggle to configure the IDE as I want it. >> >> It concerns desktop, font sizes, tab behaviour, colors and a number of other >> things like key shortcuts etc. I believe these are stored inside the >> pcp/environmentoptions.xml file. >> >> My question now is: >> Can I simply copy the file from the pcp directory of the previous version of >> Lazarus or are the config files version dependent and incompatible? > By looking inside the file on my old installationm I see clearly that this is > not the file I can modify, lots of version dependent paths inside... > It would be nice to have a simple tool for that (ideally with selection of subsections)...  But, well, not there... anyway in the pcp you mainly look at the xml files. Other files - lazarus.dci => code templates. If you added new ones, you can copy, but that overwrites templates added in later releases. - staticpackages.inc => do NOT copy, maintained by installing packages As for the paths included in xml files. Set up you first/source IDE to use as many macros as possible $(LazarusDir) $Path($(LazarusDir)) $(CompPath) $(FPCVer) .... Then, I guess most of them can be copied. But not tested. From bo.berglund at gmail.com Sat Feb 6 15:56:01 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 06 Feb 2021 15:56:01 +0100 Subject: [Lazarus] Lazarus configuration - portable between versions? References: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Message-ID: On Sat, 6 Feb 2021 13:25:06 +0200, Juha Manninen via lazarus wrote: >On Sat, Feb 6, 2021 at 1:00 PM Bo Berglund via lazarus < >lazarus at lists.lazarus-ide.org> wrote: > >> By looking inside the file on my old installationm I see clearly that this >> is >> not the file I can modify, lots of version dependent paths inside... >> > >What paths are version dependent? > It seems like in my Windows installation there are more of these than on Linux, probably dependent on the usage (I use mostly Windows and here I do not build fpc/lazarus from sources). Here is the Linux case: So in the environmentoptions.xml file there are a "lot" of items (5): But in .lazarus_2.0.8/editoroptions.xml I found only this: Apparently I have copied the file and the path now point into the wrong pcp directory.... It looks on closer inspection that History and Recent sections in en vironmentoptions.xml contain paths including version numbers. But I guess I can disregard these or even remove them... But as I wrote above I have found taht the editoroptions.xml is the one holding the customizations of the editor so I copied it and modified the path inside the I have worked on a tool to copy a region of the Windows desktop for use in illustrations. The tool consists of a transparent form which is supposed to be located on top of the area to copy. This form has a pop-up menu where there are 3 items to select from: - Copy image - Copy position - Close When I use the "Copy image" function the resulting image contains the selected menu item caption on top of the copied desktop bitmap... I have tried various ways to get rid of this but everything I tried has failed. So how can I hide the menu item caption in code before I make the image extraction? I even added a timer set to 50 ms interval and put the image copy in its ontimer event hoping that the menu click should have exited and the text disappeared before the image copy happened, but no go... Here is the way the copy is commanded via the popup menu: http://blog.boberglund.com/files/Lazarus_popmenu_usage.png And here is a captured image where the popup caption is visible: http://blog.boberglund.com/files/Lazarus_popmenu.png As you can see the caption of the clicked menu item is still present in the screenshot image... Here is parts of the code: procedure TfrmMain.miCopyImageClick(Sender : TObject); begin //CopyScreenRect; //Moved to timer //miCopyImage.Visible := false; //Does not work //self.Refresh; //Does not work timCopyImg.Enabled := true; //make copy inside timer event? end; procedure TfrmMain.miCopyPosClick(Sender : TObject); begin SaveRectCoords; //Saving rect coordinates to clipboard (OK) end; procedure TfrmMain.timCopyImgTimer(Sender : TObject); begin timCopyImg.Enabled := false; miCopyImage.Visible := false; //Does not work, caption still present self.Refresh; //Does also not work to remove caption CopyScreenRect; miCopyImage.Visible := true; //Put it back to enable next capture end; procedure TfrmMain.CopyScreenRect; var MyCapture : TBgraBitmap; Clip: TRect; begin try Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); Self.Visible := false; //Hide selection form before copy //Self.Hide; //Not working for popup menu item... MyCapture := TBgraBitmap.Create(); MyCapture.TakeScreenShot(Clip); Self.Visible := true; //Show selection form after copy is done //Self.Show; //Not working for popup menu item... Clipboard.Assign(MyCapture.Bitmap); except on E: exception do Clipboard.AsText := E.Message; end; end; Even Self.Visible or Self.Hide do not remove the menuitem caption.... What can I do? Lazarus 2.0.10 / fpc 3.2.0 on Windows 10 -- Bo Berglund Developer in Sweden From andrey.sobol.nn at gmail.com Sun Feb 7 12:48:36 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Sun, 7 Feb 2021 14:48:36 +0300 Subject: [Lazarus] Some IDE/LHelp issues In-Reply-To: <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> References: <38f11478-1bcd-f3ae-f334-ddf8e76de37f@mail.de> <76abc29a-dfd6-7cc7-22a2-0433dcf129d1@mail.de> Message-ID: On 04.02.2021 16:39, Rolf Wetjen via lazarus wrote: > Hi Andy > > I've patched LHelp.exe with lhelp_index_combine_04.patch. > > The "unknown" tab issue is partly solved. Now all tabs have a caption. > There's one strange behaviour: > [FPDoc Documentation], [Programmer' Guide], [Reference Guide] and > [User's Guide] doesn't show the default page if LHelp is called from the > IDE via Help/CHM help or via context F1. They show an empty page. But it > shows the default page if I open prog.chm for example in LHelp via > File/Open. > > An other difference: Calling LHelp via context F1 doesn't show the toc. > Tested with F1 on "TForm". > > Rolf Hi Rolf, I have placed the next version of patch and created a branch on a forum for discussion https://forum.lazarus.freepascal.org/index.php/topic,53218.0.html -- Andrey From dezlov at gmail.com Sun Feb 7 15:01:46 2021 From: dezlov at gmail.com (Denis Kozlov) Date: Sun, 7 Feb 2021 14:01:46 +0000 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: References: Message-ID: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> Hi, I had a similar experience with taking a screenshot programmatically. Simply waiting or processing application messages after hiding the form often doesn't help, and results in a form being a part of the screenshot anyway. I managed to work around it by forcing Windows to repaint everything on the desktop by broadcasting WM_PAINT message, like so: SendMessageTimeout(HWND_BROADCAST, WM_PAINT, 0, 0, SMTO_ABORTIFHUNG, 1000, MsgResult); You might also need to disable transition effects (fade-in and fade-out) by setting the DWMWA_TRANSITIONS_FORCEDISABLED flag on the form before hiding it, and then unsetting it when showing the form again. DwmSetWindowAttribute(AForm.Handle, DWMWA_TRANSITIONS_FORCEDISABLED, @dwAttribute, SizeOf(dwAttribute)); Good luck, Denis On 07/02/2021 09:37, Bo Berglund via lazarus wrote: > I have worked on a tool to copy a region of the Windows desktop for use in > illustrations. The tool consists of a transparent form which is supposed to be > located on top of the area to copy. > > This form has a pop-up menu where there are 3 items to select from: > - Copy image > - Copy position > - Close > > When I use the "Copy image" function the resulting image contains the selected > menu item caption on top of the copied desktop bitmap... > > I have tried various ways to get rid of this but everything I tried has failed. > So how can I hide the menu item caption in code before I make the image > extraction? > > I even added a timer set to 50 ms interval and put the image copy in its ontimer > event hoping that the menu click should have exited and the text disappeared > before the image copy happened, but no go... > > Here is the way the copy is commanded via the popup menu: > http://blog.boberglund.com/files/Lazarus_popmenu_usage.png > > And here is a captured image where the popup caption is visible: > http://blog.boberglund.com/files/Lazarus_popmenu.png > > As you can see the caption of the clicked menu item is still present in the > screenshot image... > > Here is parts of the code: > > procedure TfrmMain.miCopyImageClick(Sender : TObject); > begin > //CopyScreenRect; //Moved to timer > //miCopyImage.Visible := false; //Does not work > //self.Refresh; //Does not work > timCopyImg.Enabled := true; //make copy inside timer event? > end; > > procedure TfrmMain.miCopyPosClick(Sender : TObject); > begin > SaveRectCoords; //Saving rect coordinates to clipboard (OK) > end; > > procedure TfrmMain.timCopyImgTimer(Sender : TObject); > begin > timCopyImg.Enabled := false; > miCopyImage.Visible := false; //Does not work, caption still present > self.Refresh; //Does also not work to remove caption > CopyScreenRect; > miCopyImage.Visible := true; //Put it back to enable next capture > end; > > procedure TfrmMain.CopyScreenRect; > var > MyCapture : TBgraBitmap; > Clip: TRect; > begin > try > Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); > Self.Visible := false; //Hide selection form before copy > //Self.Hide; //Not working for popup menu item... > MyCapture := TBgraBitmap.Create(); > MyCapture.TakeScreenShot(Clip); > Self.Visible := true; //Show selection form after copy is done > //Self.Show; //Not working for popup menu item... > Clipboard.Assign(MyCapture.Bitmap); > except > on E: exception do > Clipboard.AsText := E.Message; > end; > end; > > Even Self.Visible or Self.Hide do not remove the menuitem caption.... > > What can I do? > > Lazarus 2.0.10 / fpc 3.2.0 on Windows 10 > > From juha.manninen62 at gmail.com Sun Feb 7 15:07:03 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sun, 7 Feb 2021 16:07:03 +0200 Subject: [Lazarus] Lazarus configuration - portable between versions? In-Reply-To: References: <8iss1g53v58e6l19cvm5einrl92hdrkjcv@4ax.com> Message-ID: LazarusDirectory tag indeed has version dependent paths. I don't remember what exactly it is used for. The Recent file lists are not important. They are updated dynamically and old entries will go away. So, you can copy the whole configuration if you do some minor editing. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sun Feb 7 15:09:33 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 07 Feb 2021 15:09:33 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> Message-ID: On Sun, 7 Feb 2021 14:01:46 +0000, Denis Kozlov via lazarus wrote: > >I had a similar experience with taking a screenshot programmatically. >Simply waiting or processing application messages after hiding the form >often doesn't help, and results in a form being a part of the screenshot >anyway. > >I managed to work around it by forcing Windows to repaint everything on >the desktop by broadcasting WM_PAINT message, like so: > >SendMessageTimeout(HWND_BROADCAST, WM_PAINT, 0, 0, SMTO_ABORTIFHUNG, >1000, MsgResult); > >You might also need to disable transition effects (fade-in and fade-out) >by setting the DWMWA_TRANSITIONS_FORCEDISABLED flag on the form before >hiding it, and then unsetting it when showing the form again. > >DwmSetWindowAttribute(AForm.Handle, DWMWA_TRANSITIONS_FORCEDISABLED, >@dwAttribute, SizeOf(dwAttribute)); > >Good luck, >Denis Thanks for the suggestion! It turned out that (from a suggestion on the Lazarus forum) I could use a sleep(300) right before the call to the CopyScreenRect() instead of the other failed tests. Apparently the menu item is subject to Windows "animation" when it is closed... So this is now the code and it does work: procedure TfrmMain.miCopyImageClick(Sender : TObject); begin Sleep(300); CopyScreenRect; end; procedure TfrmMain.CopyScreenRect; var MyCapture : TBgraBitmap; Clip: TRect; begin try Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); Self.Visible := false; //To remove the capture frame from image MyCapture := TBgraBitmap.Create(); try MyCapture.TakeScreenShot(Clip); Self.Visible := true; Clipboard.Assign(MyCapture.Bitmap); finally MyCapture.Free; end; except on E: exception do Clipboard.AsText := E.Message; end; end; I tried various values for the sleep time and settled for 300, 200 does not quite fix it - a faded shadow image still remains. -- Bo Berglund Developer in Sweden From andrey.sobol.nn at gmail.com Sun Feb 7 15:16:31 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Sun, 7 Feb 2021 17:16:31 +0300 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> Message-ID: Try to call Application.ProcessMessages(); after disable a popup menu. Andrey. On 07.02.2021 17:09, Bo Berglund via lazarus wrote: > On Sun, 7 Feb 2021 14:01:46 +0000, Denis Kozlov via lazarus > wrote: > >> >> I had a similar experience with taking a screenshot programmatically. >> Simply waiting or processing application messages after hiding the form >> often doesn't help, and results in a form being a part of the screenshot >> anyway. >> >> I managed to work around it by forcing Windows to repaint everything on >> the desktop by broadcasting WM_PAINT message, like so: >> >> SendMessageTimeout(HWND_BROADCAST, WM_PAINT, 0, 0, SMTO_ABORTIFHUNG, >> 1000, MsgResult); >> >> You might also need to disable transition effects (fade-in and fade-out) >> by setting the DWMWA_TRANSITIONS_FORCEDISABLED flag on the form before >> hiding it, and then unsetting it when showing the form again. >> >> DwmSetWindowAttribute(AForm.Handle, DWMWA_TRANSITIONS_FORCEDISABLED, >> @dwAttribute, SizeOf(dwAttribute)); >> >> Good luck, >> Denis > > Thanks for the suggestion! > > It turned out that (from a suggestion on the Lazarus forum) I could use a > sleep(300) right before the call to the CopyScreenRect() instead of the other > failed tests. > > Apparently the menu item is subject to Windows "animation" when it is closed... > > So this is now the code and it does work: > > procedure TfrmMain.miCopyImageClick(Sender : TObject); > begin > Sleep(300); > CopyScreenRect; > end; > > procedure TfrmMain.CopyScreenRect; > var > MyCapture : TBgraBitmap; > Clip: TRect; > begin > try > Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); > Self.Visible := false; //To remove the capture frame from image > MyCapture := TBgraBitmap.Create(); > try > MyCapture.TakeScreenShot(Clip); > Self.Visible := true; > Clipboard.Assign(MyCapture.Bitmap); > finally > MyCapture.Free; > end; > except > on E: exception do > Clipboard.AsText := E.Message; > end; > end; > > I tried various values for the sleep time and settled for 300, 200 does not > quite fix it - a faded shadow image still remains. > > -- Andrey From bo.berglund at gmail.com Sun Feb 7 15:20:48 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 07 Feb 2021 15:20:48 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> Message-ID: <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> On Sun, 7 Feb 2021 17:16:31 +0300, Andrey Sobol via lazarus wrote: >Try to call > >Application.ProcessMessages(); >after disable a popup menu. > >Andrey. > Did not work. popmenu item still shows on captured image. The Sleep(300) in the menu handler does work OTOH... -- Bo Berglund Developer in Sweden From lazarus at mfriebe.de Thu Feb 11 17:42:43 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 11 Feb 2021 17:42:43 +0100 Subject: [Lazarus] We are planning the next release: Lazarus 2.0.12 Message-ID: <7cca964f-a4e0-3eea-be5a-48d960c7ed3a@mfriebe.de> The Lazarus team has scheduled      Lazarus 2.0.12      for February 2021 (estimated 22nd to 25th) This release will be built with_*FPC 3.2.0*_. Here is the list of fixes for Lazarus 2.0.12 (since 2.0.0): http://wiki.freepascal.org/Lazarus_2.0_fixes_branch We would invite everyone to provide their feedback to help us improve this upcoming release. Please let us know in particular: - Any bug-fixes already made to trunk, that you believe should still be merged to the fixes branch (fixes that are not listed on the above wiki page) - Any regressions that happened in fixes branch since the release of 2.0 - Other urgent (e.g. crashes/data-loss/...) matters, you believe we should know before the release. Please attempt to provide your feedback by: 16th February 2021 More info on our release process can be found at (work in progress): http://wiki.lazarus.freepascal.org/Lazarus_release_engineering Information about the previous release: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_3.0.4 http://wiki.lazarus.freepascal.org/User_Changes_3.2.0 The intended minimum requirements for the release will be: Windows:   2k(*), XP(*), Vista, 7, 8, 8.1 and 10, 32 or 64bit. FreeBSD/Linux:   gtk 2.8 for gtk2, qt4.5 for qt, qt5.6 for qt5, 32 or 64bit. macOS:   10.5 to 10.12; Carbon (32bit), Cocoa (64bit, beta), qt and qt5   (32 or 64bit). (*) requires install from sources -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus From flavio.etrusco at gmail.com Fri Feb 12 04:25:17 2021 From: flavio.etrusco at gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Etrusco?=) Date: Fri, 12 Feb 2021 00:25:17 -0300 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> Message-ID: Menu handling in Windows is fully synchronous (in the main thread) so you should use QueueAsyncCall: https://wiki.freepascal.org/Asynchronous_Calls Best regards, Flávio Em dom., 7 de fev. de 2021 às 11:20, Bo Berglund via lazarus escreveu: > > On Sun, 7 Feb 2021 17:16:31 +0300, Andrey Sobol via lazarus > wrote: > > >Try to call > > > >Application.ProcessMessages(); > >after disable a popup menu. > > > >Andrey. > > > > Did not work. popmenu item still shows on captured image. > The Sleep(300) in the menu handler does work OTOH... > > > -- > 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 Feb 12 11:16:16 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 12 Feb 2021 11:16:16 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> Message-ID: On Fri, 12 Feb 2021 00:25:17 -0300, Flávio Etrusco via lazarus wrote: >Menu handling in Windows is fully synchronous (in the main thread) so >you should use QueueAsyncCall: >https://wiki.freepascal.org/Asynchronous_Calls > >Best regards, >Flávio I tried modifying my menuclick event as follows: procedure TfrmMain.miCopyImageClick(Sender : TObject); begin //Sleep(300); //CopyScreenRect; Application.QueueAsyncCall(@CopyScreenRect); end; But now I get a compiler error: formmain.pas(149,46) Error: Wrong number of parameters specified for call to "QueueAsyncCall" It seems like the call you suggested does not work if you do not supply some kind of data too, but I don't have any call data in this case... >From the page you referenced: procedure QueueAsyncCall(AMethod: TDataEvent; Data: PtrInt); Note that my menu event handler does not use any data, so what to do in this case? I tried adding a bogus extra argument as zero but that just changed to a different error message... Application.QueueAsyncCall(@CopyScreenRect, 0); formmain.pas(149,45) Error: Incompatible type for arg no. 1: Got "", expected "" Copyscreenrect looks like this if that matters: procedure TfrmMain.CopyScreenRect; var MyCapture : TBgraBitmap; Clip: TRect; begin try Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); Self.Visible := false; MyCapture := TBgraBitmap.Create(); try MyCapture.TakeScreenShot(Clip); Self.Visible := true; Clipboard.Assign(MyCapture.Bitmap); finally MyCapture.Free; end; except on E: exception do Clipboard.AsText := E.Message; end; end; -- Bo Berglund Developer in Sweden From luca at wetron.es Fri Feb 12 12:51:08 2021 From: luca at wetron.es (Luca Olivetti) Date: Fri, 12 Feb 2021 12:51:08 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> Message-ID: <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> El 12/2/21 a les 11:16, Bo Berglund via lazarus ha escrit: ing a bogus extra argument as zero but that just changed to a > different error message... > > Application.QueueAsyncCall(@CopyScreenRect, 0); > > formmain.pas(149,45) Error: Incompatible type for arg no. 1: Got " variable type of procedure of object;Register>", expected " type of procedure(Int64) of object;Register>" It's telling you that the expected method should have an integer argument > > Copyscreenrect looks like this if that matters: > > procedure TfrmMain.CopyScreenRect; change that to procedure TfrmMain.CopyScreenRect(dummy:integer); Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bo.berglund at gmail.com Fri Feb 12 17:39:54 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 12 Feb 2021 17:39:54 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> Message-ID: <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> On Fri, 12 Feb 2021 12:51:08 +0100, Luca Olivetti via lazarus wrote: >El 12/2/21 a les 11:16, Bo Berglund via lazarus ha escrit: >ing a bogus extra argument as zero but that just changed to a >> different error message... >> >> Application.QueueAsyncCall(@CopyScreenRect, 0); >> >> formmain.pas(149,45) Error: Incompatible type for arg no. 1: Got "> variable type of procedure of object;Register>", expected "> type of procedure(Int64) of object;Register>" > >It's telling you that the expected method should have an integer argument >> >> Copyscreenrect looks like this if that matters: >> >> procedure TfrmMain.CopyScreenRect; > >change that to > >procedure TfrmMain.CopyScreenRect(dummy:integer); > >Bye private procedure CopyScreenRect(arg: integer); public ... procedure TfrmMain.miCopyImageClick(Sender : TObject); begin //Sleep(300); //CopyScreenRect; Application.QueueAsyncCall(@CopyScreenRect(0), 0); // <== ERROR here end; procedure TfrmMain.CopyScreenRect(arg: integer); var MyCapture : TBgraBitmap; Clip: TRect; begin try Clip := Bounds(Self.Left, Self.Top, Self.Width, Self.Height); Self.Visible := false; MyCapture := TBgraBitmap.Create(); try MyCapture.TakeScreenShot(Clip); Self.Visible := true; Clipboard.Assign(MyCapture.Bitmap); finally MyCapture.Free; end; except on E: exception do Clipboard.AsText := E.Message; end; end; Now I get this error: formmain.pas(149,31) Error: Variable identifier expected -- Bo Berglund Developer in Sweden From the.tail.kinker at gmail.com Fri Feb 12 19:26:05 2021 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Fri, 12 Feb 2021 13:26:05 -0500 Subject: [Lazarus] Borderspacing property not working? Message-ID: I have created several dynamic controls in my form, and setting the BorderSpacing property produces consistently incorrect results. Dynamically created controls will exhibit borders between themselves, but not to the parent object. What am I doing wrong? Here is a chunk of the offending code. for index := 0 to 8 do begin labSurface [index] := tLabel.Create (Application); with (labSurface [index]) do begin parent := tabSurface; Caption := LocationNames [index]; BorderSpacing.Around := 8; BorderSpacing.Left := 8; Anchors := [akTop, akLeft]; end; end; labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; labSurface [0].AnchorSide [akTop].Side := asrBottom; labSurface [0].AnchorSide [akLeft].Control := Parent; labSurface [0].AnchorSide [akLeft].Side := asrRight; for index := 1 to 8 do begin labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1]; labSurface [index].AnchorSide [akTop].Side := asrBottom; labSurface [index].AnchorSide [akLeft].Control := Parent; labSurface [index].AnchorSide [akLeft].Side := asrRight; end; -- "Cows fly like clouds, but are never quite successful." --Megahal -------------- next part -------------- An HTML attachment was scrubbed... URL: From vojtech.cihak at atlas.cz Fri Feb 12 20:06:29 2021 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Fri, 12 Feb 2021 20:06:29 +0100 Subject: [Lazarus] =?utf-8?q?Borderspacing_property_not_working=3F?= In-Reply-To: References: Message-ID: <20210212200629.2E8D4BFD@atlas.cz> Try to add there AnchorParallel:   labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; labSurface [0].AnchorSide [akTop].Side := asrBottom; labSurface [0].AnchorSide [akLeft].Control := Parent; labSurface [0].AnchorSide [akLeft].Side := asrRight; labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation); for index := 1 to 8 do begin labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1]; labSurface [index].AnchorSide [akTop].Side := asrBottom; labSurface [index].AnchorSide [akLeft].Control := Parent; labSurface [index].AnchorSide [akLeft].Side := asrRight; labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation); end;                        ______________________________________________________________ > Od: "Timothy Groves via lazarus" > Komu: "Lazarus mailing list" > Datum: 12.02.2021 19:26 > Předmět: [Lazarus] Borderspacing property not working? > I have created several dynamic controls in my form, and setting the BorderSpacing property produces consistently incorrect results.  Dynamically created controls will exhibit borders between themselves, but not to the parent object.  What am I doing wrong?Here is a chunk of the offending code.  for index := 0 to 8 do begin     labSurface [index] := tLabel.Create (Application);     with (labSurface [index]) do begin       parent := tabSurface;       Caption := LocationNames [index];       BorderSpacing.Around := 8;       BorderSpacing.Left := 8;       Anchors := [akTop, akLeft];     end;   end;   labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;   labSurface [0].AnchorSide [akTop].Side := asrBottom;   labSurface [0].AnchorSide [akLeft].Control := Parent;   labSurface [0].AnchorSide [akLeft].Side := asrRight;   for index := 1 to 8 do begin     labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];     labSurface [index].AnchorSide [akTop].Side := asrBottom;     labSurface [index].AnchorSide [akLeft].Control := Parent;     labSurface [index].AnchorSide [akLeft].Side := asrRight;   end; -- "Cows fly like clouds, but are never quite successful." --Megahal ---------- -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.tail.kinker at gmail.com Fri Feb 12 20:19:01 2021 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Fri, 12 Feb 2021 14:19:01 -0500 Subject: [Lazarus] Borderspacing property not working? In-Reply-To: <20210212200629.2E8D4BFD@atlas.cz> References: <20210212200629.2E8D4BFD@atlas.cz> Message-ID: That worked. Thanks. On Fri, 12 Feb 2021 at 14:06, Vojtěch Čihák via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Try to add there AnchorParallel: > > > > labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; > > labSurface [0].AnchorSide [akTop].Side := asrBottom; > > labSurface [0].AnchorSide [akLeft].Control := Parent; > > labSurface [0].AnchorSide [akLeft].Side := asrRight; > > labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation); > > for index := 1 to 8 do begin > > labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1]; > > labSurface [index].AnchorSide [akTop].Side := asrBottom; > > labSurface [index].AnchorSide [akLeft].Control := Parent; > > labSurface [index].AnchorSide [akLeft].Side := asrRight; > > labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation); > > end; > > > > ______________________________________________________________ > > Od: "Timothy Groves via lazarus" > > Komu: "Lazarus mailing list" > > Datum: 12.02.2021 19:26 > > Předmět: [Lazarus] Borderspacing property not working? > > > I have created several dynamic controls in my form, and setting the > BorderSpacing property produces consistently incorrect results. > Dynamically created controls will exhibit borders between themselves, but > not to the parent object. What am I doing wrong? > Here is a chunk of the offending code. > for index := 0 to 8 do begin > labSurface [index] := tLabel.Create (Application); > with (labSurface [index]) do begin > parent := tabSurface; > Caption := LocationNames [index]; > BorderSpacing.Around := 8; > BorderSpacing.Left := 8; > Anchors := [akTop, akLeft]; > end; > end; > > labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; > labSurface [0].AnchorSide [akTop].Side := asrBottom; > labSurface [0].AnchorSide [akLeft].Control := Parent; > labSurface [0].AnchorSide [akLeft].Side := asrRight; > for index := 1 to 8 do begin > labSurface [index].AnchorSide [akTop].Control := labSurface [index - > 1]; > labSurface [index].AnchorSide [akTop].Side := asrBottom; > labSurface [index].AnchorSide [akLeft].Control := Parent; > labSurface [index].AnchorSide [akLeft].Side := asrRight; > end; > -- > "Cows fly like clouds, but are never quite successful." > --Megahal > > > ---------- > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- "Cows fly like clouds, but are never quite successful." --Megahal -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.tail.kinker at gmail.com Fri Feb 12 20:25:38 2021 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Fri, 12 Feb 2021 14:25:38 -0500 Subject: [Lazarus] Borderspacing property not working? In-Reply-To: References: <20210212200629.2E8D4BFD@atlas.cz> Message-ID: Update: Then I realized what had changed. I attempted to clean up some of my other dynamically created page tabs, and problems persisted. I ran some experiments, and determined the root problem. So this problem is more properly expressed as: When anchoring to Parent, border settings are ignored, regardless if they are set using a method (such as AnchorToNeighbour or AnchorParallel) or directly (by changing the BorderSpacing property). Is this a known bug? Or is it an undocumented feature? If the latter, how do I anchor to a parent in a manner that respects border spacing? On Fri, 12 Feb 2021 at 14:19, Timothy Groves wrote: > That worked. Thanks. > > On Fri, 12 Feb 2021 at 14:06, Vojtěch Čihák via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> Try to add there AnchorParallel: >> >> >> >> labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; >> >> labSurface [0].AnchorSide [akTop].Side := asrBottom; >> >> labSurface [0].AnchorSide [akLeft].Control := Parent; >> >> labSurface [0].AnchorSide [akLeft].Side := asrRight; >> >> labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation); >> >> for index := 1 to 8 do begin >> >> labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1]; >> >> labSurface [index].AnchorSide [akTop].Side := asrBottom; >> >> labSurface [index].AnchorSide [akLeft].Control := Parent; >> >> labSurface [index].AnchorSide [akLeft].Side := asrRight; >> >> labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation); >> >> end; >> >> >> >> ______________________________________________________________ >> > Od: "Timothy Groves via lazarus" >> > Komu: "Lazarus mailing list" >> > Datum: 12.02.2021 19:26 >> > Předmět: [Lazarus] Borderspacing property not working? >> > >> I have created several dynamic controls in my form, and setting the >> BorderSpacing property produces consistently incorrect results. >> Dynamically created controls will exhibit borders between themselves, but >> not to the parent object. What am I doing wrong? >> Here is a chunk of the offending code. >> for index := 0 to 8 do begin >> labSurface [index] := tLabel.Create (Application); >> with (labSurface [index]) do begin >> parent := tabSurface; >> Caption := LocationNames [index]; >> BorderSpacing.Around := 8; >> BorderSpacing.Left := 8; >> Anchors := [akTop, akLeft]; >> end; >> end; >> >> labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; >> labSurface [0].AnchorSide [akTop].Side := asrBottom; >> labSurface [0].AnchorSide [akLeft].Control := Parent; >> labSurface [0].AnchorSide [akLeft].Side := asrRight; >> for index := 1 to 8 do begin >> labSurface [index].AnchorSide [akTop].Control := labSurface [index - >> 1]; >> labSurface [index].AnchorSide [akTop].Side := asrBottom; >> labSurface [index].AnchorSide [akLeft].Control := Parent; >> labSurface [index].AnchorSide [akLeft].Side := asrRight; >> end; >> -- >> "Cows fly like clouds, but are never quite successful." >> --Megahal >> >> >> ---------- >> >> -- >> _______________________________________________ >> lazarus mailing list >> lazarus at lists.lazarus-ide.org >> https://lists.lazarus-ide.org/listinfo/lazarus >> -- >> _______________________________________________ >> lazarus mailing list >> lazarus at lists.lazarus-ide.org >> https://lists.lazarus-ide.org/listinfo/lazarus >> > > > -- > "Cows fly like clouds, but are never quite successful." > --Megahal > -- "Cows fly like clouds, but are never quite successful." --Megahal -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean.suzineau at wanadoo.fr Fri Feb 12 21:23:19 2021 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Fri, 12 Feb 2021 21:23:19 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> Message-ID: <7087ee43-44db-4704-9b5f-3687c720b8a2@wanadoo.fr> Le 12/02/2021 à 17:39, Bo Berglund via lazarus a écrit : > Application.QueueAsyncCall(@CopyScreenRect(0), 0); // <== ERROR here I'm not sure, but QueueAsyncCall just need the address of your callback: Application.QueueAsyncCall(@CopyScreenRect, 0); The 0 given to QueueAsyncCall will end up as the Value passed as arg parameter to your CopyScreenRect method when it will called. From jean.suzineau at wanadoo.fr Fri Feb 12 21:37:02 2021 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Fri, 12 Feb 2021 21:37:02 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: <7087ee43-44db-4704-9b5f-3687c720b8a2@wanadoo.fr> References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> <7087ee43-44db-4704-9b5f-3687c720b8a2@wanadoo.fr> Message-ID: oops: when it will be called. From bo.berglund at gmail.com Fri Feb 12 22:34:45 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 12 Feb 2021 22:34:45 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> <7087ee43-44db-4704-9b5f-3687c720b8a2@wanadoo.fr> Message-ID: On Fri, 12 Feb 2021 21:23:19 +0100, Jean SUZINEAU via lazarus wrote: >Le 12/02/2021 à 17:39, Bo Berglund via lazarus a écrit : >> Application.QueueAsyncCall(@CopyScreenRect(0), 0); // <== ERROR here > >I'm not sure, but QueueAsyncCall just need the address of your callback: > >Application.QueueAsyncCall(@CopyScreenRect, 0); > >The 0 given to QueueAsyncCall will end up as the Value passed as arg >parameter to your CopyScreenRect method when it will called. I changed the code by removing the argument and it resulted in this error message: formmain.pas(149,45) Error: Incompatible type for arg no. 1: Got "", expected "" Code: procedure TfrmMain.miCopyImageClick(Sender : TObject); begin //Sleep(300); //CopyScreenRect(0); Application.QueueAsyncCall(@CopyScreenRect, 0); end; After changing the argument to int64 as follows: procedure TfrmMain.CopyScreenRect(arg: int64); then the code built and the shadow of the menu item was no longer present in the snatched image! So thanks for the suggestion, I will take out the sleep() command. -- Bo Berglund Developer in Sweden From pch at ap-i.net Fri Feb 12 22:43:02 2021 From: pch at ap-i.net (Patrick Chevalley) Date: Fri, 12 Feb 2021 21:43:02 +0000 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? In-Reply-To: References: <2cc68ab5-fc75-04a3-8c0e-3e240524f120@gmail.com> <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> <7087ee43-44db-4704-9b5f-3687c720b8a2@wanadoo.fr> Message-ID: <92b28d4a847ed960211c97c07e81c48a@ap-i.net> The declaration of QueueAsyncCall is: procedure QueueAsyncCall(const AMethod: TDataEvent; Data: PtrInt); You must use "arg: PtrInt" otherwise it will fail on a 32bit system. Patrick 12 février 2021 22:34 "Bo Berglund via lazarus" a écrit: > On Fri, 12 Feb 2021 21:23:19 +0100, Jean SUZINEAU via lazarus > wrote: > >> Le 12/02/2021 à 17:39, Bo Berglund via lazarus a écrit : >>> Application.QueueAsyncCall(@CopyScreenRect(0), 0); // <== ERROR here >> >> I'm not sure, but QueueAsyncCall just need the address of your callback: >> >> Application.QueueAsyncCall(@CopyScreenRect, 0); >> >> The 0 given to QueueAsyncCall will end up as the Value passed as arg >> parameter to your CopyScreenRect method when it will called. > > I changed the code by removing the argument and it resulted in this error > message: > > formmain.pas(149,45) Error: Incompatible type for arg no. 1: Got " variable type of procedure(LongInt) of object;Register>", expected " variable type of procedure(Int64) of object;Register>" > > Code: > > procedure TfrmMain.miCopyImageClick(Sender : TObject); > begin > //Sleep(300); > //CopyScreenRect(0); > Application.QueueAsyncCall(@CopyScreenRect, 0); > end; > > After changing the argument to int64 as follows: > > procedure TfrmMain.CopyScreenRect(arg: int64); > > then the code built and the shadow of the menu item was no longer present in the > snatched image! > > So thanks for the suggestion, I will take out the sleep() command. > > -- > Bo Berglund > Developer in Sweden > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From vojtech.cihak at atlas.cz Fri Feb 12 22:49:34 2021 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Fri, 12 Feb 2021 22:49:34 +0100 Subject: [Lazarus] =?utf-8?q?Borderspacing_property_not_working=3F?= In-Reply-To: References: , <20210212200629.2E8D4BFD@atlas.cz>, Message-ID: <20210212224934.A9CC406A@atlas.cz> You probably do something wrong.   Here both   Button1.AnchorParallel(akLeft, 10, Form1);   or   Button1.BorderSpacing.Left:=10; Button1.AnchorSide[akLeft].Control:=Form1; Button1.Anchors:=[akLeft];   works well.   V .   ______________________________________________________________ > Od: "Timothy Groves via lazarus" > Komu: "Lazarus mailing list" > Datum: 12.02.2021 20:25 > Předmět: Re: [Lazarus] Borderspacing property not working? > Update:  Then I realized what had changed.  I attempted to clean up some of my other dynamically created page tabs, and problems persisted.  I ran some experiments, and determined the root problem.  So this problem is more properly expressed as:  When anchoring to Parent, border settings are ignored, regardless if they are set using a method (such as AnchorToNeighbour or AnchorParallel) or directly (by changing the BorderSpacing property).  Is this a known bug?  Or is it an undocumented feature?  If the latter, how do I anchor to a parent in a manner that respects border spacing? On Fri, 12 Feb 2021 at 14:19, Timothy Groves > wrote:That worked.  Thanks. On Fri, 12 Feb 2021 at 14:06, Vojtěch Čihák via lazarus > wrote:Try to add there AnchorParallel:   labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation; labSurface [0].AnchorSide [akTop].Side := asrBottom; labSurface [0].AnchorSide [akLeft].Control := Parent; labSurface [0].AnchorSide [akLeft].Side := asrRight; labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation); for index := 1 to 8 do begin labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1]; labSurface [index].AnchorSide [akTop].Side := asrBottom; labSurface [index].AnchorSide [akLeft].Control := Parent; labSurface [index].AnchorSide [akLeft].Side := asrRight; labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation); end;                        ______________________________________________________________ > Od: "Timothy Groves via lazarus" > > Komu: "Lazarus mailing list" > > Datum: 12.02.2021 19:26 > Předmět: [Lazarus] Borderspacing property not working? > I have created several dynamic controls in my form, and setting the BorderSpacing property produces consistently incorrect results.  Dynamically created controls will exhibit borders between themselves, but not to the parent object.  What am I doing wrong?Here is a chunk of the offending code.  for index := 0 to 8 do begin     labSurface [index] := tLabel.Create (Application);     with (labSurface [index]) do begin       parent := tabSurface;       Caption := LocationNames [index];       BorderSpacing.Around := 8;       BorderSpacing.Left := 8;       Anchors := [akTop, akLeft];     end;   end;   labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;   labSurface [0].AnchorSide [akTop].Side := asrBottom;   labSurface [0].AnchorSide [akLeft].Control := Parent;   labSurface [0].AnchorSide [akLeft].Side := asrRight;   for index := 1 to 8 do begin     labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];     labSurface [index].AnchorSide [akTop].Side := asrBottom;     labSurface [index].AnchorSide [akLeft].Control := Parent;     labSurface [index].AnchorSide [akLeft].Side := asrRight;   end; -- "Cows fly like clouds, but are never quite successful." --Megahal ---------- -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus -- "Cows fly like clouds, but are never quite successful." --Megahal -- "Cows fly like clouds, but are never quite successful." --Megahal ---------- -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sat Feb 13 15:40:15 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 13 Feb 2021 15:40:15 +0100 Subject: [Lazarus] How to hide pop-up menu before taking a screen snapshot? References: <2ntv1g9n98u08o561ifvikgsflnolmdaev@4ax.com> <8dd3ef2a-7106-7e5e-0473-471339d1191a@wetron.es> <68bd2ghilobor9meq4ckavee5nncomc9no@4ax.com> <7087ee43-44db-4704-9b5f-3687c720b8a2@wanadoo.fr> <92b28d4a847ed960211c97c07e81c48a@ap-i.net> Message-ID: On Fri, 12 Feb 2021 21:43:02 +0000, Patrick Chevalley via lazarus wrote: >The declaration of QueueAsyncCall is: >procedure QueueAsyncCall(const AMethod: TDataEvent; Data: PtrInt); > >You must use "arg: PtrInt" otherwise it will fail on a 32bit system. > Thanks for the pointer! I changed it and it does work on Win64. I don't build for Win32 anyway because I have no crosscompiler... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Feb 13 21:11:04 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 13 Feb 2021 21:11:04 +0100 Subject: [Lazarus] How to make a TStaticText control appear on top of the form? References: Message-ID: <8mbg2gt8k3j9ecjv0drgj6k5jsg0sms7p6@4ax.com> On Thu, 04 Feb 2021 18:43:55 +0100, Bo Berglund via lazarus wrote: >On Wed, 03 Feb 2021 14:36:38 +0100, Bo Berglund via lazarus > wrote: > >>Very strange, the same binary behaves differently on two HP laptops both running >>Windows 10 and both a little more than one year old. >> >>How can I force these controls on top of the form so they are always visible? >> > >So I found out what causes this to happen: > >On my laptop the screen setting is 100%, whereas on the other laptop it is at >125%. >Changing that laptop back to 100% makes the missing controls appear on this >laptop too. > >Question: >--------- >How come some Lazarus controls cannot display on Windows 10 if the screen is set >to 125% sizing? Is this by design or is it just overlooked? > >The monitor is 1920x1080. > While hunting this problem I discovered that the TStaticText controls set to anchor right and top actually were placed erroneously on the form if the program is executed on a Win10 PC with the display set at 125% when the applicaton was created on a PC with display at 100%. So the two controls should be placed on top and right on the main form and this is where they are displayed on a PC with display set to 100%. But when I set the display to 125% they move left a distance that makes them invisible!!! By adding this code to the function that creates the form transparency shape I get the controls to display correctly in both 125% and 100% modes. stxClose.Left := Self.Width - stxClose.Width; stxSize.Left := stxClose.Left - stxSize.Width; To me it looks like this is a bug in Lazarus (or Fpc). It seems like when the form is created in Lazarus and alignment is set to [akTop,akRight] the location of the controls is somehow stored in the executable as pixels. Then when the application starts on a PC with 125% Lazarus/Fpc adjusts the form size and thus also the positions and sizes of all components on the form accordingly. But the left property of TStaticText is apparently not adjusted so it uses the smaller value from the 100% development PC rather than the bigger value on the 125% PC. The result of this is that the components start out at a location well to the left of the intended position. And in my case they move into the invisible transparent part of the form... Lazarus 2.0.10, Fpc 3.2.0 on Windows 10 x64 -- Bo Berglund Developer in Sweden From juha.manninen62 at gmail.com Mon Feb 15 12:36:11 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Mon, 15 Feb 2021 13:36:11 +0200 Subject: [Lazarus] LHelp memory leak Message-ID: I finally configured LHelp as a CHM help viewer in my development Lazarus. I downloaded Marco's CHM snapshots linked here: https://forum.lazarus.freepascal.org/index.php/topic,52437.0.html There are 2 updates from Andrey Sobol. I downloaded them, too. LHelp opens correctly, although slowly for the first time. There is a strange flicker. First an empty window shows up, then it disappears. A little later the actual help window with contents shows. Anyway, then it works well and the documentation itself has improved, too. Nice! When I close LHelp, it asks if I really want to do it. Yes, I want it. Then LHelp leaks memory. See below. IIRC it does not leak when I start it standalone. It is caused by the IDE integration. Andrey Sobol and everybody who develops LHelp, please use the Debug buildmode I added there some time ago. All debug flags should be on when developing code. I tested with Linux 64-bit. IDE is built with LCL-QT5, I guess the same is used for LHelp. Juha --- Heap dump by heaptrc unit of /home/juha/SW/lazarus_trunk/components/chmhelp/lhelp/lhelp 2104258 memory blocks allocated : 408948350/417932920 2104238 memory blocks freed : 408947390/417931960 20 unfreed memory blocks : 960 True heap size : 2686976 True free heap : 2681536 Should be : 2682176 Call trace for block $00007FE448ECC900 size 96 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089ED50 DOLOADURI, line 458 of chmcontentprovider.pas $00000000008A28FC LOADURL, line 1299 of chmcontentprovider.pas $000000000052C828 OPENURL, line 1110 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B $00007FE4713B3E4B Call trace for block $00007FE448ECBF00 size 96 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089F6D9 QUEUEFILLTOC, line 602 of chmcontentprovider.pas $000000000089F290 NEWCHMOPENED, line 539 of chmcontentprovider.pas $00000000008DB878 $00000000008A27E7 LOADURL, line 1278 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B Call trace for block $00007FE4484FC600 size 32 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089ED50 DOLOADURI, line 458 of chmcontentprovider.pas $00000000008A28FC LOADURL, line 1299 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713AFE10 $00007FE4713B3E4B Call trace for block $00007FE4484FD600 size 24 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089ED50 DOLOADURI, line 458 of chmcontentprovider.pas $00000000008A28FC LOADURL, line 1299 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B $00007FE4713AFE10 $00007FE4713B3E4B Call trace for block $00007FE4484FDB00 size 40 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089ED50 DOLOADURI, line 458 of chmcontentprovider.pas $00000000008A28FC LOADURL, line 1299 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B $00007FE4713AFE10 $00007FE4713B3E4B Call trace for block $00007FE450058A00 size 96 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089F6D9 QUEUEFILLTOC, line 602 of chmcontentprovider.pas $000000000089F290 NEWCHMOPENED, line 539 of chmcontentprovider.pas $00000000008DB878 $00000000008A27E7 LOADURL, line 1278 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B Call trace for block $00007FE4500D8780 size 96 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089F6D9 QUEUEFILLTOC, line 602 of chmcontentprovider.pas $000000000089F290 NEWCHMOPENED, line 539 of chmcontentprovider.pas $00000000008DB878 $00000000008A27E7 LOADURL, line 1278 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B Call trace for block $00007FE413581100 size 32 $000000000051AEEA PROCESSASYNCCALLQUEUE, line 1066 of include/application.inc $0000000000518ABB PROCESSMESSAGES, line 419 of include/application.inc $000000000089ED50 DOLOADURI, line 458 of chmcontentprovider.pas $00000000008A28FC LOADURL, line 1299 of chmcontentprovider.pas $000000000052CA58 OPENURL, line 1137 of lhelpcore.pas $000000000052AE5D SERVERMESSAGE, line 813 of lhelpcore.pas $00000000006F26AE DOONTIMER, line 179 of customtimer.pas $00000000006F2519 TIMER, line 151 of customtimer.pas $00000000007513D1 SIGNALTIMEOUT, line 4706 of qt5/qtobjects.pas $00007FE4713AFE10 $00007FE4713B3E4B $00007FE4713B3E4B $00007FE4713AFE10 $00007FE4713B3E4B --- and so on --- -------------- next part -------------- An HTML attachment was scrubbed... URL: From fpc at pascalprogramming.org Mon Feb 15 13:15:59 2021 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Mon, 15 Feb 2021 13:15:59 +0100 Subject: [Lazarus] LHelp memory leak In-Reply-To: References: Message-ID: <0a762d72-6d63-a3f8-04fb-9c0cb6167e88@pascalprogramming.org> Op 2021-02-15 om 12:36 schreef Juha Manninen via lazarus: > I finally configured LHelp as a CHM help viewer in my development Lazarus. > I downloaded Marco's CHM snapshots linked here: > https://forum.lazarus.freepascal.org/index.php/topic,52437.0.html > > There are 2 updates from Andrey Sobol. I downloaded them, too. > LHelp opens correctly, although slowly for the first time. > There is a strange flicker. First an empty window shows up, then it > disappears. A little later the actual help window with contents shows. > Anyway, then it works well and the documentation itself has improved, > too. Nice! > > When I close LHelp, it asks if I really want to do it. Yes, I want it. > Then LHelp leaks memory. See below. > IIRC it does not leak when I start it standalone. It is caused by the > IDE integration. > Andrey Sobol and everybody who develops LHelp, please use the Debug > buildmode I added there some time ago. All debug flags should be on > when developing code. > > I tested with Linux 64-bit. IDE is built with LCL-QT5, I guess the > same is used for LHelp. > Some memory leaks were fixed FPC side, retest with a stable branch compiler. From juha.manninen62 at gmail.com Mon Feb 15 13:39:31 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Mon, 15 Feb 2021 14:39:31 +0200 Subject: [Lazarus] LHelp memory leak In-Reply-To: <0a762d72-6d63-a3f8-04fb-9c0cb6167e88@pascalprogramming.org> References: <0a762d72-6d63-a3f8-04fb-9c0cb6167e88@pascalprogramming.org> Message-ID: On Mon, Feb 15, 2021 at 2:16 PM Marco van de Voort via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Some memory leaks were fixed FPC side, retest with a stable branch > compiler. > Ok, I was using FPC 3.2 release. Do you mean testing with the 3.2.1 fixes branch? BTW, people are anxiously waiting for 3.2.2 release. I hope it happens reasonably soon. Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Mon Feb 15 16:53:16 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Mon, 15 Feb 2021 17:53:16 +0200 Subject: [Lazarus] LHelp memory leak In-Reply-To: References: Message-ID: On Mon, Feb 15, 2021 at 1:36 PM Juha Manninen wrote: > I downloaded Marco's CHM snapshots linked here: > https://forum.lazarus.freepascal.org/index.php/topic,52437.0.html > There are 2 updates from Andrey Sobol. I downloaded them, too. > Now I learned they are also in Lazarus binaries SVN directory. https://svn.freepascal.org/svn/lazarus/binaries Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.sobol.nn at gmail.com Mon Feb 15 17:27:56 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Mon, 15 Feb 2021 19:27:56 +0300 Subject: [Lazarus] LHelp memory leak In-Reply-To: References: Message-ID: <28f14043-b221-f0cd-30bb-f49ce6d6a188@gmail.com> Hello, I have tested with FPC 3.2.1, FPC trunc and Lazarus trunc I don`t see any leaks. P.S. The leaks checking I have an enabled always. I spent many time for a fixing leaks :) Andrey. On 15.02.2021 14:36, Juha Manninen via lazarus wrote: > I finally configured LHelp as a CHM help viewer in my development Lazarus. > I downloaded Marco's CHM snapshots linked here: > https://forum.lazarus.freepascal.org/index.php/topic,52437.0.html > > There are 2 updates from Andrey Sobol. I downloaded them, too. > LHelp opens correctly, although slowly for the first time. > There is a strange flicker. First an empty window shows up, then it > disappears. A little later the actual help window with contents shows. > Anyway, then it works well and the documentation itself has improved, > too. Nice! > > When I close LHelp, it asks if I really want to do it. Yes, I want it. > Then LHelp leaks memory. See below. > IIRC it does not leak when I start it standalone. It is caused by the > IDE integration. > Andrey Sobol and everybody who develops LHelp, please use the Debug > buildmode I added there some time ago. All debug flags should be on when > developing code. > > I tested with Linux 64-bit. IDE is built with LCL-QT5, I guess the same > is used for LHelp. > > Juha > -- Andrey From octopushole at gmail.com Sat Feb 20 10:58:19 2021 From: octopushole at gmail.com (duilio foschi) Date: Sat, 20 Feb 2021 10:58:19 +0100 Subject: [Lazarus] editor bug? Message-ID: I am using Lazarus v. 2.0.6 r. 62129 on windows 7/64 bits. I found an unexpected behaviours of the editor 1. I want to delete the text ":string" from the encircled column-sized frame you see here: https://i.ibb.co/V9ZPzSf/1.jpg The frame was selected using shift+alt+arrows keys. 2. when I click the ReplaceAll button also the text from the encircled button here https://i.ibb.co/dpFsjNq/2.jpg is deleted, what is unexpected. Isnt this a bug? Duilio -------------- next part -------------- An HTML attachment was scrubbed... URL: From octopushole at gmail.com Sat Feb 20 11:06:29 2021 From: octopushole at gmail.com (duilio foschi) Date: Sat, 20 Feb 2021 11:06:29 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) Message-ID: If the coder in charge of the editor reads this, I have a prayer for him: 1. The text showed in https://i.ibb.co/0FQV1L0/3.jpg is column-selected using shift+alt+arrow followed by ctrl-C 2. using the arrows key, I move the cursor to the position shown in https://i.ibb.co/VmbVJtg/4.jpg 3. I press ctrl-V. The text ':string' is correctly copied into the expected position but... look at the cursor https://i.ibb.co/PWLfsn9/5.jpg The cursor is now at the position after the 'g' in the same row where the text was copied. So in the Lazarus editor there is no difference in copying a text row-selected and a text column-selected. In Delphi there is a big difference when you copy a text (at least until v. 7, when I stopped using it). Say you copy a text of lenght L from the clipboard into point (x,y). If the text is row-selected, Delphi sets the cursor at point (x+L,y), like the Lazarus editor does. But if the text is column-selected, Delphi sets the cursor at point (x,y+1), in the row below. This enables you to quickly copy several rows of text, as shown here https://i.ibb.co/98Y9WnD/6.jpg This ability is a big plus for a coder...well... at least I remember I was using it often :) . -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryansmithhe at gmail.com Sat Feb 20 11:58:00 2021 From: ryansmithhe at gmail.com (R.Smith) Date: Sat, 20 Feb 2021 12:58:00 +0200 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: Message-ID: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> I'm not the coder, nor have any answer or thought on the matter, but I would like to point out that if you select text (any text) and then use a multi-cursor (pressing Alt+Shift+Down Arrow several times) and then Ctrl-V to paste, you get such a multi-row paste very easily. Whether the mentioned IDE thing gets fixed or not, I find this the easier way. Cheers! Ryan On 2021/02/20 12:06, duilio foschi via lazarus wrote: > If the coder in charge of the editor reads this, I have a prayer for him: > > 1. > > The text showed in > > https://i.ibb.co/0FQV1L0/3.jpg > > is column-selected using shift+alt+arrow followed by ctrl-C > > 2. using the arrows key, I move the cursor to the position shown in > > https://i.ibb.co/VmbVJtg/4.jpg > > 3. I press ctrl-V. The text ':string' is correctly copied into the > expected position but... look at the cursor > > https://i.ibb.co/PWLfsn9/5.jpg > > The cursor is now at the position after the 'g' in the same row where the > text was copied. > > So in the Lazarus editor there is no difference in copying a text > row-selected > and a text column-selected. > > In Delphi there is a big difference when you copy a text (at least > until v. 7, > when I stopped using it). > > Say you copy a text of lenght L from the clipboard into point (x,y). > If the text is row-selected, Delphi sets the cursor at point (x+L,y), > like the Lazarus editor does. > > But if the text is column-selected, Delphi sets the cursor at point > (x,y+1), > in the row below. > > This enables you to quickly copy several rows of text, as shown here > > https://i.ibb.co/98Y9WnD/6.jpg > > This ability is a big plus for a coder...well... at least I remember I > was using > it often :) > > . > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octopushole at gmail.com Sat Feb 20 13:11:00 2021 From: octopushole at gmail.com (duilio foschi) Date: Sat, 20 Feb 2021 13:11:00 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> Message-ID: Hi Ryan, not the same result IMHO. 1. I column-select the text shown in https://i.ibb.co/WpL6Rmz/1.jpg Now the clipboard contains the text that extends from point (26,66) to point (26,72) 2. I move the cursor to point (27,66). See https://i.ibb.co/zGqQPPT/2.jpg 3. now I would like to press ctr-v 6 times and get the text inserted in the following 6 rows...but I cant. In fact, after the first insert, the cursor stays on row 27. See https://i.ibb.co/v1FJqzg/3.jpg Instead, it should move to position (28,66) 4. pic https://i.ibb.co/jDBfSpZ/4.jpg shows the result I wanted from the start. I can get it only by several uneeded clicks on the arrows keys... 5. my point is: in Lazarus edit the act of inserting a text which is column-selected has the same result that the act of inserting a text which is row-selected. It would be nice to differentiate the results (as it was in Delhi editor) so to satisfy different needs of the coder. Thank you Duilio On Sat, Feb 20, 2021 at 11:58 AM R.Smith via lazarus < lazarus at lists.lazarus-ide.org> wrote: > I'm not the coder, nor have any answer or thought on the matter, but I > would like to point out that if you select text (any text) and then use a > multi-cursor (pressing Alt+Shift+Down Arrow several times) and then Ctrl-V > to paste, you get such a multi-row paste very easily. > > Whether the mentioned IDE thing gets fixed or not, I find this the easier > way. > > Cheers! > Ryan > > On 2021/02/20 12:06, duilio foschi via lazarus wrote: > > If the coder in charge of the editor reads this, I have a prayer for him: > > 1. > > The text showed in > > https://i.ibb.co/0FQV1L0/3.jpg > > is column-selected using shift+alt+arrow followed by ctrl-C > > 2. using the arrows key, I move the cursor to the position shown in > > https://i.ibb.co/VmbVJtg/4.jpg > > 3. I press ctrl-V. The text ':string' is correctly copied into the > expected position but... look at the cursor > > https://i.ibb.co/PWLfsn9/5.jpg > > The cursor is now at the position after the 'g' in the same row where the > text was copied. > > So in the Lazarus editor there is no difference in copying a text > row-selected > and a text column-selected. > > In Delphi there is a big difference when you copy a text (at least until > v. 7, > when I stopped using it). > > Say you copy a text of lenght L from the clipboard into point (x,y). > If the text is row-selected, Delphi sets the cursor at point (x+L,y), > like the Lazarus editor does. > > But if the text is column-selected, Delphi sets the cursor at point > (x,y+1), > in the row below. > > This enables you to quickly copy several rows of text, as shown here > > https://i.ibb.co/98Y9WnD/6.jpg > > This ability is a big plus for a coder...well... at least I remember I was > using > it often :) > > . > > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Sat Feb 20 14:51:16 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Feb 2021 14:51:16 +0100 Subject: [Lazarus] editor bug? In-Reply-To: References: Message-ID: On 20/02/2021 10:58, duilio foschi via lazarus wrote: > I am using Lazarus v. 2.0.6 r. 62129 on windows 7/64 bits. > > I found an unexpected behaviours of the editor > > 1. I want to delete the text ":string" from the encircled column-sized > frame > you see here: > > https://i.ibb.co/V9ZPzSf/1.jpg > > The frame was selected using shift+alt+arrows keys. > > 2. when I click the ReplaceAll button also the text from the encircled > button > here > > https://i.ibb.co/dpFsjNq/2.jpg > > is deleted, what is unexpected. > > Isnt this a bug? > Yes it is. This is not currently implemented, so the Search/Replace should not allow "in selection" You can report it (the unimplemented fearture) as a bug. But it will be rather some time until that might get implemented (unless someone contributes). ---------------- There are some other options to archive what you need. Multi caret mode: (you can in Keymap config a key to have all carets kept, when moving them in any direction) https://wiki.lazarus.freepascal.org/New_IDE_features_since#Multi_Caret Maybe https://wiki.lazarus.freepascal.org/New_IDE_features_since#Syncron-Edit And Editor Macros record actions for one line, end with positioning one line down => then play macro repeatedly. From lazarus at mfriebe.de Sat Feb 20 15:03:11 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Feb 2021 15:03:11 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: Message-ID: On 20/02/2021 11:06, duilio foschi via lazarus wrote: > > So in the Lazarus editor there is no difference in copying a text > row-selected > and a text column-selected. Well there is no diff with regards to caret placement. If you do column select over more than one line, and paste it, it will insert each "cell" as column mode dictates. But then also place the caret at the very end of the last cell. > > But if the text is column-selected, Delphi sets the cursor at point > (x,y+1), > in the row below. I thought I had seen that once (I used to once have D5) but I could neither remember where, nor how it was triggered.... Please report this as a feature request. --------------------- If multi caret does not solve this, you can always use macros Record macro / IIRC shift ctrl R Set Bookmark 1 Paste Go to Bookmark1 Go Down one line END Record macro / IIRC shift ctrl R Now Play the macro with IIRC shift ctrl P as often as you need. Skip line if needed as you like. Using Pascal script macro, you can skip the bookmark. Or recording the macro for a specific text to pase, where you know the length you can use cursor-left as to go back the correct amount. From lazarus at mfriebe.de Sat Feb 20 15:12:00 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Feb 2021 15:12:00 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: Message-ID: <040c9440-a628-eadc-63fb-f9b1458145e3@mfriebe.de> On 20/02/2021 15:03, Martin Frb via lazarus wrote: > >> >> But if the text is column-selected, Delphi sets the cursor at point >> (x,y+1), >> in the row below. > I thought I had seen that once (I used to once have D5) but I could > neither remember where, nor how it was triggered.... Here is the Pascal script you need: var x: Integer; begin x := Caller.CaretX; ecPaste; Caller.CaretX := x; end. Open the editor MAcro window : ctrl-shift L - Record a new macro. You need to record something, e.g. move caret up, while recording. End recording. - Select the recorded macro in the list => EDIT - Copy above script into the macro, replacing its content. - Save (ctrl S) Then rename the macro. Assign a key to it. Below the list of macros (in the macro window) is a "move to:" Project IDE *** Move it to "IDE" *** You can get to it again using the tabs above the list. "Recorded" macros,  are deleted when you close the IDE "Project" macros are kept but only avail for the one project. "IDE" are global and kept. --- Now you have a key to paste (column or normal selection) into the editor and keep the X. If you want you can add an   ecDown before the "end." Then it will also go one line down. From lazarus at mfriebe.de Sat Feb 20 15:43:39 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Feb 2021 15:43:39 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: Message-ID: <4897bafe-9499-55fd-7a6d-e64f6d886ad0@mfriebe.de> On 20/02/2021 15:03, Martin Frb via lazarus wrote: > >> >> But if the text is column-selected, Delphi sets the cursor at point >> (x,y+1), >> in the row below. > I thought I had seen that once (I used to once have D5) but I could > neither remember where, nor how it was triggered.... > > Please report this as a feature request. In _*Lazarus trunk*_ you do not even need the clipboard. https://imgur.com/a/uPyo4Eb  (ignore the context popup, I pressed the wrong button) Lazarus can - duplicate current line(s) - move up/down current line(s) AND it can do the same for the selection. Select your text. Duplicate it. Move it up/downs/left/right/ Duplicate again, Move again ..... -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Sat Feb 20 17:31:04 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Feb 2021 17:31:04 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> Message-ID: On 20/02/2021 13:11, duilio foschi via lazarus wrote: > > pic > > https://i.ibb.co/jDBfSpZ/4.jpg > > shows the result I wanted from the start. I can get it only by several > uneeded clicks on the arrows keys... > https://imgur.com/a/w5uzUhh copy Then instead of pasting once for each line, press Shift Alt down to set cursors on each line Do one single paste. If I count correctly, one keystroke more (assuming that Delphi includes cursor down, in the paste). If in Delphi you do paste,down,paste,down,...  Then in Lazarus its less keystrokes However, multi caret works only when there are no lines to skip (well you can set carets individually, but thats more work) > 5. > > my point is: in Lazarus edit the act of inserting a text which is > column-selected has the same > result that the act of inserting a text which is row-selected. It > would be nice to > differentiate the results (as it was in Delhi editor) so to satisfy > different > needs of the coder. > See my other reply: - Yes it should be added. (as build in) - You can (in 2.0.10) add a macro that does it.... From octopushole at gmail.com Sun Feb 21 10:02:22 2021 From: octopushole at gmail.com (duilio foschi) Date: Sun, 21 Feb 2021 10:02:22 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> Message-ID: Hi Martin, I am too lazy to learn how to use editor scripts. Probably it will be more productive to spend some time to correct the editor code. After all, the Jedi editor - written in Delphi and available in source code - behaves like old Delphi editor in column mode. How can I try to fix the problem? Where is the Lazarus repository with the original code of the Lazarus editor? Thank you Duilio On Sat, Feb 20, 2021 at 5:31 PM Martin Frb wrote: > On 20/02/2021 13:11, duilio foschi via lazarus wrote: > > > > pic > > > > https://i.ibb.co/jDBfSpZ/4.jpg > > > > shows the result I wanted from the start. I can get it only by several > > uneeded clicks on the arrows keys... > > > https://imgur.com/a/w5uzUhh > > copy > > Then instead of pasting once for each line, press Shift Alt down to set > cursors on each line > Do one single paste. > > If I count correctly, one keystroke more (assuming that Delphi includes > cursor down, in the paste). > If in Delphi you do paste,down,paste,down,... Then in Lazarus its less > keystrokes > > However, multi caret works only when there are no lines to skip (well > you can set carets individually, but thats more work) > > > > 5. > > > > my point is: in Lazarus edit the act of inserting a text which is > > column-selected has the same > > result that the act of inserting a text which is row-selected. It > > would be nice to > > differentiate the results (as it was in Delhi editor) so to satisfy > > different > > needs of the coder. > > > See my other reply: > - Yes it should be added. (as build in) > - You can (in 2.0.10) add a macro that does it.... > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christo.crause at gmail.com Sun Feb 21 10:50:49 2021 From: christo.crause at gmail.com (Christo Crause) Date: Sun, 21 Feb 2021 11:50:49 +0200 Subject: [Lazarus] Introducing new dependencies between components - how to update make files? Message-ID: I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger. Some of the property classes overlap with classes already defined in gdbmidebugger and I want to move these classes up the hierarchy to avoid duplication. This introduces extra dependencies and I need to update the affected component make files. I started doing this using the "Create Makefile" option in the Lazarus package tool with FPC 3.2 and noticed large changes in the resulting make file, mostly related to deleted targets such as xtensa-freertos. Should I use FPC trunk (and more specifically fpcmake from trunk) for development of Lazarus, or is this just required when regenerating make files? Also the build order of some of the targets needs to be reordered in the root make file to satisfy the dependency chain, can I update the Makefile.fpc and MakeFile by hand, or is there a tool/option to also update these make files which are not part of a package? Best regards, Christo -------------- next part -------------- An HTML attachment was scrubbed... URL: From nc-gaertnma at netcologne.de Sun Feb 21 11:08:24 2021 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 21 Feb 2021 11:08:24 +0100 Subject: [Lazarus] Introducing new dependencies between components - how to update make files? In-Reply-To: References: Message-ID: <20210221110824.633120f1@limapholos.matflo.wg> On Sun, 21 Feb 2021 11:50:49 +0200 Christo Crause via lazarus wrote: > I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger. > Some of the property classes overlap with classes already defined in > gdbmidebugger and I want to move these classes up the hierarchy to > avoid duplication. This introduces extra dependencies and I need to > update the affected component make files. I started doing this using > the "Create Makefile" option in the Lazarus package tool with FPC 3.2 > and noticed large changes in the resulting make file, mostly related > to deleted targets such as xtensa-freertos. Should I use FPC trunk > (and more specifically fpcmake from trunk) for development of > Lazarus, or is this just required when regenerating make files? > > Also the build order of some of the targets needs to be reordered in > the root make file to satisfy the dependency chain, can I update the > Makefile.fpc and MakeFile by hand, or is there a tool/option to also > update these make files which are not part of a package? The Lazarus Makefiles are created from the corresponding Makefile.fpc. In order to support fpc trunk, you need fpc trunk sources. You can update one Makefile by calling the one liner (e.g linux 64bit): FPCDIR=/path/to/fpc_sources/trunk/fpc/ /path/to/fpc_sources/trunk/fpc/utils/fpcm/bin/x86_64-linux/fpcmake -TAll -v Mattias From lazarus at mfriebe.de Sun Feb 21 12:30:04 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 21 Feb 2021 12:30:04 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> Message-ID: <7baf3e58-a5fb-951a-4e99-3a699ec39197@mfriebe.de> On 21/02/2021 10:02, duilio foschi wrote: > Hi Martin, > > I am too lazy to learn how to use editor scripts. > > Probably it will be more productive to spend some time to correct the > editor code. > > After all, the Jedi editor - written in Delphi and available in source > code - behaves like old Delphi editor in column mode. > > How can I try to fix the problem? > > Where is the Lazarus repository with the original code of the Lazarus > editor? > Official: https://svn.freepascal.org/svn/lazarus/ For bugs and patches: https://bugs.freepascal.org/set_project.php?project_id=1 I am running a mirror at https://github.com/User4martin/lazarus/ For most SynEdit and Debugger issues, I can accept pull requests (those go to me only, no one else in the team, therefore limited to work I will deal with) SynEdit is in Components/SynEdit If you are looking for the Search/Replace dialog, afaik its in the folder ide/ . Best to start looking from the file ide/SourceEditor.pp . But probably you want SynEdit. SynEdit.pp You probably want to look at function TCustomSynEdit.PasteFromClipboardEx You should know about the caret pos https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position You can get/set the caret pas on FCaret. Also you will look for   PMode: TSynSelectionMode; This actually sets the text: FInternalBlockSelection.SetSelTextPrimitive So then you only need restore the CaretX ---- Now this is important, you will see it works on CaretBytePos (logical) But you will need CharPos. Imagine you copy columns from 2 or more lines. Then (I guess) you want to set the caret to the start of the column in the *last* line to which was inserted.. If there is a tab at the first line you insert, then you may be at PhysX=4 and LogX=2 (behind the tab) If there is no tab in the last line, and you set LogX =2 , well that is not what you want. --------------------- Remind me, does the Caret go to the start of the insert, or does it automatically move one line down too? And one more thing, if you plan to submit a patch, please add an option to SynEdit.Options2 Many people are used to the current behaviour, I do not plan to upset them. The option will then be controlled from the IDE. So the patch will either wait till I get to do that. Or if you volunteer ide/EditorOptions.pas  (search Options2 or ) ide/frames/editor_misc_options From octopushole at gmail.com Sun Feb 21 13:02:03 2021 From: octopushole at gmail.com (duilio foschi) Date: Sun, 21 Feb 2021 13:02:03 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: <7baf3e58-a5fb-951a-4e99-3a699ec39197@mfriebe.de> References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> <7baf3e58-a5fb-951a-4e99-3a699ec39197@mfriebe.de> Message-ID: Hi Martin, thank you for the detailled instructions. Re your question >does the Caret go to the start of the insert, or does it automatically move one line down too? in Delphi/column mode, the caret moves one line down at each insert. 1. starting from this status https://i.ibb.co/jL30yFx/1.jpg I click ctrl+O+C for column mode 2. I select the text 'peppe'+blank then ctrl-c to save the text into memory https://i.ibb.co/99DH4gc/2.jpg 3. using the arrow keys, I move the caret 2 lines down... https://i.ibb.co/ZHGqZx3/3.jpg 4. after I press ctrl-v, the caret moves 1 line down. This is exactly what I miss in Lazarus :) https://i.ibb.co/ZT6LJdD/4.jpg I will try to fix the point. Thank you Duilio On Sun, Feb 21, 2021 at 12:30 PM Martin Frb wrote: > On 21/02/2021 10:02, duilio foschi wrote: > > Hi Martin, > > > > I am too lazy to learn how to use editor scripts. > > > > Probably it will be more productive to spend some time to correct the > > editor code. > > > > After all, the Jedi editor - written in Delphi and available in source > > code - behaves like old Delphi editor in column mode. > > > > How can I try to fix the problem? > > > > Where is the Lazarus repository with the original code of the Lazarus > > editor? > > > > Official: https://svn.freepascal.org/svn/lazarus/ > For bugs and patches: > https://bugs.freepascal.org/set_project.php?project_id=1 > > I am running a mirror at https://github.com/User4martin/lazarus/ > For most SynEdit and Debugger issues, I can accept pull requests (those > go to me only, no one else in the team, therefore limited to work I will > deal with) > > SynEdit is in Components/SynEdit > > If you are looking for the Search/Replace dialog, afaik its in the > folder ide/ . Best to start looking from the file ide/SourceEditor.pp . > But probably you want SynEdit. > > SynEdit.pp > You probably want to look at function TCustomSynEdit.PasteFromClipboardEx > > You should know about the caret pos > > https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position > > You can get/set the caret pas on FCaret. > Also you will look for PMode: TSynSelectionMode; > > This actually sets the text: FInternalBlockSelection.SetSelTextPrimitive > > So then you only need restore the CaretX > > ---- > Now this is important, you will see it works on CaretBytePos (logical) > But you will need CharPos. > > Imagine you copy columns from 2 or more lines. > Then (I guess) you want to set the caret to the start of the column in > the *last* line to which was inserted.. > > If there is a tab at the first line you insert, then you may be at > PhysX=4 and LogX=2 (behind the tab) > If there is no tab in the last line, and you set LogX =2 , well that is > not what you want. > > > --------------------- > > Remind me, does the Caret go to the start of the insert, or does it > automatically move one line down too? > > And one more thing, if you plan to submit a patch, please add an option > to SynEdit.Options2 > Many people are used to the current behaviour, I do not plan to upset them. > > The option will then be controlled from the IDE. So the patch will > either wait till I get to do that. > Or if you volunteer ide/EditorOptions.pas (search Options2 or ) > ide/frames/editor_misc_options > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christo.crause at gmail.com Sun Feb 21 16:22:58 2021 From: christo.crause at gmail.com (Christo Crause) Date: Sun, 21 Feb 2021 17:22:58 +0200 Subject: [Lazarus] Introducing new dependencies between components - how to update make files? In-Reply-To: <20210221110824.633120f1@limapholos.matflo.wg> References: <20210221110824.633120f1@limapholos.matflo.wg> Message-ID: On Sun, Feb 21, 2021 at 12:08 PM Mattias Gaertner via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On Sun, 21 Feb 2021 11:50:49 +0200 > Christo Crause via lazarus wrote: > > > I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger. > > Some of the property classes overlap with classes already defined in > > gdbmidebugger and I want to move these classes up the hierarchy to > > avoid duplication. This introduces extra dependencies and I need to > > update the affected component make files. I started doing this using > > the "Create Makefile" option in the Lazarus package tool with FPC 3.2 > > and noticed large changes in the resulting make file, mostly related > > to deleted targets such as xtensa-freertos. Should I use FPC trunk > > (and more specifically fpcmake from trunk) for development of > > Lazarus, or is this just required when regenerating make files? > > > > Also the build order of some of the targets needs to be reordered in > > the root make file to satisfy the dependency chain, can I update the > > Makefile.fpc and MakeFile by hand, or is there a tool/option to also > > update these make files which are not part of a package? > > The Lazarus Makefiles are created from the corresponding Makefile.fpc. > In order to support fpc trunk, you need fpc trunk sources. > > You can update one Makefile by calling the one liner (e.g linux 64bit): > > FPCDIR=/path/to/fpc_sources/trunk/fpc/ > /path/to/fpc_sources/trunk/fpc/utils/fpcm/bin/x86_64-linux/fpcmake > -TAll -v > Thank you Mattias, that does the trick. -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Sun Feb 21 16:53:42 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sun, 21 Feb 2021 17:53:42 +0200 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: <7baf3e58-a5fb-951a-4e99-3a699ec39197@mfriebe.de> References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> <7baf3e58-a5fb-951a-4e99-3a699ec39197@mfriebe.de> Message-ID: On Sun, Feb 21, 2021 at 1:30 PM Martin Frb via lazarus < lazarus at lists.lazarus-ide.org> wrote: > And one more thing, if you plan to submit a patch, please add an option > to SynEdit.Options2 > Many people are used to the current behaviour, I do not plan to upset them. > This particular feature should not have an option IMO. Now it can be considered a missing feature or even a bug. When a user presses Alt-key when selecting, he clearly wants something special to happen with Ctrl-C. Now nothing special happens which is a semi-bug. I am sure everybody will be happy when this feature gets implemented. I can remember many situations where it would have been useful. IMO there are too many options already. If I accidentally change something during my tests, it takes a long time to figure out what changed and how to revert it. Please add more options only when really needed. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Sun Feb 21 17:22:20 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 21 Feb 2021 17:22:20 +0100 Subject: [Lazarus] I say a little prayer (for the Lazarus editor) In-Reply-To: References: <1ab8b340-6c65-7af4-d3a0-244e827e34d1@gmail.com> <7baf3e58-a5fb-951a-4e99-3a699ec39197@mfriebe.de> Message-ID: On 21/02/2021 16:53, Juha Manninen via lazarus wrote: > On Sun, Feb 21, 2021 at 1:30 PM Martin Frb via lazarus > > > wrote: > > And one more thing, if you plan to submit a patch, please add an > option > to SynEdit.Options2 > Many people are used to the current behaviour, I do not plan to > upset them. > > > This particular feature should not have an option IMO. > Now it can be considered a missing feature or even a bug. > When a user presses Alt-key when selecting, he clearly wants something > special to happen with Ctrl-C. Well, if the user selects a column selection of a single line, then yes (probably). But if the user selects column over several lines, then pasting already acts different than it would for a normal selection. (Select 3 full lines (start to end) using column selection => paste will be different than the same 3 lines in normal selection) And users who grew up without the feature may not like it. > Now nothing special happens which is a semi-bug. > I am sure everybody will be happy when this feature gets > implemented. I can remember many situations where it would have been > useful. I don't have an example at hand, but I am sure I have more than a few times made the experience that small, seemingly really useful changes got someone coming up wanting the old behaviour back. > > IMO there are too many options already. That is true, or rather they are badly organized. They need break down into basic, and expert (like the mouse options have) > If I accidentally change something during my tests, it takes a long > time to figure out what changed and how to revert it. Take a copy of your ___Options.xml files. You can restore or diff them. > Please add more options only when really needed. > What I really would want to do, is include config in the keymap. You could add new commands to the keymap. So you would assign ctrl-v to     paste(true) or    paste(ColumnAdvanceLine)    ecPaste(ColumnAdvanceLine, IndentToContext, TabsToSpaces) They look like pascal script, but they would not require pascalscript. (PascalScript does not work on all platforms, so it can not be used here) They would always be a single command, with hardcoded options. This is like in some browser, you can do config in css, JavaScript or similar. But that is a topic on its own. -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Sun Feb 21 23:45:37 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Mon, 22 Feb 2021 00:45:37 +0200 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package Message-ID: Help has improved lately thanks to Andrey Sobol's patches mostly. However a new dependency was added: LazMouseAndKeyInput. On Linux and UNIX systems it pulls in libXtst dependency. LHelp is part of Lazarus BigIde target which is used for releases. Extra dependencies for BigIde should be avoided if possible. Now I studied how LazMouseAndKeyInput is used in LHelp. Well, it is not used! LHelpCore has MouseAndkeyInput in its uses section but removing it and the whole package dependency makes no difference. My analysis: LazMouseAndKeyInput dependency can be removed from LHelp. Am I right? Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.sobol.nn at gmail.com Mon Feb 22 02:29:23 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Mon, 22 Feb 2021 04:29:23 +0300 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package In-Reply-To: References: Message-ID: <76da0409-82ab-0df8-f44e-b073c3d70965@gmail.com> On 22.02.2021 1:45, Juha Manninen via lazarus wrote: > Help has improved lately thanks to Andrey Sobol's patches mostly. > However a new dependency was added: LazMouseAndKeyInput. > On Linux and UNIX systems it pulls in libXtst dependency. > LHelp is part of Lazarus BigIde target which is used for releases. > Extra dependencies for BigIde should be avoided if possible. > > Now I studied how LazMouseAndKeyInput is used in LHelp. > Well, it is not used! > LHelpCore has MouseAndkeyInput in its uses section but removing it and > the whole package dependency makes no difference. > My analysis: LazMouseAndKeyInput dependency can be removed from LHelp. > Am I right? > > Regards, > Juha > > Helo Juha, You excluded this code from lcore.pas procedure THelpForm.ShowApp(); ...... {$IFDEF WINDOWS} // Go to TOC TreeView and to get focus on foreground window KeyInput.Apply([ssCtrl]); KeyInput.Press(VK_T); KeyInput.UnApply([ssCtrl]); {$ENDIF} Without the code on windows system we can`t get rightly a focus lHelp by an event of restore the window after hide (the window is blinking on an aplication panel sometimes). We should send an user input sentence to the foregroud window from a mouse or from keyboard to get focus (that is windows specific problem). I see some solutions of that: 1. To rewrite that code by WinApi (that is simple). 2. To exclude the package dependency on Mac system, but I don`t know how? 3. To fix the Application.BringToFront() function at windows to rightly bring a foreground window to a front of a display. But I don`t see that problem now :). May be the blinkg was also a part of that issue https://bugs.freepascal.org/view.php?id=38276 I redone many pieces after that, that a second round :) -- Andrey Sobol From andrey.sobol.nn at gmail.com Mon Feb 22 02:40:45 2021 From: andrey.sobol.nn at gmail.com (Andrey Sobol) Date: Mon, 22 Feb 2021 04:40:45 +0300 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package In-Reply-To: References: Message-ID: <63935c84-bf37-fe4c-7b32-6ef383d59316@gmail.com> On 22.02.2021 1:45, Juha Manninen via lazarus wrote: > Now I studied how LazMouseAndKeyInput is used in LHelp. Juha, read this https://www.codeproject.com/Tips/76427/How-to-bring-window-to-top-with-SetForegroundWindo That problem was before, but now I don`t see it. -- Andrey Sobol. From juha.manninen62 at gmail.com Mon Feb 22 09:52:00 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Mon, 22 Feb 2021 10:52:00 +0200 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package In-Reply-To: <76da0409-82ab-0df8-f44e-b073c3d70965@gmail.com> References: <76da0409-82ab-0df8-f44e-b073c3d70965@gmail.com> Message-ID: On Mon, Feb 22, 2021 at 3:29 AM Andrey Sobol via lazarus < lazarus at lists.lazarus-ide.org> wrote: > You excluded this code from lcore.pas > > procedure THelpForm.ShowApp(); > ...... > {$IFDEF WINDOWS} > // Go to TOC TreeView and to get focus on foreground window > KeyInput.Apply([ssCtrl]); > KeyInput.Press(VK_T); > KeyInput.UnApply([ssCtrl]); > {$ENDIF} > Oh, LazMouseAndKeyInput was just for that code. It created a serious bug. After pressing F1 in source editor the end of current word was cut off. The reason was that VK_T went to Lazarus IDE, although LHelp sent it to itself, and the default command for VK_T is "Delete to end of word". Didn't you notice the bug? It was discussed in Lazarus devel mailing list. It should have happened here instead. Something funny happens in the interprocess communication. How could key VK_T bring LHelp to front if it went to Lazarus' source editor? > Without the code on windows system we can`t get rightly a focus lHelp > by an event of restore the window after hide (the window is blinking on > an aplication panel sometimes). We should send an user input sentence to > the foregroud window from a mouse or from keyboard to get focus (that is > windows specific problem). > Yes, in Windows terminology bringing to front means blinking an icon in Taskbar. A Lazarus user however wants to see the help window right after pressing F1. I see some solutions of that: > 1. To rewrite that code by WinApi (that is simple). > 2. To exclude the package dependency on Mac system, but I don`t know how? > LazMouseAndKeyInput must be fixed for MacOS Cocoa but that is a whole different issue. Now that problem involves only Windows. A cross-platform package is not needed for that. The libXtst library dependency pulled in for Linux (and UNIX) was a 100% increase of system dependencies for a Lazarus release, and for absolutely no benefit. Now Lazarus BigIde depends on just libgtk2.0-dev. 3. To fix the Application.BringToFront() function at windows to rightly > bring a foreground window to a front of a display. > That was my idea, too. The method name BringToFront() is quite unambiguous. It should bring the application to front. :) The name is not BlinkAnIconInTaskbar(). If you know how to fix it, please do. I don't use Windows much myself. Does this idea go against some Windows convention? But I don`t see that problem now :). May be the blinkg was also a part > of that issue https://bugs.freepascal.org/view.php?id=38276 > > I redone many pieces after that, that a second round :) > I removed the LazMouseAndKeyInput dependency in r64647. Please fix the remaining issues as you see fit (without libXtst dependency for Linux). Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Mon Feb 22 10:05:54 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Mon, 22 Feb 2021 11:05:54 +0200 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package In-Reply-To: References: <76da0409-82ab-0df8-f44e-b073c3d70965@gmail.com> Message-ID: On Mon, Feb 22, 2021 at 10:52 AM Juha Manninen wrote: > The libXtst library dependency pulled in for Linux (and UNIX) was a > 100% increase of system dependencies for a Lazarus release, and for > absolutely no benefit. > Now Lazarus BigIde depends on just libgtk2.0-dev. > Ok, that was not accurate. Many other system libraries are pulled in by libgtk2.0-dev. However in a distro package system level it is the only requirement. Adding dependency for X brings another problem: Lazarus would not work with Wayland display server. Now it works if the widgetset supports Wayland. Major widgetsets like GTK3 and QT5 do support it. Not sure about GTK2. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryansmithhe at gmail.com Mon Feb 22 10:59:44 2021 From: ryansmithhe at gmail.com (R.Smith) Date: Mon, 22 Feb 2021 11:59:44 +0200 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package In-Reply-To: References: <76da0409-82ab-0df8-f44e-b073c3d70965@gmail.com> Message-ID: <76d61806-9b75-0237-0bb8-fb2d9f9f7c60@gmail.com> On 2021/02/22 10:52, Juha Manninen via lazarus wrote: > > Yes, in Windows terminology bringing to front means blinking an icon > in Taskbar. > A Lazarus user however wants to see the help window right after > pressing F1. YES, this is very important. I am not looking to weigh in on the issue of how Lazarus help works, but I can say something about Windows and the next comment:. > > The name is not BlinkAnIconInTaskbar(). > If you know how to fix it, please do. I don't use Windows much myself. > Does this idea go against some Windows convention? Blinking and Bringing to Front are two very distinct ideas in Windows and two different use-cases, though they often coincide. If I recall the Microsoft discussions correctly, the idea wasn't to ever blink when a user clicks the application into the foreground, or for instance pulls up the Help. Blinking the taskbar was only to be done if your application is *in the Background* AND something happens that is important for which you need to grab the User's attention towards it. (If your program is in the foreground/focused, you have carte-blanche on how to flash it or grab attention and don't need a flickering taskbar icon specifically, though *also* doing it isn't a sin) The event that lead to you needing to blink the taskbar icon may well also require bringing to front, but it might also not (the judgement is left up to the software designer). A good example is the Lazarus IDE after a debug session in Windows. After running your program (i.e. once your program terminates) Lazarus will both pop to front *and* flash the taskbar icon IF, and only IF, the debugged program was the focused desktop window. If I switch to any other program while the debugged program was running (pushing more apps onto the "focus" stack of the desktrop manager), Lazarus correctly does not "steal" the focus back by popping to front, but it does still flash the taskbar icon to make the user aware. With the above in mind, I'd say when the user press F1 (or invoke help in any way) there should be a help window popping up/to front/focusing/etc, but no need for any blinking. The user KNOWS/EXPECTS what is coming, no need to try and draw their attention to it. A final note: Lots of Windows users HATE taskbar icons blinking, they turn it off. (Just search google on how to turn it off, you will find oodles of hate rants). For more info, see: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-flashwindowex Cheers, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Tue Feb 23 10:41:37 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Feb 2021 11:41:37 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks Message-ID: Hello LazUtils has unit Masks with classes TMask and TMaskList. FPC's packages/fpindexer has unit FPMasks also with classes TMask and TMaskList. A comment in FPMasks says "Moved here from LCL". Revision control shows it was added 9 years ago in 2012. Since 2.5 years ago it supports Unicode by using UTF8string for all strings. LCL has a related MaskEdit. It was first added in 2002 by Mattias with comment "added TMaskEdit from Tony" I don't know who Tony is. Unit Masks was first added to LCL in 2007 by tombo with comment "LCL: implemented TMask, MatchesMask, added Masks docs" I don't know who Tombo is either. In 2011 Masks was moved to LazUtils by Felipe. Masks and MaskEdit have some identical code. IMO MaskEdit should reuse some code from Masks. MaskEdit is maintained by Bart but he didn't know details of the history. Masks in LazUtils has a slow implementation. I planned to optimize it but now I realize we may have overlapping code. Q: Are Masks (LazUtils) and FPMasks (fpindexer) compatible? If they are, we should dump the LazUtils Masks and use code from FPC's libs. Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From serbod at gmail.com Tue Feb 23 10:52:54 2021 From: serbod at gmail.com (Sergey Bodrov) Date: Tue, 23 Feb 2021 12:52:54 +0300 Subject: [Lazarus] LHelp and LazMouseAndKeyInput package In-Reply-To: References: <76da0409-82ab-0df8-f44e-b073c3d70965@gmail.com> Message-ID: There is another useless dependency for AvgLvlTree inside IpHtml.pas unit. It used only for private VisitedList: TStringMap field in TIpHtmlCustomPanel and has no benefits against TStringList.Find() пн, 22 февр. 2021 г. в 11:52, Juha Manninen via lazarus < lazarus at lists.lazarus-ide.org>: > On Mon, Feb 22, 2021 at 3:29 AM Andrey Sobol via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> You excluded this code from lcore.pas >> >> procedure THelpForm.ShowApp(); >> ...... >> {$IFDEF WINDOWS} >> // Go to TOC TreeView and to get focus on foreground window >> KeyInput.Apply([ssCtrl]); >> KeyInput.Press(VK_T); >> KeyInput.UnApply([ssCtrl]); >> {$ENDIF} >> > > Oh, LazMouseAndKeyInput was just for that code. > It created a serious bug. After pressing F1 in source editor the end of > current word was cut off. > The reason was that VK_T went to Lazarus IDE, although LHelp sent it to > itself, and the default command for VK_T is "Delete to end of word". > Didn't you notice the bug? > It was discussed in Lazarus devel mailing list. It should have happened > here instead. > Something funny happens in the interprocess communication. How could key > VK_T bring LHelp to front if it went to Lazarus' source editor? > > > >> Without the code on windows system we can`t get rightly a focus lHelp >> by an event of restore the window after hide (the window is blinking on >> an aplication panel sometimes). We should send an user input sentence to >> the foregroud window from a mouse or from keyboard to get focus (that is >> windows specific problem). >> > > Yes, in Windows terminology bringing to front means blinking an icon in > Taskbar. > A Lazarus user however wants to see the help window right after pressing > F1. > > > I see some solutions of that: >> 1. To rewrite that code by WinApi (that is simple). >> 2. To exclude the package dependency on Mac system, but I don`t know how? >> > > LazMouseAndKeyInput must be fixed for MacOS Cocoa but that is a whole > different issue. > Now that problem involves only Windows. A cross-platform package is not > needed for that. > The libXtst library dependency pulled in for Linux (and UNIX) was a > 100% increase of system dependencies for a Lazarus release, and for > absolutely no benefit. > Now Lazarus BigIde depends on just libgtk2.0-dev. > > > 3. To fix the Application.BringToFront() function at windows to rightly >> bring a foreground window to a front of a display. >> > > That was my idea, too. > The method name BringToFront() is quite unambiguous. It should bring the > application to front. :) > The name is not BlinkAnIconInTaskbar(). > If you know how to fix it, please do. I don't use Windows much myself. > Does this idea go against some Windows convention? > > > But I don`t see that problem now :). May be the blinkg was also a part >> of that issue https://bugs.freepascal.org/view.php?id=38276 >> >> I redone many pieces after that, that a second round :) >> > > I removed the LazMouseAndKeyInput dependency in r64647. > Please fix the remaining issues as you see fit (without libXtst dependency > for Linux). > > > Regards, > Juha > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- *Bodrov Sergey* software development, IT consulting http://www.serbod.com *Phone (Belarus):* +375(25)794-21-58 *Skype:* sergey.bodrov1 *e-mail:* serbod at gmail.com, oxotnuk at yandex.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Tue Feb 23 11:00:03 2021 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 23 Feb 2021 11:00:03 +0100 (CET) Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, 23 Feb 2021, Juha Manninen via lazarus wrote: > Hello > > LazUtils has unit Masks with classes TMask and TMaskList. > FPC's packages/fpindexer has unit FPMasks also with classes TMask > and TMaskList. > A comment in FPMasks says "Moved here from LCL". > Revision control shows it was added 9 years ago in 2012. Since 2.5 years > ago it supports Unicode by using UTF8string for all strings. > > LCL has a related MaskEdit. It was first added in 2002 by Mattias with > comment > "added TMaskEdit from Tony" > I don't know who Tony is. > Unit Masks was first added to LCL in 2007 by tombo with comment > "LCL: implemented TMask, MatchesMask, added Masks docs" > I don't know who Tombo is either. > In 2011 Masks was moved to LazUtils by Felipe. > Masks and MaskEdit have some identical code. IMO MaskEdit should reuse > some code from Masks. > MaskEdit is maintained by Bart but he didn't know details of the history. > > Masks in LazUtils has a slow implementation. > I planned to optimize it but now I realize we may have overlapping code. > Q: Are Masks (LazUtils) and FPMasks (fpindexer) compatible? > If they are, we should dump the LazUtils Masks and use code from FPC's libs. Since it comes from Lazarus in the first place, they are supposed to be compatible, yes. If not, then the unit in FPC can be updated to add missing things. Michael. From juha.manninen62 at gmail.com Tue Feb 23 11:23:41 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Feb 2021 12:23:41 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: A related thing. I am confused with different mask classes. Embarcadero docs for TMask http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Masks.TMask says: "*Note:* Do not confuse TMask with the EditMask of a field or masked edit object. While both are used for comparing strings to a symbolic description of valid values, the special mask symbols and matching rules are completely different." Is the "*masked edit object*" the same as MaskEdit? Is the syntax really different? Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Tue Feb 23 11:56:44 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Feb 2021 12:56:44 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 12:00 PM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Since it comes from Lazarus in the first place, they are supposed to be > compatible, yes. If not, then the unit in FPC can be updated to add missing > things. > Oops, now I understand that FPMasks does not really support Unicode. Type UTF8String only converts encoding automatically when assigning values. There is no code to identify codepoints. The LazUtils Masks iterates codepoints, although in a very slow way. Has anybody tested FPMasks with multibyte-codepoints? I guess it may not work correctly. BTW, the UTF8String change is not in FPC 3.0.4 which we still must support. Even if FPC libs get new code that can be used in Lazarus, It takes many years before we can use it due to the slow release cycle. I hope FPC 3.2.2 comes out soon. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Tue Feb 23 12:48:52 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Feb 2021 13:48:52 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 12:56 PM Juha Manninen wrote: > Oops, now I understand that FPMasks does not really support Unicode. > Type UTF8String only converts encoding automatically when assigning values. > There is no code to identify codepoints. > The LazUtils Masks iterates codepoints, although in a very slow way. > Has anybody tested FPMasks with multibyte-codepoints? I guess it may not > work correctly. > I am not sure if iterating multibyte codepoints is even necessary. I must create a unit test. Does anybody have a list of use cases or some example code? The Embarcadero documentation is very plain. It is difficult to find comprehensive examples. I must confess I have not used TMask or TMaskList myself. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartjunk64 at gmail.com Tue Feb 23 13:53:46 2021 From: bartjunk64 at gmail.com (Bart) Date: Tue, 23 Feb 2021 13:53:46 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 10:41 AM Juha Manninen via lazarus wrote: > LazUtils has unit Masks with classes TMask and TMaskList. > FPC's packages/fpindexer has unit FPMasks also with classes TMask and TMaskList. MaskEdit is a LCL control and hence has nothing to do in fpc. I have in the past copied bits of TMaskEdit to a related fpc unit (cannot remeber exactly which), so that they work the same (setting and removing masks IIRC), with the exception that TMaskEdit does this on UTF-8, while the fpc unit assumes 1-byte ANSI encoding (so it won't work on UTF-8). Given the release cycle of fpc, I would strongly advise to have this code on "our side" (Lazarus), so bugs can be eliminated much faster. The Masks unit is not related to TMaskEdit. For the Masks unit: the same UTF-8 problems exist with it's fpc counterpart IIRC (did not study the code recently). So, I would like to keep it "here" as well. -- Bart From juha.manninen62 at gmail.com Tue Feb 23 15:26:59 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Feb 2021 16:26:59 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 2:54 PM Bart via lazarus < lazarus at lists.lazarus-ide.org> wrote: > MaskEdit is a LCL control and hence has nothing to do in fpc. > I am not suggesting to move MaskEdit to FPC libs obviously. I have in the past copied bits of TMaskEdit to a related fpc unit > (cannot remeber exactly which), so that they work the same (setting > and removing masks IIRC), with the exception that TMaskEdit does this > on UTF-8, while the fpc unit assumes 1-byte ANSI encoding (so it won't > work on UTF-8). > Given the release cycle of fpc, I would strongly advise to have this > code on "our side" (Lazarus), so bugs can be eliminated much faster. > > The Masks unit is not related to TMaskEdit. > Does it mean the mask syntax is different? I found this: http://docwiki.embarcadero.com/Libraries/Sydney/en/System.MaskUtils.TEditMask Is TEditMask the same as TMaskEdit? Or is TEditMask used for TMask? Can you please explain it so that I understand? Is it all documented somewhere? For the Masks unit: the same UTF-8 problems exist with it's fpc > counterpart IIRC (did not study the code recently). > So, I would like to keep it "here" as well. > Yes, I realized it must stay in LazUtils. Iterating codepoints is needed. FPMasks is good for ASCII only despite having UTF8String type. Does Michael have a plan for that unit? Fortunately I found a unit test for Masks unit under LCL tests directory. I moved it under LazUtils in r64653. I will add tests for multibyte codepoint text. Then optimizing TMask will be safe. Nothing can go wrong... :) Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Tue Feb 23 16:12:55 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Tue, 23 Feb 2021 16:12:55 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: El 23/02/2021 a las 10:41, Juha Manninen via lazarus escribió: > > Masks in LazUtils has a slow implementation. > I planned to optimize it but now I realize we may have overlapping code. > Q: Are Masks (LazUtils) and FPMasks (fpindexer) compatible? > If they are, we should dump the LazUtils Masks and use code from FPC's libs. Hello, fpMasks and Masks are quite the same from my point of view, in fact fpMasks (if my memory serves me) have various problems with UTF8 handling. I'll send you (direct mail) my TMaskAnsi, TMaskUTF8 and TMaskUnicode so you can do whatever you want with them :-) Based in RTL's encoding you can alias TMask to any of them. -- From bartjunk64 at gmail.com Tue Feb 23 18:37:03 2021 From: bartjunk64 at gmail.com (Bart) Date: Tue, 23 Feb 2021 18:37:03 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 3:27 PM Juha Manninen via lazarus wrote: > Does it mean the mask syntax is different? I found this: > http://docwiki.embarcadero.com/Libraries/Sydney/en/System.MaskUtils.TEditMask > Is TEditMask the same as TMaskEdit? Or is TEditMask used for TMask? Can you please explain it so that I understand? > Is it all documented somewhere? I have copied in the past some of the TMaskEdit logic and methods to the MaskUtils unit. Things like SplitEditMask etc. So, basically the behave the same (on 1-byte ANSI strings). The code in MaskEdit unit is the father of the code in MaskUtils. >From a Lazarus point of view, the code in MaskEdit is leading. Fpc to some extent follows what we do here. I do NOT want to use the code from MaskUtils in the MaskEdit unit, for reasons I explained in my previous code. -- Bart From juha.manninen62 at gmail.com Tue Feb 23 18:55:08 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Feb 2021 19:55:08 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 7:38 PM Bart via lazarus < lazarus at lists.lazarus-ide.org> wrote: > I have copied in the past some of the TMaskEdit logic and methods to > the MaskUtils unit. > Ok, the TEditMask thing was in MaskUtils. I didn't pay attention. How about TMask? Does it have the same syntax as TMaskEdit or are they different? Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartjunk64 at gmail.com Tue Feb 23 23:06:38 2021 From: bartjunk64 at gmail.com (Bart) Date: Tue, 23 Feb 2021 23:06:38 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Tue, Feb 23, 2021 at 6:55 PM Juha Manninen via lazarus wrote: > How about TMask? Does it have the same syntax as TMaskEdit or are they different? TMask (unit masks) deals with masks with wildcards (*,? and sets of single byte chars). It is mainly used for matching filenames (similar to the Path supplied to FindFirst). TMaskEdit gives you the possibility to constrain user input to almost anything you like, Can be used for e.g. ZIP codes, only numbers etc. It also handles pasting in the control. If the text the user enters does not match the specified mask when the control looses focus (or user presses enter) an exception is raised. In the Delphi 1,2,3 years I used it to force numeric input (integers and floats), for which we nowadays have better controls. There is a data aware counterpart as well. As you have pointed out before, the GetCodePoint function in the Masks unit needs overhoaling. (It is the same as in TMaskEdit, but that only reacts to user input with strings <=255 chars, so speed is not required there: I'ld love to see someone typing faster that the code in TMaskEdit calculates what needs to be done.) -- Bart From juha.manninen62 at gmail.com Wed Feb 24 09:11:15 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Feb 2021 10:11:15 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 12:08 AM Bart via lazarus < lazarus at lists.lazarus-ide.org> wrote: > TMask (unit masks) deals with masks with wildcards (*,? and sets of > single byte chars). > It is mainly used for matching filenames (similar to the Path supplied > to FindFirst). > > TMaskEdit gives you the possibility to constrain user input to almost > anything you like, > Can be used for e.g. ZIP codes, only numbers etc. > TMask also supports ranges and sets. See the unit test. Eg. '[a-b]', '[!a-b]', '[abc]', '[0-9]' Now I found documentation for TCustomMaskEdit.EditMask. It explains the syntax and it looks like the MaskUtils syntax. It was documented, good! I missed it earlier. I know filename wildcards and I know regular expressions. Now learning this Mask thingy... As you have pointed out before, the GetCodePoint function in the Masks > unit needs overhoaling. > It is much worse than that! Yes, GetCodePoint does its own nested loops and useless copies. But then it and other UTF8...() functions are called inside a loop, effectively causing many nested loops. The scalability is maybe O(n^3) or O(n^4). José Mejuto's Mask unit looks promising. He mentioned in a private mail (which should be public IMO, no deep secrets there) that a pattern * "*something*to*write*here*""which with current mask it takes a lot of time to be processed. If matchable string is of more than 200 chars long it could take seconds to be resolved. My classes are typically O(n)."* Many seconds in a modern computer is a lot. (It is the same as in TMaskEdit, but that only reacts to user input > with strings <=255 chars, so speed is not required there: I'ld love to > see someone typing faster that the code in TMaskEdit calculates what > needs to be done.) > True, but the code should be cleaned anyway and maybe reuse some other code. Code has aesthetic values, too. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartjunk64 at gmail.com Wed Feb 24 10:02:06 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 10:02:06 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 9:11 AM Juha Manninen via lazarus wrote: >> TMask (unit masks) deals with masks with wildcards (*,? and sets of >> single byte chars). ... > TMask also supports ranges and sets. See the unit test. > Eg. '[a-b]', '[!a-b]', '[abc]', '[0-9]' By single byte chars I meant ASCII only. You cannot have '[ä..ë]' in a TMask (a constraint that is a side effect of the implementation, but this would be sort of an undefined range as well). > Now I found documentation for TCustomMaskEdit.EditMask. It explains the syntax It is the soucecode (has been there from the beginning) and in the wiki. > and it looks like the MaskUtils syntax. Again: it's the other way around: the code of MaskUtils looks like the code of MaskEdit. >> As you have pointed out before, the GetCodePoint function in the Masks >> unit needs overhoaling. > > > It is much worse than that! > Yes, GetCodePoint does its own nested loops and useless copies. > But then it and other UTF8...() functions are called inside a loop, effectively causing many nested loops. > The scalability is maybe O(n^3) or O(n^4). > José Mejuto's Mask unit looks promising. He mentioned in a private mail (which should be public IMO, no deep secrets there) that a pattern > "*something*to*write*here*" > "which with current mask it takes a lot of time to be processed. If matchable string is of more than 200 chars long it could take seconds to be resolved. My classes are typically O(n)." > Many seconds in a modern computer is a lot. I use this Mask unit extensively for my backup program. Resolving TMaskMatches even for long strings and mask take orders of magnitude less time then accessing the file (just opening it). Of course that is NOT a reason not to improve it: O(n^4) is just terrible. Mind you, the GetCodePoint/SetCodePoint originally was just a quick (as in: simple, stupis, short code) hack to get the UTF8 functionality in MaskEdit. After changing all SomeString[i] to either GetCodePoint(SomeString,i) or SetCodePoint(SomeString,i, ACodePoint) the MaskEdit unit was UTF8 capable at once. Without a major rewrite (which increases the cange of breaking compatibility). Mind you that the first implementation of GetCodePoint was even more "simple", it simply called Utf8Copy(SomeString, i, 1)... So, yes re-implement GetCodePoint/SetCodePoint or the internal logic of the Masks unit by all means, but as far as the MaskEdit unit is concerned the function signature should not change. There is no need for a major rewrite of that unit: it deals with user input and even if you make it 100 times slower as it is now, user will not notice it. -- Bart From juha.manninen62 at gmail.com Wed Feb 24 10:31:24 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Feb 2021 11:31:24 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: I will not touch MaskEdit. Don't worry. On Wed, Feb 24, 2021 at 11:03 AM Bart via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Without a major rewrite (which increases the cange of breaking > compatibility). > José Mejuto's code is a major rewrite for Masks. It supports Unicode in masks, too. I try to make it compatible by changing some class and method names, and then run the unit tests. Comprehensive unit tests are a way to prevent breaking things. Please everybody provide more test cases. The project is in components/lazutils/test. There are no tests for MatchesWindowsMask() yet. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Wed Feb 24 11:22:09 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Wed, 24 Feb 2021 11:22:09 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: El 24/02/2021 a las 10:31, Juha Manninen via lazarus escribió: > José Mejuto's code is a major rewrite for Masks. It supports Unicode in > masks, too. > I try to make it compatible by changing some class and method names, and > then run the unit tests. Hello, In my code there is non 100% unicode compatibility when using the "CaseInsensitive" mode as as it uses lowercase mask and lowercase string to perform the test which is wrong by definition but I was unable to find a method to test codepoints case insensitive without pulling in big unicode tables. I was thinking in import the NTFS (the filesystem) case comparison tables which are 128 KB "only". > Comprehensive unit tests are a way to prevent breaking things. And also define if a compatibility break is a bug in the new code or in the old code. In example my mask supports (there is a define to disable) "[z-a]" converting it to "[a-z]" which is a compatibility break. Also there is the support (also can be disabled) for the mask "[?]" which is the counterpart for "*" but with one char position. > There are no tests for MatchesWindowsMask() yet. Who defines which are right and which are wrong ? There is no official DOS/Windows mask strategies, only inherited behaviour since CP/M. Maybe the behaviour of CMD.EXE ? Which version of CMD.EXE ? -- From bartjunk64 at gmail.com Wed Feb 24 11:47:44 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 11:47:44 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 10:02 AM Bart wrote: > Of course that is NOT a reason not to improve it: O(n^4) is just terrible. To put this discussion in a little perspective. Given a string S (UTF8 encoded) with Utf8Length=1000. GetCodePoint(S,1000) on my laptop takes 0.00439 msecs to perform. So 10 thousand of these lookups cost appr. 44 ms. This is kind of a worst case scenario. You are not very likely to have strings that long in TMask.MatchesMask (and certainly not in a MaskEdit). -- Bart From bartjunk64 at gmail.com Wed Feb 24 11:58:57 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 11:58:57 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 11:22 AM José Mejuto via lazarus wrote: > In my code there is non 100% unicode compatibility when using the > "CaseInsensitive" mode as as it uses lowercase mask and lowercase string > to perform the test which is wrong by definition Currently Masks unit does the same. > And also define if a compatibility break is a bug in the new code or in > the old code. In example my mask supports (there is a define to disable) > "[z-a]" converting it to "[a-z]" which is a compatibility break. Also > there is the support (also can be disabled) for the mask "[?]" which is > the counterpart for "*" but with one char position. Current behaviour of sets and wildcards should not be changed by default. E.g. TShellTreeView and TShellListView us the Masks unit to populate the tree/view. An option to have the behaviour you described would be OK, the TMaskOption can be extended for that. Sometimes I wish we would migrate to using UnicodeString by default. It would make life a bit easier. (And yes I know you would have to deal with composed characters (grapheme defined by more than 1 16-bit word)). > > There are no tests for MatchesWindowsMask() yet. I tested that extensively on my machine with all scenarios I could think of. But others most likely can think of scenarios I did not test. It was based on current behaviour of Windows NT platform (Win7 at the time to be precise). > Who defines which are right and which are wrong ? Well, I did ;-) (Nobody else bothered at the time, and nobody complained either.) -- Bart From joshyfun at gmail.com Wed Feb 24 12:05:27 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Wed, 24 Feb 2021 12:05:27 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> El 24/02/2021 a las 11:47, Bart via lazarus escribió: > On Wed, Feb 24, 2021 at 10:02 AM Bart wrote: > >> Of course that is NOT a reason not to improve it: O(n^4) is just terrible. > > To put this discussion in a little perspective. > Given a string S (UTF8 encoded) with Utf8Length=1000. > GetCodePoint(S,1000) on my laptop takes 0.00439 msecs to perform. > So 10 thousand of these lookups cost appr. 44 ms. > This is kind of a worst case scenario. > You are not very likely to have strings that long in TMask.MatchesMask > (and certainly not in a MaskEdit). Hello, The worst case scenario is not based in GetCodePoint time, is in the TMask logic when "*" is found, it enters in recursive scan from that point, if it founds a new "*" it recurses again and if it finally fails in comparison it rolls back to the first "*". So specially crafted masks makes it recurse a lot. String:='This is a test string'; Mask:='*T*h*s*n*x'; Of course this is not a day by day use ;-) Note: Just to put in context, my "explore" in the TMask world started when writing my NTFS filesystem reader, when all file names are read (400,000) I can search for them using masks. When compiled in fpc (Lazarus) the "*.txx" search takes 1-2 seconds (not measured) and when compiled with Delphi it takes +/- 0.3 seconds, so I stated to write my own TMask. -- From nc-gaertnma at netcologne.de Wed Feb 24 12:09:59 2021 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Wed, 24 Feb 2021 12:09:59 +0100 Subject: [Lazarus] Lazarus Release 2.0.12 Message-ID: <20210224120959.258c79ac@limapholos.matflo.wg> The Lazarus team is glad to announce the release of Lazarus 2.0.12. This release was built with FPC 3.2.0. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_3.2.0 Windows users should be careful with -O3 or higher optimization, due to bug https://bugs.freepascal.org/view.php?id=37305. Here is the list of fixes for Lazarus 2.0.x: http://wiki.freepascal.org/Lazarus_2.0_fixes_branch The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the "Lazarus 2.0.12" directory. Checksums for the SourceForge files: http://www.lazarus-ide.org/index.php?page=checksums#2_0_12 Minimum requirements: Windows: 2k, XP, Vista, 7, 8, 8.1 and 10, 32 or 64bit. FreeBSD/Linux: gtk 2.8 for gtk2, qt4.5 for qt, qt5.6 for qt5, 32 or 64bit. Mac OS X: Cocoa (64bit) 10.12 to 10.15, Carbon (32bit) 10.5 to 10.14, qt and qt5 (32 or 64bit). The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_2_0_12 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://ftp.freepascal.org/pub/lazarus/releases/ Mattias From juha.manninen62 at gmail.com Wed Feb 24 12:11:23 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Feb 2021 13:11:23 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 1:00 PM Bart via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > > There are no tests for MatchesWindowsMask() yet. > I tested that extensively on my machine with all scenarios I could think > of. > Please add your tests to the project I mentioned. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Wed Feb 24 12:28:16 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Wed, 24 Feb 2021 12:28:16 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: <7f67781a-d956-9c7c-f2ea-b73f7763a3c3@gmail.com> El 24/02/2021 a las 11:58, Bart via lazarus escribió: Hello, >> In my code there is non 100% unicode compatibility when using the >> "CaseInsensitive" mode as as it uses lowercase mask and lowercase string >> to perform the test which is wrong by definition > > Currently Masks unit does the same. Yes, but in example in my case I can not success test mask "ä*" vs string "Ä*" because "Ä" is not lowercased to "ä" (Windows 7). > Sometimes I wish we would migrate to using UnicodeString by default. > It would make life a bit easier. > (And yes I know you would have to deal with composed characters > (grapheme defined by more than 1 16-bit word)). That's a can of worms! UTF8 forces you to write "correct code" (at least try it) for any character >127, with UnicodeString you get the false apparence that everything magically works until everything cracks when a string with surrogate pairs come in play :-) and ALL you text handling must be rewritten, and most of them completly rewritten. >>> There are no tests for MatchesWindowsMask() yet. > I tested that extensively on my machine with all scenarios I could think of. > But others most likely can think of scenarios I did not test. > It was based on current behaviour of Windows NT platform (Win7 at the > time to be precise). >> Who defines which are right and which are wrong ? > Well, I did ;-) > (Nobody else bothered at the time, and nobody complained either.) And mostly will not as almost everything matches the expected behaviour for an user, like typical "*.txt" but there are some non supported cases like: Filename:='test.txt' Mask:='test??.txt?' Match must be true This is the doc from my code about Windows matching, Quirks can be enabled or disabled for compatibility: ----------------8<----------------------------8<--------------------- Windows mask works in a different mode than regular mask, it has too many quirks and corner cases inherited from CP/M, then adapted to DOS (8.3) filenames and adapted again for long file names. Anyth?ng.abc = "?" matches exactly 1 char Anyth*ng.abc = "*" matches 0 or more of chars ------- Quirks ------- --eWindowsQuirk_AnyExtension Anything*.* = ".*" is removed. --eWindowsQuirk_FilenameEnd Anything??.abc = "?" matches 1 or 0 chars (except '.') (Not the same as "Anything*.abc", but the same as regex "Anything.{0,2}\.abc") Internally converted to "Anything[??].abc" --eWindowsQuirk_Extension3More Anything.abc = Matches "Anything.abc" but also "Anything.abc*" (3 char extension) Anything.ab = Matches "Anything.ab" and never "anything.abcd" --eWindowsQuirk_EmptyIsAny "" = Empty string matches anything "*" --eWindowsQuirk_AllByExtension (Not in use anymore) .abc = Runs as "*.abc" --eWindowsQuirk_NoExtension Anything*. = Matches "Anything*" without extension ----------------8<----------------------------8<--------------------- -- From juha.manninen62 at gmail.com Wed Feb 24 13:31:17 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Feb 2021 14:31:17 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 12:22 PM José Mejuto via lazarus < lazarus at lists.lazarus-ide.org> wrote: > In my code there is non 100% unicode compatibility when using the > "CaseInsensitive" mode as as it uses lowercase mask and lowercase string > to perform the test which is wrong by definition but I was unable to > find a method to test codepoints case insensitive without pulling in big > unicode tables. > > I was thinking in import the NTFS (the filesystem) case comparison > tables which are 128 KB "only". > That is not necessary. LazUTF8 has functions like UTF8CompareText(), UTF8CompareTextP() and the latest UTF8CompareLatinTextFast(). UTF8CompareLatinTextFast supports full Unicode but is optimized for mostly Latin text. We should add a PChar version UTF8CompareLatinTextFastP() and use it in your mask code. > Comprehensive unit tests are a way to prevent breaking things. > > And also define if a compatibility break is a bug in the new code or in > the old code. In example my mask supports (there is a define to disable) > "[z-a]" converting it to "[a-z]" which is a compatibility break. Your code does not compile when RANGES_AUTOREVERSE is not defined. cMask is not found. The reverse logic can be enabled by default. It does not break anybody's masks as I understand it. Earlier it was an error, now it does something sensible. Also there is the support (also can be disabled) for the mask "[?]" > which is the counterpart for "*" but with one char position. > Where did you get this "[?]" syntax? There must be a reference documentation somewhere but I have not seen it. What is the difference between "?" and "[?]" ? On Wed, Feb 24, 2021 at 1:28 PM José Mejuto via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > Sometimes I wish we would migrate to using UnicodeString by default. > > It would make life a bit easier. > > (And yes I know you would have to deal with composed characters > > (grapheme defined by more than 1 16-bit word)). > > That's a can of worms! UTF8 forces you to write "correct code" (at least > try it) for any character >127, with UnicodeString you get the false > apparence that everything magically works until everything cracks when a > string with surrogate pairs come in play :-) and ALL you text handling > must be rewritten, and most of them completly rewritten. > Exactly. UnicodeString uses UTF-16 which is also a variable length encoding. The same rules should be applied but often they are not. There is plenty of sloppy UTF-16 code out there. Writing proper code UTF-8 is not difficult once you wrap your mind around the concept. There is a learning curve, true. I also scratched my head for some time when studying it. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Wed Feb 24 14:22:17 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Wed, 24 Feb 2021 14:22:17 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: <81a21dc2-9fef-41eb-5198-528a0efffc69@gmail.com> El 24/02/2021 a las 13:31, Juha Manninen via lazarus escribió: Hello, > I was thinking in import the NTFS (the filesystem) case comparison > tables which are 128 KB "only". > That is not necessary. > LazUTF8 has functions like UTF8CompareText(), UTF8CompareTextP() and the The code was originally designed to be fpc only, not Lazarus libs (even when compatibles with console apps). > Your code does not compile when RANGES_AUTOREVERSE is not defined. > cMask is not found. > The reverse logic can be enabled by default. It does not break anybody's > masks as I understand it. Earlier it was an error, now it does something > sensible. Probably cMask falls by error inside one $IFDEF, I'll check but must be a trivial error. > Also there is the support (also can be disabled) for the mask "[?]" > which is the counterpart for "*" but with one char position. > Where did you get this "[?]" syntax? There must be a reference > documentation somewhere but I have not seen it. > What is the difference between "?" and "[?]" ? Wildcards except "*" and "?" do not have any kind of standard reference, some use "[]" others "{}", some negate with "!", others with "^", some ranges using "-" others "<", there is a jungle of widcards. In the develop of the Windows matching I found that there is no option for zero or one char which is needed in the Windows matching, so started to googling about and find some that uses the "?" inside brackets to notate the zero or one and it is compatible with the idea of ranges and charsets, so used it. The difference is: ? = 1 char [?] = 1 or 0 chars. ?? = 2 chars [??] = 0,1 or 2 chars In the DOS/Windows world (behaviour, not syntax) it is used like: -------------------------- File name: "test.txta" DOS mask: "test.txt?" Match: True File name: "test.txt" DOS mask: "test.txt?" Match: True -------------------------- Also in the code I have added the escape character "\" (also selectable use or not) to allow string matching of stars, question mark, brackets, etc. characters. As other wildcards there is no standard character and/or behaviour. Have a nice day. -- From juha.manninen62 at gmail.com Wed Feb 24 14:47:48 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Feb 2021 15:47:48 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: MaskList is used in TCustomShellTreeView.GetFilesInDir(). It sets a mask option *moDisableSets*. Why are sets disabled? Is it to stay compatible with FindFirstUTF8() syntax? I don't fully understand the comment. Why would EConvertError be raised? //Disable the use of sets in the masklist. //this behaviour would be incompatible with the situation if no MaskList was used //and it would break backwards compatibilty and could raise unexpected EConvertError where it did not in the past. //If you need sets in the MaskList, use the OnAddItem event for that. (BB) MaskOptions := [moDisableSets]; {$ifdef NotLiteralFilenames} if (ACaseSensitivity = mcsCaseSensitive) then MaskOptions := [moDisableSets, moCaseSensitive]; {$else} if (ACaseSensitivity <> mcsCaseInsensitive) then MaskOptions := [moDisableSets, moCaseSensitive]; {$endif} MaskList := TMaskList.Create(MaskStr, ';', MaskOptions); //False by default Anyway I don't see why a useful Mask syntax should be disabled. Can this be solved by other means? Can José's mask do a similar thing? Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartjunk64 at gmail.com Wed Feb 24 20:29:55 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 20:29:55 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: Message-ID: On Wed, Feb 24, 2021 at 12:11 PM Juha Manninen via lazarus wrote: >> I tested that extensively on my machine with all scenarios I could think of. > Please add your tests to the project I mentioned. I did that when writing the code. I never saved the tested masks I used anywhere AFAIK. The comments in the code state what scenario's I have come up with. The scenarios described were made to behave like the dir command of windows. -- Bart From juha.manninen62 at gmail.com Wed Feb 24 21:53:43 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Feb 2021 22:53:43 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> Message-ID: On Wed, Feb 24, 2021 at 1:05 PM José Mejuto via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Note: Just to put in context, my "explore" in the TMask world started > when writing my NTFS filesystem reader, when all file names are read > (400,000) I can search for them using masks. When compiled in fpc > (Lazarus) the "*.txx" search takes 1-2 seconds (not measured) and when > compiled with Delphi it takes +/- 0.3 seconds, so I stated to write my > own TMask. > I am interested in how well your TMask version compares with Delphi's version. Does it match the speed or even surpass it? Anyway this unit looks very promising! It works with Unicode as advertised. It passes all cases in the updated unit test. Our current implementation fails miserably. See components/lazutils/test/testmasks.lpi For example this TestMask('ö', '[!☺-☂]', True); means that 'ö' is not between a happy face and an umbrella. Case-insensitive matching of Unicode can be fixed later with functions found in LazUTF8. With José's approval the license will be LGPL with a linking exception. It will be part of the LazUtils package. Author's name will be mentioned of course. Is that OK? I will not copy the whole original unit but use the UTF-8 parts + rename and tweak some things. Regards Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartjunk64 at gmail.com Wed Feb 24 22:22:52 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 22:22:52 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: <7f67781a-d956-9c7c-f2ea-b73f7763a3c3@gmail.com> References: <7f67781a-d956-9c7c-f2ea-b73f7763a3c3@gmail.com> Message-ID: On Wed, Feb 24, 2021 at 12:28 PM José Mejuto via lazarus wrote: > Filename:='test.txt' > Mask:='test??.txt?' > Match must be true That sucks big time. ? is supposed to match exactly 1 character (non-optional). Bloody #$%$#!! M$uck. -- Bart From bartjunk64 at gmail.com Wed Feb 24 22:26:11 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 22:26:11 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> Message-ID: On Wed, Feb 24, 2021 at 9:54 PM Juha Manninen via lazarus wrote: > I am interested in how well your TMask version compares with Delphi's version. > Does it match the speed or even surpass it? > > Anyway this unit looks very promising! > It works with Unicode as advertised. It passes all cases in the updated unit test. Our current implementation fails miserably. IIRC then fpc has some wildcard matching code in one of it's *nix units. At least it used to have it. -- Bart From bartjunk64 at gmail.com Wed Feb 24 22:36:57 2021 From: bartjunk64 at gmail.com (Bart) Date: Wed, 24 Feb 2021 22:36:57 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: <7f67781a-d956-9c7c-f2ea-b73f7763a3c3@gmail.com> References: <7f67781a-d956-9c7c-f2ea-b73f7763a3c3@gmail.com> Message-ID: On Wed, Feb 24, 2021 at 12:28 PM José Mejuto via lazarus wrote: > Filename:='test.txt' > Mask:='test??.txt?' > Match must be true That sucks big time. A ? is supposed to match EXACTLY 1 character (not optional). Bloody @#$%$#@#$ Micro$uck, -- Bart From lazarus at mfriebe.de Thu Feb 25 00:55:57 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 25 Feb 2021 00:55:57 +0100 Subject: [Lazarus] Attn Marc: snv up please [[Re: Lazarus Release 2.0.12]] In-Reply-To: <20210224120959.258c79ac@limapholos.matflo.wg> References: <20210224120959.258c79ac@limapholos.matflo.wg> Message-ID: <24a657e1-4c63-c4ce-85c8-67da4cc34c71@mfriebe.de> On 24/02/2021 12:09, Mattias Gaertner via lazarus wrote: > The Lazarus team is glad to announce the release of Lazarus 2.0.12. > Hi Marc, please svn up the web. Thanks From lazarus at kluug.net Thu Feb 25 04:36:40 2021 From: lazarus at kluug.net (Ondrej Pokorny) Date: Thu, 25 Feb 2021 04:36:40 +0100 Subject: [Lazarus] Lazarus Release 2.0.12 In-Reply-To: <20210224120959.258c79ac@limapholos.matflo.wg> References: <20210224120959.258c79ac@limapholos.matflo.wg> Message-ID: <0dd79d52-7adf-02aa-b571-c66e8a7410c0@kluug.net> On 24.02.2021 12:09, Mattias Gaertner via lazarus wrote: > The Lazarus team is glad to announce the release of Lazarus 2.0.12. Thank you all for your work! Ondrej From joshyfun at gmail.com Thu Feb 25 09:27:36 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Thu, 25 Feb 2021 09:27:36 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7f67781a-d956-9c7c-f2ea-b73f7763a3c3@gmail.com> Message-ID: <13c3f4d9-911f-6e79-ee14-25dfc70f2a08@gmail.com> El 24/02/2021 a las 22:36, Bart via lazarus escribió: >> Filename:='test.txt' >> Mask:='test??.txt?' >> Match must be true > That sucks big time. > A ? is supposed to match EXACTLY 1 character (not optional). > Bloody @#$%$#@#$ Micro$uck, X-D This quirk has its explanation which is 8.3 backwards compatibility. The old 8.3 masking (well the system itself) resolves masks setting the name and extension in a 11 bytes array where space is a "no-char", so file name "TEST.TXT" is stored as "TEXT " and "TXT" and if you apply this mask "TEST????.TXT" its logical that it evaluates to a positive match. I'm quite sure that this comes from CP/M times. Have a nice day. -- From joshyfun at gmail.com Thu Feb 25 09:46:35 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Thu, 25 Feb 2021 09:46:35 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> Message-ID: <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> El 24/02/2021 a las 21:53, Juha Manninen via lazarus escribió: Hello, > I am interested in how well your TMask version compares with Delphi's > version. > Does it match the speed or even surpass it? Not tested because in my code strings are allways UTF8 stored so for Delphi comparison I must convert them to Unicode before. I'll try to perform a simple benchmark. > Case-insensitive matching of Unicode can be fixed later with functions > found in LazUTF8. As this code is not a priority I think its better to make it work with Lazutf8 functions before the first commit. The problem is the support for sametext in UnicodeString. > With José's approval the license will be LGPL with a linking exception. > It will be part of the LazUtils package. Author's name will be mentioned > of course. > Is that OK? Yes, of course. Put the name if it is used for a reference, otherwise put standard headers. > I will not copy the whole original unit but use the UTF-8 parts + rename > and tweak some things. In fact I think that the whole unit is needed. It has (info for other readers) 3 classes TMaskUTF8, TMaskAnsi and TMaskUnicode, maybe TMaskAnsi can be omitted but UTF8 and Unicode should be present. Many times TMask is used over zillions of strings, converting Unicode to UTF8 (for UnicodeStrings and WideStrings) is time consuming, much more than the masking itself in most cases. I suggest to keep the 3 classes and create a new TMask one which mimic the behaviour of current TMask, disabling the masking extensions (escape char, [?],...) which is very simple as you only need to subclass the Create method, mask compilation happens at first use time, not at creation time. This way current code using TMask will behave 99.9% identical, but an user that needs to mask other strings can use TMaskUnicode, in example, and activate or deactivate other extensions. -- From juha.manninen62 at gmail.com Thu Feb 25 10:39:55 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 25 Feb 2021 11:39:55 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> Message-ID: On Thu, Feb 25, 2021 at 10:47 AM José Mejuto via lazarus < lazarus at lists.lazarus-ide.org> wrote: > In fact I think that the whole unit is needed. It has (info for other > readers) 3 classes TMaskUTF8, TMaskAnsi and TMaskUnicode, maybe > TMaskAnsi can be omitted but UTF8 and Unicode should be present. Many > times TMask is used over zillions of strings, converting Unicode to UTF8 > (for UnicodeStrings and WideStrings) is time consuming, much more than > the masking itself in most cases. > UTF8 is also Unicode, one of its encodings. The name UnicodeString is misleading. It should be UTF16String. Please remember our Unicode solution uses UTF-8. It is done by changing the default encoding of AnsiString and triggered by the same LazUTF8 unit that is used by Masks unit. Everything is UTF-8. I suggest to keep the 3 classes and create a new TMask one which mimic > the behaviour of current TMask, disabling the masking extensions (escape > char, [?],...) which is very simple as you only need to subclass the > Create method, mask compilation happens at first use time, not at > creation time. > I can include the TMaskUnicode class there if you want, although its name is also misleading. TMaskAnsi must be left out. It has no use with our Unicode solution. TMaskUTF8 I have renamed to TMask in my tests. It replaces the current TMask which supports Unicode only partially. I could make an alias type TMask = class(TMaskUTF8) but why should I? Basically every String in our Unicode system has UTF-8 encoding. No need to have a special mask class for UTF-8. This way current code using TMask will behave 99.9% identical, but an > user that needs to mask other strings can use TMaskUnicode, in example, > and activate or deactivate other extensions. > Where do the other strings come from? Anyway TMaskUnicode can be included, no problem. I am not sure we want a new TMask to behave 99.9% identical with the current one. The new one has some clear improvements. Interestingly there does not seem to be any standard for the mask syntax. So we cannot be compliant to any "standard". Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Thu Feb 25 11:44:29 2021 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Thu, 25 Feb 2021 11:44:29 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> Message-ID: <76bbc05e-ebc8-d297-8a27-67600bcf608e@gmail.com> El 25/02/2021 a las 10:39, Juha Manninen via lazarus escribió: Hello, > UTF8 is also Unicode, one of its encodings. > The name UnicodeString is misleading. It should be UTF16String. > Please remember our Unicode solution uses UTF-8. It is done by changing > the default encoding of AnsiString and triggered by the same LazUTF8 > unit that is used by Masks unit. Everything is UTF-8. Yes, Unicode is a very, very bad name. I've developed the code with fpc in mind, not Lazarus, that's the reason of the three versions. From the point of view of Lazarus, UTF8 is enough. > This way current code using TMask will behave 99.9% identical, but an > user that needs to mask other strings can use TMaskUnicode, in example, > and activate or deactivate other extensions. > > Where do the other strings come from? Anyway TMaskUnicode can be > included, no problem. > I am not sure we want a new TMask to behave 99.9% identical with the > current one. The new one has some clear improvements. > Interestingly there does not seem to be any standard for the mask > syntax. So we cannot be compliant to any "standard". Backwards compatibility, in special the escape character which can be used in old masks like: "C:\*.*". The other functions can be kept active, but escape char could be a compatibility problem. Anyway, revisiting code I've found a bug in the escape character in char groups, which simply are ignored. It has been fixed in UTF8 version, I'm now porting to UTF16 and Ansi and I'll send you the updated version. Also fixed the "[!]" mask to raise an exception and the "RANGES_AUTOREVERSE" (was a variable rename from "cMask" to "lMask" which was missed in the IFDEF). Have a nice day. -- From juha.manninen62 at gmail.com Thu Feb 25 15:21:50 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 25 Feb 2021 16:21:50 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: <76bbc05e-ebc8-d297-8a27-67600bcf608e@gmail.com> References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> <76bbc05e-ebc8-d297-8a27-67600bcf608e@gmail.com> Message-ID: On Thu, Feb 25, 2021 at 12:44 PM José Mejuto via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Backwards compatibility, in special the escape character which can be > used in old masks like: "C:\*.*". The other functions can be kept > active, but escape char could be a compatibility problem. > Ok, true. Escaping special characters would be very handy. A pity. I kept the name TMaskUTF8 after all and inherited TMask from it. It helps synchronise changes between our versions, among other things. Now I need instructions or a piece of code into TMask constructor to make it ~ backwards compatible. Later we can see if the advanced features can be used. I will look at the case-insensitive match of Unicode next... Anyway, revisiting code I've found a bug in the escape character in char > groups, which simply are ignored. It has been fixed in UTF8 version, I'm > now porting to UTF16 and Ansi and I'll send you the updated version. > Also fixed the "[!]" mask to raise an exception and the > "RANGES_AUTOREVERSE" (was a variable rename from "cMask" to "lMask" > which was missed in the IFDEF). > I renamed "cMask" to "lMask" here. Earlier I made other changes. I renamed UTF8Length to UTF8CodepointSizeFast. LazUTF8 has that function for the purpose (and UTF8CodepointSize). Then I used the LazUTF8 version. UTF8Length in LazUTF8 means the number of codepoints in a whole string. I also changed PByte to PChar because of that function change. It seems to compile everywhere. An exception from "[!]" mask would be good, yes. It is clearly an error from a user. The current TMask also complains about it. Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Fri Feb 26 16:58:15 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 26 Feb 2021 16:58:15 +0100 Subject: [Lazarus] Lazarus GUI on Ubuntu Mate 20.04 using black dropdown, how to change? Message-ID: I needed to use Lazarus on my Ubuntu Mate laptop, which recently got upgraded from 18.04 to 20,04. I have several versions of Lazarus (2.0.6, 2.0.8, 2.0.10) but they seem all to behave the same... My grief is: 1) I do not like these black window headers with text in dark gray making it hard to read the captions. 2) But worst, the dropdown boxes in the Object inspector where one is supposed to select from a number of property options only show as a solid black rectangle when used! If I move across with the mouse I can view the text of the options, but only one at a time! This is a terrible behaviour! Is there any way to change it? If so how? I am not often using the Ubuntu desktop since I use my Linux machines remotely via ssh for the most part. But programming that way is hard so I tried to use Lazarus, and I am pretty sure it was OK before the recent update of Ubuntu... Can someone savvy with Ubuntu please advice how to fix this? -- Bo Berglund Developer in Sweden From bartjunk64 at gmail.com Fri Feb 26 19:15:37 2021 From: bartjunk64 at gmail.com (Bart) Date: Fri, 26 Feb 2021 19:15:37 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> <76bbc05e-ebc8-d297-8a27-67600bcf608e@gmail.com> Message-ID: On Thu, Feb 25, 2021 at 3:22 PM Juha Manninen via lazarus wrote: TMask.MatchesWindowsMask now raises an exception. Seriously?? This is INSANE. Bart From bartjunk64 at gmail.com Fri Feb 26 21:22:48 2021 From: bartjunk64 at gmail.com (Bart) Date: Fri, 26 Feb 2021 21:22:48 +0100 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> <76bbc05e-ebc8-d297-8a27-67600bcf608e@gmail.com> Message-ID: On Fri, Feb 26, 2021 at 7:15 PM Bart wrote: > TMask.MatchesWindowsMask now raises an exception. > Seriously?? > This is INSANE. Let me explain. My backup and some related programs still compile, but instatly raise an exception when they start to perform their main task. Thank you very much. The normal way of doing this is: Deprecate the function in question, but d NOT kill it's functionality. Add a useful deprecated message. Remove the function in the next major release (deprecate in 2.1, and so 2.2, only remove in 2.3, si't be gone in 2.4). Simply removing functionality like you have done now will alienate users from Lazarus, since apparently "we" cannot be trusted. Juha: you seem to be obsessed with speeding up string handling code. This is not really a problem as long as you are not deaf to arguments against your changes. You introduce new bugs, remove old features, all for the sake of speed. All that when, in my perception, this code is mostly used in conjunction with file IO, which is orders of magnitude slower than even slopy string handling. -- Bart From juha.manninen62 at gmail.com Sat Feb 27 10:32:28 2021 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sat, 27 Feb 2021 11:32:28 +0200 Subject: [Lazarus] unit Masks vs. unit FPMasks In-Reply-To: References: <7cd77c4a-0682-5039-a191-2b5d5ee5adfd@gmail.com> <33060b0c-e880-eaf1-01c5-d59624484b56@gmail.com> <76bbc05e-ebc8-d297-8a27-67600bcf608e@gmail.com> Message-ID: On Fri, Feb 26, 2021 at 10:24 PM Bart via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On Fri, Feb 26, 2021 at 7:15 PM Bart wrote: > My backup and some related programs still compile, but instatly raise > an exception when they start to perform their main task. > Thank you very much. > > The normal way of doing this is: > Deprecate the function in question, but d NOT kill it's functionality. > Add a useful deprecated message. > Remove the function in the next major release (deprecate in 2.1, and > so 2.2, only remove in 2.3, si't be gone in 2.4). > Simply removing functionality like you have done now will alienate > users from Lazarus, since apparently "we" cannot be trusted. > > Juha: you seem to be obsessed with speeding up string handling code. > This is not really a problem as long as you are not deaf to arguments > against your changes. > You introduce new bugs, remove old features, all for the sake of speed. > All that when, in my perception, this code is mostly used in > conjunction with file IO, which is orders of magnitude slower than > even slopy string handling. > True, it created more conflicts than I anticipated. I reverted the new TMask in r64675. It must be worked later in trunk. Now a 2.2 fork will happen in few weeks. Sorry for the hassle. José and others. you can see my adaptation of your code in Lazarus trunk just before the revert, eg. r64674. I also attach the unit here. I fixed the case-insensitive Unicode match by simply replacing LowerCase() with UTF8LowerCase(). It is a well optimized function. First I planned to use UTF8CompareLatinTextFast() but it did not fit here. There is a unit test project in components/lazutils/test/. The code passes all tests there! Unicode is fully supported also in mask ranges. Let's continue the integration later. Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: masks_José.pas Type: text/x-pascal Size: 39836 bytes Desc: not available URL: From bo.berglund at gmail.com Sat Feb 27 13:22:09 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 27 Feb 2021 13:22:09 +0100 Subject: [Lazarus] Does fsStayOnTop not work for forms on Linux? Message-ID: Is this property just a Windows feature? I am trying to make a tool to locate a section on screen by adjusting the form size and reading left, top, width, height of the form. But as soon as I click the underlying application my form disappears even though it is set to stay on top. Is this a problem with Ubuntu Mate 20.04? Is there a way to make the form internal transparent so that one can see the underlying area while adjusting? I can do this on Windows but via calls to Windows API:s... -- Bo Berglund Developer in Sweden