From pak.lebah at yahoo.com Fri Oct 2 05:54:46 2020 From: pak.lebah at yahoo.com (Mr Bee) Date: Fri, 2 Oct 2020 03:54:46 +0000 (UTC) Subject: [Lazarus] Font ligatures support References: <54009597.989770.1601610886473.ref@mail.yahoo.com> Message-ID: <54009597.989770.1601610886473@mail.yahoo.com> Hi, It seems Lazarus’ source editor still doesn’t support font ligatures. I’d love to use them in Lazarus to increase the code readability as I’ve used them in many other code editors (using other languages too).  Some popular fonts for that are Fira Code and JetBrains Mono. I’ve tried both of them with Lazarus editor but the ligatures don’t work. Is there any plan to support font ligatures in the near future? Or is there any special setting to enable it? Thank you. Best regards, ~Bee -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Fri Oct 2 15:19:56 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 2 Oct 2020 15:19:56 +0200 Subject: [Lazarus] Font ligatures support In-Reply-To: <54009597.989770.1601610886473@mail.yahoo.com> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> Message-ID: <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> On 02/10/2020 05:54, Mr Bee via lazarus wrote: > Hi, > > It seems Lazarus’ source editor still doesn’t support font ligatures. > I’d love to use them in Lazarus to increase the code readability as > I’ve used them in many other code editors (using other languages too). > > Some popular fonts for that are Fira Code and JetBrains Mono. I’ve > tried both of them with Lazarus editor but the ligatures don’t work. > > Is there any plan to support font ligatures in the near future? Or is > there any special setting to enable it? > Are they strictly monospaced? Are the chars IimXW and @ all the same width? (@ often is wider) If any of those chars returns a different width, the SynEdit enforces the width, by calling ExTextOut with an "ETO" array. And that leads to each char painted on its own. You can find the function "NeedETO" and set it to hardcoded False. That will prevent the enforcements (except in right to left scripts). But it will have side effects. SynEdit will place the caret, as if every char was exactly n pixel wide. And if text color changes, the text is continued according to the calculated width. So if you select/deselect text, it will start moving a few pixel. To get all this really working, SynEdit would need to use an entirely different Text API. It would need to know the width of each char, as it is drawn in context. (That is measuring a char of its own is no help, because the char may change width depending on the chars next to it.) From pak.lebah at yahoo.com Fri Oct 2 16:27:25 2020 From: pak.lebah at yahoo.com (Mr Bee) Date: Fri, 2 Oct 2020 14:27:25 +0000 (UTC) Subject: [Lazarus] Font ligatures support In-Reply-To: <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> Message-ID: <1522105214.1112569.1601648845204@mail.yahoo.com> Pada Jumat, 2 Oktober 2020 20.20.09 WIB, Martin Frb via lazarus menulis: > Are they strictly monospaced? AFAIK they are as long as you use monospaced font such as Fira Code or JetBrains Mono. > You can find the function "NeedETO" and set it to hardcoded False. That > will prevent the enforcements (except in right to left scripts). Where can I find that function? Is it within Lazarus IDE code or in SynEdit code?Pascal code is always written left to right, isn’t it? > But it will have side effects. SynEdit will place the caret, as if every > char was exactly n pixel wide. It shouldn’t be a problem with monospaced font, I suppose. I will try it and see what happen. Thank you. Best regards, ~Bee -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascaldragon at googlemail.com Fri Oct 2 22:48:12 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Fri, 2 Oct 2020 22:48:12 +0200 Subject: [Lazarus] Font ligatures support In-Reply-To: <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> Message-ID: <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> Am 02.10.2020 um 15:19 schrieb Martin Frb via lazarus: > On 02/10/2020 05:54, Mr Bee via lazarus wrote: >> Hi, >> >> It seems Lazarus’ source editor still doesn’t support font ligatures. >> I’d love to use them in Lazarus to increase the code readability as >> I’ve used them in many other code editors (using other languages too). >> >> Some popular fonts for that are Fira Code and JetBrains Mono. I’ve >> tried both of them with Lazarus editor but the ligatures don’t work. >> >> Is there any plan to support font ligatures in the near future? Or is >> there any special setting to enable it? >> > > Are they strictly monospaced? Is there something that needs to be enabled to get ligatures working on Windows? I'm using Microsoft's Cascadia Code for example in VS 2019 where ligatures work correctly, but in Lazarus nothing happens. The ligatures have the same widths as the equal N characters (so the ligature for <> has the same width as both characters together). Regards, Sven From aaa5500 at ya.ru Sat Oct 3 12:03:26 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sat, 3 Oct 2020 13:03:26 +0300 Subject: [Lazarus] Font ligatures support In-Reply-To: <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> Message-ID: <5fdb5aac-f070-7965-50ff-b3a605b41451@ya.ru> On 02.10.2020 23:48, Sven Barth via lazarus wrote: > Is there something that needs to be enabled to get ligatures working > on Windows? You need to use one of APIs which support it (afair, DrawTextW?) and output whole ligature, not char-by-char. -- Regards, Alexey From juha.manninen62 at gmail.com Sat Oct 3 12:26:00 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sat, 3 Oct 2020 13:26:00 +0300 Subject: [Lazarus] GUI for package dependency properties in Project Inspector Message-ID: FYI In Lazarus trunk I implemented a GUI pane in Project Inspector, similar to what Package Editor has. Now only package dependencies have properties with GUI, the project member files have not. The GUI controls and some code are reused. Please test. Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Sat Oct 3 12:51:10 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sat, 3 Oct 2020 13:51:10 +0300 Subject: [Lazarus] GUI for package dependency properties in Project Inspector In-Reply-To: References: Message-ID: Package dependencies = Required Packages node in the Project Inspector. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Sat Oct 3 16:08:39 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 3 Oct 2020 16:08:39 +0200 Subject: [Lazarus] Font ligatures support In-Reply-To: <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> Message-ID: On 02/10/2020 22:48, Sven Barth via lazarus wrote: > >> Are they strictly monospaced? > > Is there something that needs to be enabled to get ligatures working > on Windows? I'm using Microsoft's Cascadia Code for example in VS 2019 > where ligatures work correctly, but in Lazarus nothing happens. The > ligatures have the same widths as the equal N characters (so the > ligature for <> has the same width as both characters together). If you use the following to output on a plain canvas procedure TForm1.FormPaint(Sender: TObject); var   r: TRect;   s: String; begin   r.Top := 0;   r.Left := 0;   r.Bottom := 50;   r.Right := 50;   s := 'abcdef';   LCLIntf.ExtUTF8Out(Canvas.Handle, 10, 10, ETO_OPAQUE+ETO_CLIPPED, @r, @s[1], 5, nil) end; Do you get the ligature? From lazarus at mfriebe.de Sat Oct 3 16:24:03 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 3 Oct 2020 16:24:03 +0200 Subject: [Lazarus] Font ligatures support In-Reply-To: <5fdb5aac-f070-7965-50ff-b3a605b41451@ya.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <5fdb5aac-f070-7965-50ff-b3a605b41451@ya.ru> Message-ID: On 03/10/2020 12:03, Alexey Tor. via lazarus wrote: > On 02.10.2020 23:48, Sven Barth via lazarus wrote: >> Is there something that needs to be enabled to get ligatures working >> on Windows? > > You need to use one of APIs which support it (afair, DrawTextW?) and > output whole ligature, not char-by-char. > SynEdit currently uses ExtTextOutW I don't know if that is good enough. Nor how different it is compared to DrawTextW. If replaced, the new function must be supported by all widgetsets. Also, what ever function is used must currently support an "ETO" array. That is for each char outputted, a width in Pixel can be given. That is for example needed - to enforce same width for Arabic text chars - unicode chars of ambiguous width - for fonts that are not strictly monospaced From aaa5500 at ya.ru Sat Oct 3 16:34:14 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sat, 3 Oct 2020 17:34:14 +0300 Subject: [Lazarus] Font ligatures support In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> Message-ID: <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> It's not very simple. see file https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_canvasproc.pas and search for "ligatures" in all places. Unit has special code for win32. > > Do you get the ligature? > -- -- Regards, Alexey From lazarus at mfriebe.de Sat Oct 3 17:37:45 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 3 Oct 2020 17:37:45 +0200 Subject: [Lazarus] Font ligatures support In-Reply-To: <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> Message-ID: On 03/10/2020 16:34, Alexey Tor. via lazarus wrote: > It's not very simple. see file > https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_canvasproc.pas > > and search for "ligatures" in all places. Unit has special code for > win32. Actually might be easier than thought.... > > if GetCharacterPlacementW(DC, PWChar(Str), Length(Str), 0, > @CharPlaceInfo, GCP_LIGATE)<> 0 then > Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE or > ETO_GLYPH_INDEX, Rect, Pointer(Glyphs), Length(Glyphs), Dx) > else > Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE, > Rect, PWChar(Str), Length(Str), Dx); > - If indeed the DX array is still applicable with the glyphs.... - And if that is supported on all widgetsets... - And as long as the font does still behave monospaced ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From pak.lebah at yahoo.com Sun Oct 4 05:30:09 2020 From: pak.lebah at yahoo.com (Mr Bee) Date: Sun, 4 Oct 2020 03:30:09 +0000 (UTC) Subject: [Lazarus] Where are the coolbar and desktop config files saved? References: <1274680809.1528237.1601782209123.ref@mail.yahoo.com> Message-ID: <1274680809.1528237.1601782209123@mail.yahoo.com> Hi, I setup my Lazarus IDE Coolbar with some of my own coolbar groups. Somehow I just messed up my Lazarus code that makes it failed to start. So I had to reinstall it fresh to have a working Lazarus. But I couldn't find where Lazarus saves the coolbar configuration file(s). I'd like to keep may custom coolbar setup so I could restore it back after I reinstall Lazarus. The same story for desktop layout configuration. Where does Lazarus save the configuration files for IDE Coolbar and desktop layout? And what's the file name? I'm using Lazarus v.2.0.10 on Windows 10 64 bit. Thank you. Best regards, –Mr Bee -------------- next part -------------- An HTML attachment was scrubbed... URL: From pak.lebah at yahoo.com Sun Oct 4 10:09:51 2020 From: pak.lebah at yahoo.com (Mr Bee) Date: Sun, 4 Oct 2020 08:09:51 +0000 (UTC) Subject: [Lazarus] Where are the coolbar and desktop config files saved? In-Reply-To: <1274680809.1528237.1601782209123@mail.yahoo.com> References: <1274680809.1528237.1601782209123.ref@mail.yahoo.com> <1274680809.1528237.1601782209123@mail.yahoo.com> Message-ID: <1726263910.1561814.1601798991929@mail.yahoo.com> Never mind. I've found all the Lazarus user setting files. They all are in the "/Users//AppData/Local/lazarus". The "AppData" is a hidden folder, make sure you enable "Hidden Items" option in the File Explorer. So, I just zipped the folder and saved it somewhere else. If I broke my Lazarus setting, I simply delete the folder and restore from the zip file. Simple and easy. Thank you. –Mr Bee Pada Minggu, 4 Oktober 2020 10.30.22 WIB, Mr Bee via lazarus menulis: Hi, I setup my Lazarus IDE Coolbar with some of my own coolbar groups. Somehow I just messed up my Lazarus code that makes it failed to start. So I had to reinstall it fresh to have a working Lazarus. But I couldn't find where Lazarus saves the coolbar configuration file(s). I'd like to keep may custom coolbar setup so I could restore it back after I reinstall Lazarus. The same story for desktop layout configuration. Where does Lazarus save the configuration files for IDE Coolbar and desktop layout? And what's the file name? I'm using Lazarus v.2.0.10 on Windows 10 64 bit. Thank you. Best regards, –Mr Bee -- _______________________________________________ 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 pak.lebah at yahoo.com Sun Oct 4 10:14:48 2020 From: pak.lebah at yahoo.com (Mr Bee) Date: Sun, 4 Oct 2020 08:14:48 +0000 (UTC) Subject: [Lazarus] Font ligatures support In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> Message-ID: <125995113.1541726.1601799288108@mail.yahoo.com> If it does work, would you please submit it as a patch for the next release? At least, add a note that the font ligatures feature only supports monospaced fonts and only works on Windows. It's better than nothing. Thank you. –Mr Bee Pada Sabtu, 3 Oktober 2020 22.37.58 WIB, Martin Frb via lazarus menulis: On 03/10/2020 16:34, Alexey Tor. via lazarus wrote: It's not very simple. see file https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_canvasproc.pas and search for "ligatures" in all places. Unit has special code for win32. Actually might be easier than thought.... | | | | if GetCharacterPlacementW(DC, PWChar(Str), Length(Str), 0, @CharPlaceInfo, GCP_LIGATE)<> 0 then | | | Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE or ETO_GLYPH_INDEX, Rect, Pointer(Glyphs), Length(Glyphs), Dx) | | | else | | | Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE, Rect, PWChar(Str), Length(Str), Dx); | | - If indeed the DX array is still applicable with the glyphs.... - And if that is supported on all widgetsets... - And as long as the font does still behave monospaced ... -- _______________________________________________ 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 pak.lebah at yahoo.com Sun Oct 4 10:24:13 2020 From: pak.lebah at yahoo.com (Mr Bee) Date: Sun, 4 Oct 2020 08:24:13 +0000 (UTC) Subject: [Lazarus] Support for dark mode (on Windows 10) References: <1209025703.1556094.1601799853519.ref@mail.yahoo.com> Message-ID: <1209025703.1556094.1601799853519@mail.yahoo.com> Hi, I activated system-wide dark mode on my Windows 10. Almost every installed application embraces the dark mode accordingly and automatically, except the old applications. However, I don't see Lazarus IDE embraces it. It's still showing light color scheme instead of dark scheme. Is there any setting somewhere to make Lazarus follows the system color scheme (either dark or light mode)? Or does not Lazarus support dark mode yet? Thank you. Best regards, –Mr Bee -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascaldragon at googlemail.com Sun Oct 4 11:58:51 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Sun, 4 Oct 2020 11:58:51 +0200 Subject: [Lazarus] Support for dark mode (on Windows 10) In-Reply-To: <1209025703.1556094.1601799853519@mail.yahoo.com> References: <1209025703.1556094.1601799853519.ref@mail.yahoo.com> <1209025703.1556094.1601799853519@mail.yahoo.com> Message-ID: Mr Bee via lazarus schrieb am So., 4. Okt. 2020, 10:24: > Is there any setting somewhere to make Lazarus follows the system color > scheme (either dark or light mode)? Or does not Lazarus support dark mode > yet? > The API for the dark mode is not officially documented and also changes slightly between Windows 10 versions. Regards, Sven > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryansmithhe at gmail.com Sun Oct 4 13:37:56 2020 From: ryansmithhe at gmail.com (R.Smith) Date: Sun, 4 Oct 2020 13:37:56 +0200 Subject: [Lazarus] Where are the coolbar and desktop config files saved? In-Reply-To: <1726263910.1561814.1601798991929@mail.yahoo.com> References: <1274680809.1528237.1601782209123.ref@mail.yahoo.com> <1274680809.1528237.1601782209123@mail.yahoo.com> <1726263910.1561814.1601798991929@mail.yahoo.com> Message-ID: On 2020/10/04 10:09, Mr Bee via lazarus wrote: > Never mind. I've found all the Lazarus user setting files. They all > are in the "/Users//AppData/Local/lazarus". The "AppData" is a > hidden folder, make sure you enable "Hidden Items" option in the File > Explorer. So, I just zipped the folder and saved it somewhere else. If > I broke my Lazarus setting, I simply delete the folder and restore > from the zip file. Simple and easy. > On Windows (which stores this in /Appdata) you don't need to show hidden files - you can just type %AppData%\ in the explorer address bar, same as when using the commandline. This will take you directly to the Appdata folder, and while AppData itself is hidden, all its content are not. You can further, obviously, use it as part of a full filename in both eplorer and commandline, such as: %AppData%\Lazarus\myfile.txt Note that depending on the Windows setup and logged-in user level, the direct reference to %AppData% might land you in the "....\appdata\roaming" folder in stead of /local - to remedy that, it's best to specify the path with an "Up-Dir" prefix ".." to indicate the actual parent appdata directory, so to get to a file in the Lazarus subdir in "Local", this will be the best method, it doesn't matter which subdir of appdata you land in, it will go up-one and then to local always: %AppData%\..\Local\ or for a file: %AppData%\..\Local\Lazarus\somefile.txt PS: I'm not used to typing Windows paths, had to go back and change all the slashes to backslashes, so if I missed one, please adjust accordingly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wkitty42 at windstream.net Sun Oct 4 14:04:55 2020 From: wkitty42 at windstream.net (wkitty42 at windstream.net) Date: Sun, 4 Oct 2020 08:04:55 -0400 Subject: [Lazarus] Where are the coolbar and desktop config files saved? In-Reply-To: <1726263910.1561814.1601798991929@mail.yahoo.com> References: <1274680809.1528237.1601782209123.ref@mail.yahoo.com> <1274680809.1528237.1601782209123@mail.yahoo.com> <1726263910.1561814.1601798991929@mail.yahoo.com> Message-ID: <55fee157-4459-216e-17d4-65d1dc33690f@windstream.net> On 10/4/20 4:09 AM, Mr Bee via lazarus wrote: > Never mind. I've found all the Lazarus user setting files. They all are in the > "/Users//AppData/Local/lazarus". The "AppData" is a hidden folder, make > sure you enable "Hidden Items" option in the File Explorer. FWIW: you can simply open the search on the start button, type %appdata%, and hit enter... windows will open file manager (or whatever they're using these days) in the user's AppData directory and you can navigate in from there... this works whether "hidden items" is enabled or not... -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!* From gabor at poczta.onet.pl Sun Oct 4 14:20:45 2020 From: gabor at poczta.onet.pl (gabor) Date: Sun, 4 Oct 2020 14:20:45 +0200 Subject: [Lazarus] Where are the coolbar and desktop config files saved? In-Reply-To: <55fee157-4459-216e-17d4-65d1dc33690f@windstream.net> References: <1274680809.1528237.1601782209123.ref@mail.yahoo.com> <1274680809.1528237.1601782209123@mail.yahoo.com> <1726263910.1561814.1601798991929@mail.yahoo.com> <55fee157-4459-216e-17d4-65d1dc33690f@windstream.net> Message-ID: > FWIW: you can simply open the search on the start button, type > %appdata%, and hit enter... windows will open file manager (or whatever > they're using these days) in the user's AppData directory and you can > navigate in from there... this works whether "hidden items" is enabled > or not... or use %LocalAppData% From michael at freepascal.org Sun Oct 4 15:52:27 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 4 Oct 2020 15:52:27 +0200 (CEST) Subject: [Lazarus] How to start Lazarus on Mac ? Message-ID: Hi, After installing Lazarus and recompiling it with the packages I need, it restarts and I see the packages I want. Then I stop lazarus and start it again through Launchpad. In this case, I get the originally installed Lazarus. No sign of the new packages. I look in the packages list, and it says e.g. 'pas2js selected for install, but not installed' (or something similar). If I start Lazarus through the ~/.lazarus/bin/lazarus.app icon, then it works. (I made a link on the desktop, so I can start it). But, here is the question: How can I make sure the icon in Launchpad starts the correct (i.e. newly compiled) Lazarus ? Should not the system installed version detect the 'local' version and start that ? Michael. From mailinglists at geldenhuys.co.uk Sun Oct 4 17:47:34 2020 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Sun, 4 Oct 2020 16:47:34 +0100 Subject: [Lazarus] How to start Lazarus on Mac ? In-Reply-To: References: Message-ID: On 04/10/2020 2:52 pm, Michael Van Canneyt via lazarus wrote: > Should not the system installed version detect the 'local' version and start that ? >From my experience with MacOS, it only looks inside the *.app directory for what to use. Local (installed in user home folder) doesn't affect it in any way. This is not only a Lazarus issue. I had the same with jEdit (system install & user install). Eventually I removed the system installed version, so there is only every one instance of the app. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp From lazarus at mfriebe.de Sun Oct 4 18:05:51 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 4 Oct 2020 18:05:51 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <125995113.1541726.1601799288108@mail.yahoo.com> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: On 04/10/2020 10:14, Mr Bee wrote: > If it does work, would you please submit it as a patch for the next > release? At least, add a note that the font ligatures feature only > supports monospaced fonts and only works on Windows. It's better than > nothing. > revision 63951 Windows only, compile with -dWINDOWS_LIGATURE Tested with Cascadia. If someone wants to add an option "show ligatures" ($IFDEF WINDOWS} to the IDE options (Editor > Display / like the anti aliasing option), then the feature can depend on that, and no longer needs the define. On 02/10/2020 22:48, Sven Barth via lazarus wrote: >  I'm using Microsoft's Cascadia Code According to my tests (libre office) Cascadia Mono does not do ligatures, but normal Cascadia works. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nc-gaertnma at netcologne.de Sun Oct 4 21:29:51 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 4 Oct 2020 21:29:51 +0200 Subject: [Lazarus] How to start Lazarus on Mac ? In-Reply-To: References: Message-ID: <20201004212951.16a0fb35@limapholos.matflo.wg> On Sun, 4 Oct 2020 15:52:27 +0200 (CEST) Michael Van Canneyt via lazarus wrote: >[...] > Should not the system installed version detect the 'local' version > and start that ? Sounds like: https://bugs.freepascal.org/view.php?id=37753 Mattias From michael at freepascal.org Sun Oct 4 22:21:06 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 4 Oct 2020 22:21:06 +0200 (CEST) Subject: [Lazarus] How to start Lazarus on Mac ? In-Reply-To: <20201004212951.16a0fb35@limapholos.matflo.wg> References: <20201004212951.16a0fb35@limapholos.matflo.wg> Message-ID: On Sun, 4 Oct 2020, Mattias Gaertner via lazarus wrote: > On Sun, 4 Oct 2020 15:52:27 +0200 (CEST) > Michael Van Canneyt via lazarus wrote: > >> [...] >> Should not the system installed version detect the 'local' version >> and start that ? > > Sounds like: > https://bugs.freepascal.org/view.php?id=37753 I think the correct solution is indeed to let the installed "Lazarus.app" start the startlazarus binary. That will then take care of the rest. Any idea how I can accomplish this myself ? I tried setting the symbolic link 'lazarus' in /Application/Lazarus.app/Contents/MacOS to ../../../startlazarus, but that does not seem to be enough. I get strange effects, that's the least I can say :-) Michael. From ganmax at narod.ru Mon Oct 5 00:27:30 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Mon, 5 Oct 2020 01:27:30 +0300 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: 04.10.2020 19:05, Martin Frb via lazarus пишет: > On 04/10/2020 10:14, Mr Bee wrote: >> If it does work, would you please submit it as a patch for the next >> release? At least, add a note that the font ligatures feature only >> supports monospaced fonts and only works on Windows. It's better than >> nothing. >> > revision 63951 > > Windows only, compile with -dWINDOWS_LIGATURE > Tested with Cascadia. Lazarus hangs on start for me on Windows 7 when compiled with this define. Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use JetBrains Mono font. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From lazarus at mfriebe.de Mon Oct 5 00:48:38 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 5 Oct 2020 00:48:38 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: <2d713031-d65e-7746-14c6-9eb86689a252@mfriebe.de> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: > 04.10.2020 19:05, Martin Frb via lazarus пишет: >> On 04/10/2020 10:14, Mr Bee wrote: >>> If it does work, would you please submit it as a patch for the next >>> release? At least, add a note that the font ligatures feature only >>> supports monospaced fonts and only works on Windows. It's better >>> than nothing. >>> >> revision 63951 >> >> Windows only, compile with -dWINDOWS_LIGATURE >> Tested with Cascadia. > > Lazarus hangs on start for me on Windows 7 when compiled with this > define. > > Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use JetBrains > Mono font. > Could you start with an empty project? To make sure its not content related? Though the code changes do not have any loop. You could run in gdb gdb lazarus.exe r ctrl-c when it hangs bt From ganmax at narod.ru Mon Oct 5 01:02:55 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Mon, 5 Oct 2020 02:02:55 +0300 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <2d713031-d65e-7746-14c6-9eb86689a252@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <2d713031-d65e-7746-14c6-9eb86689a252@mfriebe.de> Message-ID: <6ffd94d0-f835-ec51-10ca-a59a82c11d42@narod.ru> 05.10.2020 1:48, Martin Frb via lazarus пишет: > On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: >> 04.10.2020 19:05, Martin Frb via lazarus пишет: >>> On 04/10/2020 10:14, Mr Bee wrote: >>>> If it does work, would you please submit it as a patch for the next >>>> release? At least, add a note that the font ligatures feature only >>>> supports monospaced fonts and only works on Windows. It's better >>>> than nothing. >>>> >>> revision 63951 >>> >>> Windows only, compile with -dWINDOWS_LIGATURE >>> Tested with Cascadia. >> >> Lazarus hangs on start for me on Windows 7 when compiled with this >> define. >> >> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use JetBrains >> Mono font. >> > Could you start with an empty project? To make sure its not content > related? > > Though the code changes do not have any loop. > > You could run in gdb > > gdb lazarus.exe > > r > > ctrl-c when it hangs > > bt Tried with an empty project, nothing changed. Actually it does not hang, it segfaults. GDB output: i:\FPC\lazarus>i:\FPC\lazarus_gdb_w32\bin\gdb.exe lazarus.old.exe GNU gdb (GDB) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from lazarus.old.exe...done. (gdb) r Starting program: i:\FPC\lazarus\lazarus.old.exe [New Thread 6324.0x994] [New Thread 6324.0x1834] [Thread 6324.0x1834 exited with code 0] [New Thread 6324.0x1c78] Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () (gdb) bt #0 0x00000000 in ?? () #1 0x00000024 in ?? () #2 0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., parentfp=0x13abf6e8) at lazsyntextarea.pp:1741 #3 0x00ab8a8e in PAINTLINES (parentfp=0x13abf6e8) at lazsyntextarea.pp:1798 #4 0x00ab86f3 in TLAZSYNTEXTAREA__PAINTTEXTLINES (ACLIP=..., FIRSTLINE=0, LASTLINE=27, FIRSTCOL=1, LASTCOL=154, this=) at lazsyntextarea.pp:1870 #5 0x00ab831c in TLAZSYNTEXTAREA__DOPAINT (ACANVAS=0x1a798798, ACLIP=..., this=) at lazsyntextarea.pp:1489 #6 0x00ab00d0 in TLAZSYNSURFACE__PAINT (ACANVAS=0x1a798798, ACLIP=..., this=) at syneditmiscclasses.pp:1308 #7 0x00ab6f82 in TLAZSYNSURFACEMANAGER__DOPAINT (ACANVAS=0x1a798798, ACLIP=..., this=) at lazsyntextarea.pp:1134 #8 0x00ab00d0 in TLAZSYNSURFACE__PAINT (ACANVAS=0x1a798798, ACLIP=..., this=) at syneditmiscclasses.pp:1308 #9 0x00c1c402 in TSOURCELAZSYNSURFACEMANAGER__DOPAINT (ACANVAS=0x1a798798, ACLIP=..., this=) at sourcesyneditor.pas:1353 #10 0x00ab00d0 in TLAZSYNSURFACE__PAINT (ACANVAS=0x1a798798, ACLIP=..., this=) at syneditmiscclasses.pp:1308 #11 0x0070603f in TCUSTOMSYNEDIT__PAINT (this=) at synedit.pp:4221 #12 0x0057270d in TCUSTOMCONTROL__PAINTWINDOW (DC=469832019, this=) at ./include/customcontrol.inc:123 ---Type to continue, or q to quit--- #13 0x0055ffa7 in TWINCONTROL__PAINTHANDLER (THEMESSAGE=..., this=) at ./include/wincontrol.inc:4857 #14 0x00563427 in TWINCONTROL__WMPAINT (MSG=..., this=) at ./include/wincontrol.inc:6850 #15 0x00572630 in TCUSTOMCONTROL__WMPAINT (MESSAGE=..., this=) at ./include/customcontrol.inc:103 #16 0x00410221 in SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal () #17 0x00000001 in ?? () #18 0x0120f754 in VMT_$CONTROLS_$$_TCUSTOMCONTROL () #19 0x0120f2b8 in VMT_$CONTROLS_$$_TGRAPHICCONTROL$indirect () #20 0x005725f0 in TCUSTOMCONTROL__WSREGISTERCLASS (pvmt=0x13abfbf4) at ./include/customcontrol.inc:90 #21 0x0056100b in TWINCONTROL__WNDPROC (MESSAGE=..., this=) at ./include/wincontrol.inc:5429 #22 0x0070d54f in TCUSTOMSYNEDIT__WNDPROC (MSG=..., this=) at synedit.pp:6399 #23 0x0061ff2a in DELIVERMESSAGE (TARGET=0x1bdaf3a0, AMESSAGE= ) at lclmessageglue.pas:112 #24 0x0054410f in TWINDOWPROCHELPER__SENDPAINTMESSAGE (CONTROLDC=0, this=...) at ./win32/win32callback.inc:746 #25 0x00547922 in TWINDOWPROCHELPER__DOWINDOWPROC (this=...) at ./win32/win32callback.inc:2357 #26 0x005487a1 in WINDOWPROC (WINDOW=1312066, MSG=15, WPARAM=0, LPARAM=0) ---Type to continue, or q to quit--- at ./win32/win32callback.inc:2774 #27 0x76f1630a in gapfnScSendMessage () from C:\Windows\syswow64\user32.dll #28 0x00140542 in ?? () #29 0x76f17326 in USER32!GetDC () from C:\Windows\syswow64\user32.dll #30 0x00548750 in TWINDOWPROCHELPER__DOWINDOWPROC ( this=) at ./win32/win32callback.inc:2745 #31 0x76f16df8 in USER32!GetThreadDesktop () from C:\Windows\syswow64\user32.dll #32 0x00000000 in ?? () (gdb) -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From lazarus at mfriebe.de Mon Oct 5 01:36:05 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 5 Oct 2020 01:36:05 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <6ffd94d0-f835-ec51-10ca-a59a82c11d42@narod.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <2d713031-d65e-7746-14c6-9eb86689a252@mfriebe.de> <6ffd94d0-f835-ec51-10ca-a59a82c11d42@narod.ru> Message-ID: <19835b7b-40eb-4520-7a19-d44b56f6508b@mfriebe.de> On 05/10/2020 01:02, Maxim Ganetsky via lazarus wrote: > 05.10.2020 1:48, Martin Frb via lazarus пишет: >> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: >>> >>> Lazarus hangs on start for me on Windows 7 when compiled with this >>> define. >>> >>> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use >>> JetBrains Mono font. >>> >> Could you start with an empty project? To make sure its not content >> related? >> >> Though the code changes do not have any loop. >> >> You could run in gdb >> >> gdb lazarus.exe >> >> r >> >> ctrl-c when it hangs >> >> bt > > Tried with an empty project, nothing changed. Actually it does not > hang, it segfaults. GDB output: > Ok, that is in the new code (inside the OS call...). So some param that it does not like.. Could you try in file syntextdrawer.pp line 792 function TheFontStock.GetNeedETO: Boolean; To ALWAYS return false. Maybe it does not like to have a DX/ETO param. From pascaldragon at googlemail.com Mon Oct 5 07:56:40 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Mon, 5 Oct 2020 07:56:40 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: Martin Frb via lazarus schrieb am So., 4. Okt. 2020, 18:05: > On 04/10/2020 10:14, Mr Bee wrote: > > If it does work, would you please submit it as a patch for the next > release? At least, add a note that the font ligatures feature only supports > monospaced fonts and only works on Windows. It's better than nothing. > > revision 63951 > > Windows only, compile with -dWINDOWS_LIGATURE > Tested with Cascadia. > > If someone wants to add an option "show ligatures" ($IFDEF WINDOWS} to the > IDE options (Editor > Display / like the anti aliasing option), then the > feature can depend on that, and no longer needs the define. > Thank you! Will test when I find the time. :) > > On 02/10/2020 22:48, Sven Barth via lazarus wrote: > > I'm using Microsoft's Cascadia Code > > > According to my tests (libre office) Cascadia Mono does not do ligatures, > but normal Cascadia works. > Yes, Cascadia Mono is without ligatures, Cascadia Code is with them. Regards, Sven > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl-michael.schindler at physik.uni-halle.de Mon Oct 5 11:09:01 2020 From: karl-michael.schindler at physik.uni-halle.de (Karl-Michael Schindler) Date: Mon, 5 Oct 2020 11:09:01 +0200 Subject: [Lazarus] How to start Lazarus on Mac ? In-Reply-To: References: Message-ID: Hi > Am 05.10.2020 um 07:56 schrieb lazarus-request at lists.lazarus-ide.org: > > Date: Sun, 4 Oct 2020 22:21:06 +0200 (CEST) > From: Michael Van Canneyt > To: Mattias Gaertner via lazarus > Subject: Re: [Lazarus] How to start Lazarus on Mac ? > Message-ID: > Content-Type: text/plain; charset=US-ASCII; format=flowed > > On Sun, 4 Oct 2020, Mattias Gaertner via lazarus wrote: > >> On Sun, 4 Oct 2020 15:52:27 +0200 (CEST) >> Michael Van Canneyt via lazarus wrote: >> >>> [...] >>> Should not the system installed version detect the 'local' version >>> and start that ? >> >> Sounds like: >> https://bugs.freepascal.org/view.php?id=37753 > > I think the correct solution is indeed to let the installed "Lazarus.app" start > the startlazarus binary. That will then take care of the rest. > > Any idea how I can accomplish this myself ? > I tried setting the symbolic link 'lazarus' in /Application/Lazarus.app/Contents/MacOS > to ../../../startlazarus, but that does not seem to be enough. > > I get strange effects, that's the least I can say :-) > > Michael. Has anyone checked whether using /opt instead of /usr/local resolves the issue? At least this is the sort of resolution of the package managers fink and macports. Michael. From lazarus at mfriebe.de Mon Oct 5 17:36:16 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 5 Oct 2020 17:36:16 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: > Lazarus hangs on start for me on Windows 7 when compiled with this > define. > > Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use JetBrains > Mono font. > I installed the font myself. And it works on windows 10 and that works. However I found one possible issue. Please go to SynTextDrawer.pp line 1269 and replace the current     Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, @ARect, Pointer(Glyphs), Length(Glyphs), EtoArray); with the following new     Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, @ARect, Pointer(Glyphs), CharPlaceInfo.nGlyphs, EtoArray); The other ...TextOut in the lines below that should be kept as they are. From pascaldragon at googlemail.com Mon Oct 5 22:46:01 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Mon, 5 Oct 2020 22:46:01 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: Am 04.10.2020 um 18:05 schrieb Martin Frb via lazarus: > On 04/10/2020 10:14, Mr Bee wrote: >> If it does work, would you please submit it as a patch for the next >> release? At least, add a note that the font ligatures feature only >> supports monospaced fonts and only works on Windows. It's better than >> nothing. >> > revision 63951 > > Windows only, compile with -dWINDOWS_LIGATURE > Tested with Cascadia. > > If someone wants to add an option "show ligatures" ($IFDEF WINDOWS} to > the IDE options (Editor > Display / like the anti aliasing option), > then the feature can depend on that, and no longer needs the define. I've tested it (with Cascadia Code) and while it shows the one or other ligature, Visual Studio shows more. Take the following sequence: -> => >= <= *** .. ... <> >< >> << >>> <<< == != Visual Studio shows all as ligatures except the first one and the symmetric difference (I think it doesn't have one) Lazarus however only shows >=, <=, <>  and .. as ligatures and for the three points it displays them as ".. .", so the first two are presented by their ligature, but the third dot is done separately (unlike in Visual Studio). Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Mon Oct 5 23:29:05 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 5 Oct 2020 23:29:05 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: On 05/10/2020 22:46, Sven Barth via lazarus wrote: > I've tested it (with Cascadia Code) and while it shows the one or > other ligature, Visual Studio shows more. > > Take the following sequence: > > -> => >= <= *** .. ... <> >< >> << >>> <<< == != I found that if I put them into a string or comment, then they do all ligate.... Equally if I switch off the Highlighter Maybe the HL's tokenizer. Could be the HL sees a - as one token, and has that printed individually. So those tokens either need to be kept together (But pascal dictates the "-" as one token), or joined together again. => is one Pascal token -> is not. The HL sees 2 tokens (never mind they make no sense in that order) Currently also ligatures do get broken, if you extend the selection, and have half of it selected. That requires a rewrite of some parts of the painting code (needs to get into my TODO queue...) From ganmax at narod.ru Tue Oct 6 01:01:44 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Tue, 6 Oct 2020 02:01:44 +0300 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> Message-ID: <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> 05.10.2020 18:36, Martin Frb via lazarus пишет: > On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: >> Lazarus hangs on start for me on Windows 7 when compiled with this >> define. >> >> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use JetBrains >> Mono font. >> > I installed the font myself. And it works on windows 10 and that works. > > However I found one possible issue. > > Please go to > SynTextDrawer.pp > line 1269 > and replace the current >     Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, > @ARect, Pointer(Glyphs), Length(Glyphs), EtoArray); > with the following new >     Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, > @ARect, Pointer(Glyphs), CharPlaceInfo.nGlyphs, EtoArray); > > The other ...TextOut in the lines below that should be kept as they are. This change does not help. I also tried your suggestion to make function TheFontStock.GetNeedETO to always return false. This did not make any difference too. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From aaa5500 at ya.ru Tue Oct 6 11:14:51 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Tue, 6 Oct 2020 12:14:51 +0300 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: <6d28b02d-8dcd-5ace-f36e-a1b7de9fd064@ya.ru> > -> => >= <= *** .. ... <> >< >> << >>> <<< == != > > Visual Studio shows all as ligatures except the first one It's trivial - synedit just doesn't TextOut such symbols in one block, ie it doesn't renders '->' as 2 chars but renders it as 2 chars - and >. Same for >>> and <<< etc. -- Regards, Alexey From lazarus at mfriebe.de Tue Oct 6 12:32:34 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Tue, 6 Oct 2020 12:32:34 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> Message-ID: <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> On 06/10/2020 01:01, Maxim Ganetsky via lazarus wrote: > 05.10.2020 18:36, Martin Frb via lazarus пишет: >> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: >>> Lazarus hangs on start for me on Windows 7 when compiled with this >>> define. >>> >>> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use >>> JetBrains Mono font. >>> >> >> The other ...TextOut in the lines below that should be kept as they are. > > This change does not help. Ok, I installed Win7 in a virtualbox, got Lazarus, installed the "JetBrains mono" font (just the regular, skipped all the light/italics....) and "JetBrains mono Variable". No crash. Ligatures work (well the subset as described in other mail) Without any way of reproducing, there isn't much I can do. ---- Can you try to catch it in the debugger, and see what params are given to NewTextOut in #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., parentfp=0x13abf6e8)     at lazsyntextarea.pp:1741  fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok, ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); From lazarus at mfriebe.de Tue Oct 6 12:36:54 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Tue, 6 Oct 2020 12:36:54 +0200 Subject: [Lazarus] @Alexey length(Glyph) [[Re: Font ligatures support]] In-Reply-To: <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> Message-ID: On 03/10/2020 16:34, Alexey Tor. via lazarus wrote: > It's not very simple. see file > https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_canvasproc.pas > > and search for "ligatures" in all places. Unit has special code for > win32. Just a note     if GetCharacterPlacementW(DC, PWChar(Str), Length(Str), 0, @CharPlaceInfo, GCP_LIGATE)<> 0 then       Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE or ETO_GLYPH_INDEX, Rect, Pointer(Glyphs), Length(Glyphs), Dx) Should that be   CharPlaceInfo.nGlyphs instead of   Length(Glyphs) ? GetCharacterPlacementW may return up to (but therefore also less than)  Length(Glyphs) glyphs. So ExtTextOutW should get the adjusted count? From lazarus at mfriebe.de Tue Oct 6 13:32:27 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Tue, 6 Oct 2020 13:32:27 +0200 Subject: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> Message-ID: On 04/10/2020 18:05, Martin Frb wrote: > On 04/10/2020 10:14, Mr Bee wrote: >> If it does work, would you please submit it as a patch for the next >> release? At least, add a note that the font ligatures feature only >> supports monospaced fonts and only works on Windows. It's better than >> nothing. >> > revision 63951 > > Windows only, compile with -dWINDOWS_LIGATURE > Tested with Cascadia. I did add a couple of checks. Amended it for right to left languages (Arabic). Arabic only works with certain fonts. And Japanese Katakana seems not to work at all (or I have not found a supporting font, while without this feature it works with "Deja Vue" and others). It appears that this API restricts Windows font substitution abilities. It might be that in order for all this to work, one has to use the newer "uniscribe" API. I also kind of assume that in the current IFDEF code the use of the DX array (ETO) is wrong. But I could not produce any errors from that / And it only would happen if  NeedETO = True. So for the moment, this stays highly experimental. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ganmax at narod.ru Tue Oct 6 15:09:06 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Tue, 6 Oct 2020 16:09:06 +0300 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> Message-ID: <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> 06.10.2020 13:32, Martin Frb via lazarus пишет: > On 06/10/2020 01:01, Maxim Ganetsky via lazarus wrote: >> 05.10.2020 18:36, Martin Frb via lazarus пишет: >>> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote: >>>> Lazarus hangs on start for me on Windows 7 when compiled with this >>>> define. >>>> >>>> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use >>>> JetBrains Mono font. >>>> >>> >>> The other ...TextOut in the lines below that should be kept as they are. >> >> This change does not help. > > Ok, I installed Win7 in a virtualbox, got Lazarus, installed the > "JetBrains mono" font (just the regular, skipped all the > light/italics....) and "JetBrains mono Variable". > > No crash. > Ligatures work (well the subset as described in other mail) > > Without any way of reproducing, there isn't much I can do. > > ---- > Can you try to catch it in the debugger, and see what params are given > to NewTextOut > in > #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., > parentfp=0x13abf6e8) >     at lazsyntextarea.pp:1741 > >  fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok, > ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); Can you add some debugln in a format convenient to you? This will simplify things, I think. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From lazarus at mfriebe.de Tue Oct 6 15:23:56 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Tue, 6 Oct 2020 15:23:56 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> Message-ID: On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote: > > ---- > Can you try to catch it in the debugger, and see what params are given > to NewTextOut > in > #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., > parentfp=0x13abf6e8) >     at lazsyntextarea.pp:1741 > >  fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok, > ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); > Can you add some debugln in a format convenient to you? This will > simplify things, I think. > This is in the paint handler, and it is called for each token. So potentially very slow with debugln. But since it is in startup, hopefully you wont have to many. Apply this patch please diff --git a/components/synedit/lazsyntextarea.pp b/components/synedit/lazsyntextarea.pp index 4c5a599c9b..163af24e6c 100644 --- a/components/synedit/lazsyntextarea.pp +++ b/components/synedit/lazsyntextarea.pp @@ -1737,6 +1737,7 @@ procedure TLazSynTextArea.PaintTextLines(AClip: TRect; FirstLine, LastLine,      if rcToken.Right > nRightEdge + 1 then        tok.Bottom := rcLine.Bottom;      TxtLeft := ScreenColumnToXValue(ATokenInfo.PhysicalCharStart); // because for the first token, this can be middle of a char, and lead to wrong frame +debugln('Calling NewTextOut L: %s rcT: %s tok: %s tkt: %s // %s // eto: %s', [dbgs(TxtLeft), dbgs(rcToken), dbgs(tok), dbgMemRange(PByte(ATokenInfo.Tk.TokenStart), ATokenInfo.Tk.TokenLength), dbgs(ATokenInfo.Tk.TokenLength), dbgs(Length(FEtoBuf.EtoData)) ]);      fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,        ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); diff --git a/components/synedit/syntextdrawer.pp b/components/synedit/syntextdrawer.pp index 834d442563..ddbb09f4df 100644 --- a/components/synedit/syntextdrawer.pp +++ b/components/synedit/syntextdrawer.pp @@ -1267,9 +1267,14 @@ procedure TheTextDrawer.NewTextOut(X, Y: Integer; fuOptions: UINT;      CharPlaceInfo.lpGlyphs:= @Glyphs[0];      CharPlaceInfo.nGlyphs:= Length(Glyphs);      Glyphs[0] := #0; +debugln('BEFORE');      if GetCharacterPlacementW(FDC, PWChar(W), Length(W), 0, CharPlaceInfo, GCP_LIGATE or GCP_REORDER or GCP_GLYPHSHAPE)<> 0 then begin +debugln('GOT PLACEMENT %s  / %s  / %s', [dbgs(length(Glyphs)), dbgs(CharPlaceInfo.nGlyphs), dbgs(CharPlaceInfo.lpGlyphs=@Glyphs[0]) ]); +if CharPlaceInfo.nGlyphs > 0 then begin +debugln('GOT --- %s  / %s', [dbgs(length(Glyphs)), dbgMemRange(CharPlaceInfo.lpGlyphs, 2*CharPlaceInfo.nGlyphs)]);        Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, @ARect, Pointer(Glyphs), CharPlaceInfo.nGlyphs, EtoArray);        exit; +end;      end;    end;    {$ENDIF} From bo.berglund at gmail.com Tue Oct 6 23:35:08 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 06 Oct 2020 23:35:08 +0200 Subject: [Lazarus] How to list available serial ports on Linux? Message-ID: Is there a way to list the available (working) serial ports on a Linux platform like the RaspberryPi? I would like to offer a dropdown list of working serial ports to the user to select among, but I am dissuaded from it when I do the following: ls -la /dev/tty* It returns a very long list of serial devices and most of these are probably not even existing in real life. On an RPi I get /dev/tty /dev/ttyN (where N=0..63 /dev/ttyAMA0 <== This is RPi Serial0 port on the pin header. /dev/ttyprintk and: /dev/ttyUSB0../dev/ttyUSB3 depending on what is plugged into USB All in all about 70 devices, but not sure which are actually available for use. Is this an impossible task or can one check for "live" serial ports only? If so how? On Windows I have ported a convoluted function from Delphi, which uses Registry reads to give me the list. -- Bo Berglund Developer in Sweden From wv99999 at gmail.com Wed Oct 7 00:43:50 2020 From: wv99999 at gmail.com (Wolf) Date: Wed, 7 Oct 2020 11:43:50 +1300 Subject: [Lazarus] How to list available serial ports on Linux? In-Reply-To: References: Message-ID: By submitting your question to DuckDuckGo, I found https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them To quote: |To see which tty's are currently in use, you can simply look into the file /proc/tty/drivers: and get a rather short list of devices. |Does it help? || On 7/10/20 10:35 AM, Bo Berglund via lazarus wrote: > Is there a way to list the available (working) serial ports on a Linux > platform like the RaspberryPi? > > I would like to offer a dropdown list of working serial ports to the > user to select among, but I am dissuaded from it when I do the > following: > > ls -la /dev/tty* > It returns a very long list of serial devices and most of these are > probably not even existing in real life. > > On an RPi I get > /dev/tty > /dev/ttyN (where N=0..63 > /dev/ttyAMA0 <== This is RPi Serial0 port on the pin header. > /dev/ttyprintk > and: > /dev/ttyUSB0../dev/ttyUSB3 depending on what is plugged into USB > > All in all about 70 devices, but not sure which are actually available > for use. > > Is this an impossible task or can one check for "live" serial ports > only? If so how? > > On Windows I have ported a convoluted function from Delphi, which uses > Registry reads to give me the list. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ganmax at narod.ru Wed Oct 7 01:42:41 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Wed, 7 Oct 2020 02:42:41 +0300 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> Message-ID: 06.10.2020 16:23, Martin Frb via lazarus пишет: > On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote: >> >> ---- >> Can you try to catch it in the debugger, and see what params are given >> to NewTextOut >> in >> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., >> parentfp=0x13abf6e8) >>      at lazsyntextarea.pp:1741 >> >>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok, >> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); >> Can you add some debugln in a format convenient to you? This will >> simplify things, I think. >> > This is in the paint handler, and it is called for each token. So > potentially very slow with debugln. > > But since it is in startup, hopefully you wont have to many. > > Apply this patch please With this patch applied Lazarus seems to crash on debugln in lazsyntextarea.pp. Just in case, I tried to remove this particular debugln, then it printed 'BEFORE' and nothing more. i:\FPC\lazarus>lazarus --debug-output=.\dbgoutput.txt Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="C:\Users\Maxim \AppData\Local\lazarus" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="i:\FPC\lazar us" Hint: (lazarus) [TMainIDE.LoadGlobalOptions] Hint: (lazarus) LastCalled="I:\FPC\lazarus\lazarus.old.working.exe" Hint: (lazarus) CurPrgName="i:\FPC\lazarus\lazarus.exe" Hint: (lazarus) AltPrgName="C:\Users\Maxim\AppData\Local\lazarus\bin\lazarus.exe " Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 New=i386-win 32-win32 Changed: OS/CPU=True LCL=False TApplication.HandleException: EAccessViolation Access violation Stack trace: $00C12B2D DRAWHILIGHTMARKUPTOKEN, line 1740 of lazsyntextarea.pp $00C11C76 PAINTLINES, line 1799 of lazsyntextarea.pp $00C11847 PAINTTEXTLINES, line 1871 of lazsyntextarea.pp $00C113D8 DOPAINT, line 1489 of lazsyntextarea.pp $00C07EA0 PAINT, line 1308 of syneditmiscclasses.pp $00C0FDD2 DOPAINT, line 1134 of lazsyntextarea.pp $00C07EA0 PAINT, line 1308 of syneditmiscclasses.pp $00D9A022 DOPAINT, line 1353 of sourcesyneditor.pas $00C07EA0 PAINT, line 1308 of syneditmiscclasses.pp $0079ECCB PAINT, line 4221 of synedit.pp $005B3471 PAINTWINDOW, line 123 of include/customcontrol.inc $0059BB7B PAINTHANDLER, line 4857 of include/wincontrol.inc $005A00A4 WMPAINT, line 6851 of include/wincontrol.inc $005B3330 WMPAINT, line 103 of include/customcontrol.inc $004103A1 $0059D0A7 WNDPROC, line 5429 of include/wincontrol.inc $007A6B0F WNDPROC, line 6399 of synedit.pp FreeFormEditor: FormEditor1=TFormEditor Hint: (lazarus) [TMainIDE.Destroy] B -> inherited Destroy... TMainIDE Hint: (lazarus) [TMainIDE.Destroy] END Heap dump by heaptrc unit of i:\FPC\lazarus\lazarus.exe 6222427 memory blocks allocated : 556846869/572547168 6211889 memory blocks freed : 555436555/571105040 10538 unfreed memory blocks : 1410314 True heap size : 28114944 (128 used in System startup) True free heap : 25543392 Should be : 25661040 Call trace for block $1CEE6DD0 size 64 $00418EBF $770034A1 $77003473 $76FB0133 $00C11C76 PAINTLINES, line 1799 of lazsyntextarea.pp $00C11847 PAINTTEXTLINES, line 1871 of lazsyntextarea.pp $00C113D8 DOPAINT, line 1489 of lazsyntextarea.pp $00C07EA0 PAINT, line 1308 of syneditmiscclasses.pp $00C0FDD2 DOPAINT, line 1134 of lazsyntextarea.pp $00C07EA0 PAINT, line 1308 of syneditmiscclasses.pp $00D9A022 DOPAINT, line 1353 of sourcesyneditor.pas $00C07EA0 PAINT, line 1308 of syneditmiscclasses.pp $0079ECCB PAINT, line 4221 of synedit.pp $005B3471 PAINTWINDOW, line 123 of include/customcontrol.inc $0059BB7B PAINTHANDLER, line 4857 of include/wincontrol.inc $005A00A4 WMPAINT, line 6851 of include/wincontrol.inc Call trace for block $1C6FECD0 size 92 -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From corpsman at web.de Wed Oct 7 06:08:26 2020 From: corpsman at web.de (Corpsman) Date: Wed, 7 Oct 2020 06:08:26 +0200 Subject: [Lazarus] How to list available serial ports on Linux? In-Reply-To: References: Message-ID: <33c693a1-f172-5264-b19f-8efdec9bb7f8@web.de> That is how do it: Function GetSerialPortNames(): String; Var   sl: TStringlist; Var   Info: TSearchRec;   hdl: THandle;   b: Boolean; Begin   sl := TStringlist.create;   If FindFirst('/dev/tty*', faSysFile, Info) = 0 Then Begin     Repeat       b := true;       Try         hdl := FileOpen('/dev/' + info.Name, fmOpenReadWrite);         If hdl = -1 Then Begin           b := false;         End;       Except         b := false;       End;       If hdl >= 0 Then Begin         FileClose(hdl);       End;       If b Then Begin         sl.Add('/dev/' + info.Name);       End;     Until FindNext(info) <> 0;   End;   FindClose(Info);   result := sl.CommaText;   sl.free; End; On 10/6/20 11:35 PM, Bo Berglund via lazarus wrote: > Is there a way to list the available (working) serial ports on a Linux > platform like the RaspberryPi? > > I would like to offer a dropdown list of working serial ports to the > user to select among, but I am dissuaded from it when I do the > following: > > ls -la /dev/tty* > It returns a very long list of serial devices and most of these are > probably not even existing in real life. > > On an RPi I get > /dev/tty > /dev/ttyN (where N=0..63 > /dev/ttyAMA0 <== This is RPi Serial0 port on the pin header. > /dev/ttyprintk > and: > /dev/ttyUSB0../dev/ttyUSB3 depending on what is plugged into USB > > All in all about 70 devices, but not sure which are actually available > for use. > > Is this an impossible task or can one check for "live" serial ports > only? If so how? > > On Windows I have ported a convoluted function from Delphi, which uses > Registry reads to give me the list. > > -- Auf meiner Homepage www.Corpsman.de ist immer was los, ständig wird sie aktualisiert und erweitert. Da ist für jeden was dabei. -- Schütze deine Privatsphäre, nutze E-mail Verschlüsselung. Wie das geht steht z.B. hier : https://support.mozilla.org/en-US/kb/digitally-signing-and-encrypting-messages#w_installing-gpg-and-enigmail From bo.berglund at gmail.com Wed Oct 7 10:26:01 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 07 Oct 2020 10:26:01 +0200 Subject: [Lazarus] How to list available serial ports on Linux? References: Message-ID: <34tqnftc5k59fnun09h4v9atr1qvknoeg1@4ax.com> On Wed, 7 Oct 2020 11:43:50 +1300, Wolf via lazarus wrote: >By submitting your question to DuckDuckGo, I found >https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them > >To quote: > >|To see which tty's are currently in use, you can simply look into the >file /proc/tty/drivers: and get a rather short list of devices. |Does it help? OK, I have read through your link and also tested a lot on an RPi4 and a standard i386 Ubuntu server. The suggested file is no help since it contains a lot of irrelevent stuff. This is what I have found that is closest to what I need: Ubuntu 18 server, where I have one USB serial adapter installed: --------------------------------------------------------------- $ ls -l /dev/tty* | grep 'dialout' crw-rw---- 1 root dialout 4, 64 Sep 26 23:45 /dev/ttyS0 crw-rw---- 1 root dialout 4, 65 Sep 26 23:45 /dev/ttyS1 crw-rw---- 1 root dialout 4, 74 Sep 26 23:45 /dev/ttyS10 crw-rw---- 1 root dialout 4, 75 Sep 26 23:45 /dev/ttyS11 crw-rw---- 1 root dialout 4, 76 Sep 26 23:45 /dev/ttyS12 crw-rw---- 1 root dialout 4, 77 Sep 26 23:45 /dev/ttyS13 crw-rw---- 1 root dialout 4, 78 Sep 26 23:45 /dev/ttyS14 crw-rw---- 1 root dialout 4, 79 Sep 26 23:45 /dev/ttyS15 crw-rw---- 1 root dialout 4, 80 Sep 26 23:45 /dev/ttyS16 crw-rw---- 1 root dialout 4, 81 Sep 26 23:45 /dev/ttyS17 crw-rw---- 1 root dialout 4, 82 Sep 26 23:45 /dev/ttyS18 crw-rw---- 1 root dialout 4, 83 Sep 26 23:45 /dev/ttyS19 crw-rw---- 1 root dialout 4, 66 Sep 26 23:45 /dev/ttyS2 crw-rw---- 1 root dialout 4, 84 Sep 26 23:45 /dev/ttyS20 crw-rw---- 1 root dialout 4, 85 Sep 26 23:45 /dev/ttyS21 crw-rw---- 1 root dialout 4, 86 Sep 26 23:45 /dev/ttyS22 crw-rw---- 1 root dialout 4, 87 Sep 26 23:45 /dev/ttyS23 crw-rw---- 1 root dialout 4, 88 Sep 26 23:45 /dev/ttyS24 crw-rw---- 1 root dialout 4, 89 Sep 26 23:45 /dev/ttyS25 crw-rw---- 1 root dialout 4, 90 Sep 26 23:45 /dev/ttyS26 crw-rw---- 1 root dialout 4, 91 Sep 26 23:45 /dev/ttyS27 crw-rw---- 1 root dialout 4, 92 Sep 26 23:45 /dev/ttyS28 crw-rw---- 1 root dialout 4, 93 Sep 26 23:45 /dev/ttyS29 crw-rw---- 1 root dialout 4, 67 Sep 26 23:45 /dev/ttyS3 crw-rw---- 1 root dialout 4, 94 Sep 26 23:45 /dev/ttyS30 crw-rw---- 1 root dialout 4, 95 Sep 26 23:45 /dev/ttyS31 crw-rw---- 1 root dialout 4, 68 Sep 26 23:45 /dev/ttyS4 crw-rw---- 1 root dialout 4, 69 Sep 26 23:45 /dev/ttyS5 crw-rw---- 1 root dialout 4, 70 Sep 26 23:45 /dev/ttyS6 crw-rw---- 1 root dialout 4, 71 Sep 26 23:45 /dev/ttyS7 crw-rw---- 1 root dialout 4, 72 Sep 26 23:45 /dev/ttyS8 crw-rw---- 1 root dialout 4, 73 Sep 26 23:45 /dev/ttyS9 crw-rw---- 1 root dialout 188, 0 Oct 7 09:34 /dev/ttyUSB0 RPi4, where I have 2 USB connected serial devices: -------------------------------------------------- $ ls -l /dev/tty* | grep 'dialout' crw-rw---- 1 root dialout 204, 64 Sep 23 17:57 /dev/ttyAMA0 crw-rw---- 1 root dialout 188, 0 Oct 6 12:33 /dev/ttyUSB0 crw-rw---- 1 root dialout 188, 1 Oct 6 15:08 /dev/ttyUSB1 Obviously the Ubuntu situation is a non-starter since it lists way too many ports than can possibly be accessible. In fact on that computer ONLY the USB adapter is possible to use, I don't know where the others might be... But the RPi4 result is more promising since it lists the 3 ports I know are there and none else. But concerning the USB connections there is a different problem too, the port name depends on in which order the adapter is plugged into the USB socket, the first plugged adapåter gets ttyUSB0 and the next ttyUSB1 etc..... So if you want to select the correct port wired to a specific device you are in a random situation. I have had to set up the RPi system such that it creates a symlink to the plugged in usb-serial adapter based on the ID of the USB socket it is connected to. This is done by editing the file: /etc/udev/rules.d/99-usb-serial.rules By entering rules for the USB sockets as follows I have locked down the tty name for each socket such that it will be a constant. SUBSYSTEM=="tty",ENV{ID_PATH}=="platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.1:1.0",SYMLINK+="ttyUSB01" SUBSYSTEM=="tty",ENV{ID_PATH}=="platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0",SYMLINK+="ttyUSB02" SUBSYSTEM=="tty",ENV{ID_PATH}=="platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0",SYMLINK+="ttyUSB03" SUBSYSTEM=="tty",ENV{ID_PATH}=="platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0",SYMLINK+="ttyUSB04" The result when listing the USB ports on my RPi4 is: $ ll /dev/ttyU* crw-rw---- 1 root dialout 188, 0 Oct 6 12:33 /dev/ttyUSB0 lrwxrwxrwx 1 root root 7 Sep 24 10:09 /dev/ttyUSB01 -> ttyUSB0 lrwxrwxrwx 1 root root 7 Oct 6 12:29 /dev/ttyUSB03 -> ttyUSB1 crw-rw---- 1 root dialout 188, 1 Oct 6 15:08 /dev/ttyUSB1 As you can see here ttyUSB01 is the first plugged in adapter and ttyUSB03 is the second. Had I reversed the order of plugging them the base name would have changed but the proper one could be accessed via the socket based name. But these symlinks do not show up in the command above since the group of these symlinks is not set to dialout, it is root... And to get them into the system one has to edit the rules file... This in itself is a non-obvious task since one has to find the hardware ID of each USB port in the system... -- Bo Berglund Developer in Sweden From lazarus at mfriebe.de Wed Oct 7 13:23:19 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Wed, 7 Oct 2020 13:23:19 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> Message-ID: <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> On 07/10/2020 01:42, Maxim Ganetsky via lazarus wrote: > 06.10.2020 16:23, Martin Frb via lazarus пишет: >> On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote: >>> >>> ---- >>> Can you try to catch it in the debugger, and see what params are given >>> to NewTextOut >>> in >>> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., >>> parentfp=0x13abf6e8) >>>      at lazsyntextarea.pp:1741 >>> >>>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok, >>> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); >>> Can you add some debugln in a format convenient to you? This will >>> simplify things, I think. >>> >> This is in the paint handler, and it is called for each token. So >> potentially very slow with debugln. >> >> But since it is in startup, hopefully you wont have to many. >> >> Apply this patch please > > > With this patch applied Lazarus seems to crash on debugln in > lazsyntextarea.pp. Just in case, I tried to remove this particular > debugln, then it printed 'BEFORE' and nothing more. Sorry my fault, I thought I had all the nil checks.... Please replace that debugln with debugln('Calling NewTextOut L: %s rcT: %s tok: %s tkt: %s // %s // eto: %s', [dbgs(TxtLeft), dbgs(rcToken), dbgs(tok), dbgMemRange(PByte(ATokenInfo.Tk.TokenStart), ATokenInfo.Tk.TokenLength), dbgs(ATokenInfo.Tk.TokenLength), dbgs(FEtoBuf<>nil) ]); From mailinglists at geldenhuys.co.uk Thu Oct 8 01:16:29 2020 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Thu, 8 Oct 2020 00:16:29 +0100 Subject: [Lazarus] Feature Request: Override/Implement methods Message-ID: <01d22f7a-748d-e44a-1c96-765f10916638@geldenhuys.co.uk> Hi, I've pulled the latest Lazarus code and went through all the menu items I could find but could see what I was looking for. Does Lazarus have a feature eg: (Editor -> Source [popup menu] -> Override/Implement Methods) so the IDE could stub out say missing methods from a Interface I listed in the class definition, or allow to override methods from parent classes? Attached is a screenshop of Eclipse (Java IDE) where it will generate stub code for a new "QuackBehaviour" interface I specified in the class I'm currently editing. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2020-10-08 00-01-00.png Type: image/png Size: 14481 bytes Desc: not available URL: From lazarus at mfriebe.de Thu Oct 8 01:36:23 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 8 Oct 2020 01:36:23 +0200 Subject: [Lazarus] Feature Request: Override/Implement methods In-Reply-To: <01d22f7a-748d-e44a-1c96-765f10916638@geldenhuys.co.uk> References: <01d22f7a-748d-e44a-1c96-765f10916638@geldenhuys.co.uk> Message-ID: On 08/10/2020 01:16, Graeme Geldenhuys via lazarus wrote: > Hi, > > I've pulled the latest Lazarus code and went through all the menu items > I could find but could see what I was looking for. Does Lazarus have > a feature eg: (Editor -> Source [popup menu] -> Override/Implement Methods) > so the IDE could stub out say missing methods from a Interface I listed > in the class definition, or allow to override methods from parent classes? > AFAIK Closest we have is; Refactor > Abstract Methods. Lists abstracts methods that are not overriden in this or parent class (i.e that would still be abstract in this class) From nc-gaertnma at netcologne.de Thu Oct 8 02:02:30 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Thu, 8 Oct 2020 02:02:30 +0200 Subject: [Lazarus] Feature Request: Override/Implement methods In-Reply-To: References: <01d22f7a-748d-e44a-1c96-765f10916638@geldenhuys.co.uk> Message-ID: <20201008020230.15a6aef7@limapholos.matflo.wg> On Thu, 8 Oct 2020 01:36:23 +0200 Martin Frb via lazarus wrote: > On 08/10/2020 01:16, Graeme Geldenhuys via lazarus wrote: > > Hi, > > > > I've pulled the latest Lazarus code and went through all the menu > > items I could find but could see what I was looking for. Does > > Lazarus have a feature eg: (Editor -> Source [popup menu] -> > > Override/Implement Methods) so the IDE could stub out say missing > > methods from a Interface I listed in the class definition, or allow > > to override methods from parent classes? > > AFAIK Closest we have is; Refactor > Abstract Methods. > > Lists abstracts methods that are not overriden in this or parent > class (i.e that would still be abstract in this class) As for overrides: Insert a new line in the class declaration, Ctrl+Space, select the parent method. This will create an override. Mattias From marc at dommelstein.nl Thu Oct 8 09:09:28 2020 From: marc at dommelstein.nl (Marc Weustink) Date: Thu, 8 Oct 2020 09:09:28 +0200 Subject: [Lazarus] Feature Request: Override/Implement methods In-Reply-To: <20201008020230.15a6aef7@limapholos.matflo.wg> References: <01d22f7a-748d-e44a-1c96-765f10916638@geldenhuys.co.uk> <20201008020230.15a6aef7@limapholos.matflo.wg> Message-ID: <862b39f9-5efe-f100-3a3b-c148cde042cc@dommelstein.nl> On 8-10-2020 02:02, Mattias Gaertner via lazarus wrote: > On Thu, 8 Oct 2020 01:36:23 +0200 > Martin Frb via lazarus wrote: > >> On 08/10/2020 01:16, Graeme Geldenhuys via lazarus wrote: >>> Hi, >>> >>> I've pulled the latest Lazarus code and went through all the menu >>> items I could find but could see what I was looking for. Does >>> Lazarus have a feature eg: (Editor -> Source [popup menu] -> >>> Override/Implement Methods) so the IDE could stub out say missing >>> methods from a Interface I listed in the class definition, or allow >>> to override methods from parent classes? >> >> AFAIK Closest we have is; Refactor > Abstract Methods. >> >> Lists abstracts methods that are not overriden in this or parent >> class (i.e that would still be abstract in this class) > > As for overrides: > Insert a new line in the class declaration, Ctrl+Space, select the > parent method. This will create an override. DUH... learning every day. Marc From lazarus at kluug.net Thu Oct 8 09:12:57 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Thu, 8 Oct 2020 09:12:57 +0200 Subject: [Lazarus] Feature Request: Override/Implement methods In-Reply-To: <20201008020230.15a6aef7@limapholos.matflo.wg> References: <01d22f7a-748d-e44a-1c96-765f10916638@geldenhuys.co.uk> <20201008020230.15a6aef7@limapholos.matflo.wg> Message-ID: <57df1650-cd3b-655e-afd3-216a8fd228fd@kluug.net> On 08.10.2020 02:02, Mattias Gaertner via lazarus wrote: > As for overrides: > Insert a new line in the class declaration, Ctrl+Space, select the > parent method. This will create an override. And the same goes for interfaces. Ctrl+Space offers methods from interfaces as well. Ondrej From ganmax at narod.ru Fri Oct 9 00:55:42 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Fri, 9 Oct 2020 01:55:42 +0300 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> Message-ID: <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> 07.10.2020 14:23, Martin Frb via lazarus пишет: > On 07/10/2020 01:42, Maxim Ganetsky via lazarus wrote: >> 06.10.2020 16:23, Martin Frb via lazarus пишет: >>> On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote: >>>> >>>> ---- >>>> Can you try to catch it in the debugger, and see what params are given >>>> to NewTextOut >>>> in >>>> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=..., >>>> parentfp=0x13abf6e8) >>>>      at lazsyntextarea.pp:1741 >>>> >>>>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok, >>>> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf); >>>> Can you add some debugln in a format convenient to you? This will >>>> simplify things, I think. >>>> >>> This is in the paint handler, and it is called for each token. So >>> potentially very slow with debugln. >>> >>> But since it is in startup, hopefully you wont have to many. >>> >>> Apply this patch please >> >> >> With this patch applied Lazarus seems to crash on debugln in >> lazsyntextarea.pp. Just in case, I tried to remove this particular >> debugln, then it printed 'BEFORE' and nothing more. > > Sorry my fault, I thought I had all the nil checks.... > Please replace that debugln with > > debugln('Calling NewTextOut L: %s rcT: %s tok: %s tkt: %s // %s // eto: > %s', [dbgs(TxtLeft), dbgs(rcToken), dbgs(tok), > dbgMemRange(PByte(ATokenInfo.Tk.TokenStart), ATokenInfo.Tk.TokenLength), > dbgs(ATokenInfo.Tk.TokenLength), dbgs(FEtoBuf<>nil) ]); I got the following output: i:\FPC\lazarus>lazarus Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="C:\Users\Maxim \AppData\Local\lazarus" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="i:\FPC\lazar us" Hint: (lazarus) [TMainIDE.LoadGlobalOptions] Hint: (lazarus) LastCalled="I:\FPC\lazarus\lazarus.old.working.exe" Hint: (lazarus) CurPrgName="i:\FPC\lazarus\lazarus.exe" Hint: (lazarus) AltPrgName="C:\Users\Maxim\AppData\Local\lazarus\bin\lazarus.exe " Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 New=i386-win 32-win32 Changed: OS/CPU=True LCL=False Calling NewTextOut L: 71 rcT: l=71,t=36,r=85,b=54 tok: l=71,t=36,r=85,b=54 tkt: 2020 // 2 // eto: False BEFORE -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From lazarus at mfriebe.de Fri Oct 9 03:14:32 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 9 Oct 2020 03:14:32 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> Message-ID: On 09/10/2020 00:55, Maxim Ganetsky via lazarus wrote: > Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 > New=i386-win > 32-win32 Changed: OS/CPU=True LCL=False > Calling NewTextOut L: 71 rcT: l=71,t=36,r=85,b=54 tok: > l=71,t=36,r=85,b=54 tkt: > 2020 // 2 // eto: False > BEFORE > That output looks all ok. I concluded from the output that you have a 32 bit IDE. So I checked => 32 bit IDE crashes for me too. From the bit of debugging I have done, this may be a stack corruption. I had cases where the OS returned to NewTextOut (even though indicating that GetCharacterPlacementW failed), but NewTextOut crashed on exit. (either in its internal finally handler, or on actually returning to parent) Interestingly on Win10 a 32bit IDE - while not crashing - does not display ligatures. The call to GetCharacterPlacementW returns failed. Anyway, I squeezed this in, under the assumption it might be a quick solution. So this will have to go back on the todo list. If someone has any worthwhile idea what might cause the issue.... From lazarus at mfriebe.de Fri Oct 9 04:09:22 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 9 Oct 2020 04:09:22 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> Message-ID: <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> On 09/10/2020 03:14, Martin Frb via lazarus wrote: > On 09/10/2020 00:55, Maxim Ganetsky via lazarus wrote: >> Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 >> New=i386-win >> 32-win32 Changed: OS/CPU=True LCL=False >> Calling NewTextOut L: 71 rcT: l=71,t=36,r=85,b=54 tok: >> l=71,t=36,r=85,b=54 tkt: >> 2020 // 2 // eto: False >> BEFORE >> > > That output looks all ok. > > I concluded from the output that you have a 32 bit IDE. > So I checked => 32 bit IDE crashes for me too. > From the bit of debugging I have done, this may be a stack corruption. > I had cases where the OS returned to NewTextOut (even though > indicating that GetCharacterPlacementW failed), but NewTextOut crashed > on exit. (either in its internal finally handler, or on actually > returning to parent) > > Interestingly on Win10 a 32bit IDE - while not crashing - does not > display ligatures. The call to GetCharacterPlacementW returns failed. One more think Lazarus build with 32bit 3.0.4 on win 7 does not crash. (But ligatures do not work either). From lazarus at mfriebe.de Fri Oct 9 04:33:38 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 9 Oct 2020 04:33:38 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <54009597.989770.1601610886473@mail.yahoo.com> <466cbb2e-fadd-def8-205f-1e4feeed64f0@mfriebe.de> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> Message-ID: It might be dead simple (at least I hope) {$IFDEF WINDOWS_LIGATURE} function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount, nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD): DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW'; {$ENDIF} Add stdcall. At least on win10 that makes 32bit working. Not booting up win 7 again. I took the declaration from the windows units in fpc => which has some wrongly typed params that I adjusted. But it also does not have stdcall. From lazarus at kluug.net Fri Oct 9 09:06:10 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Fri, 9 Oct 2020 09:06:10 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> Message-ID: <02f119bd-3375-b3de-f897-69dbde9525e9@kluug.net> On 09.10.2020 04:33, Martin Frb via lazarus wrote: > It might be dead simple (at least I hope) > > {$IFDEF WINDOWS_LIGATURE} > function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount, > nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD): > DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW'; > {$ENDIF} > > Add stdcall. Yes, the stdcall fixes the crash for me on Windows 10 64bit & Lazarus IDE 32bit. But the ligatures are not very promising. I get ':=' as ligature but nothing else. Ondrej From marc at dommelstein.nl Fri Oct 9 11:43:31 2020 From: marc at dommelstein.nl (Marc Weustink) Date: Fri, 9 Oct 2020 11:43:31 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> Message-ID: <13c4908c-ec1a-fe42-d24e-bf4bb676e3c5@dommelstein.nl> On 9-10-2020 04:33, Martin Frb via lazarus wrote: > It might be dead simple (at least I hope) > > {$IFDEF WINDOWS_LIGATURE} > function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount, > nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD): > DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW'; > {$ENDIF} > > Add stdcall. > > At least on win10 that makes 32bit working. Not booting up win 7 again. > > I took the declaration from the windows units in fpc => which has some > wrongly typed params that I adjusted. > But it also does not have stdcall. All winapi calls should have stdcall, at least the ones without are suspicious (iirc for win64 we use the same calling convention so you might not notice) Marc From fpc at pascalprogramming.org Fri Oct 9 13:00:10 2020 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Fri, 9 Oct 2020 13:00:10 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> Message-ID: Op 2020-10-09 om 04:33 schreef Martin Frb via lazarus: > > > I took the declaration from the windows units in fpc => which has some > wrongly typed params that I adjusted. > But it also does not have stdcall. Windows unit has {$calling stdcall} globally From lazarus at mfriebe.de Fri Oct 9 14:11:01 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 9 Oct 2020 14:11:01 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <02f119bd-3375-b3de-f897-69dbde9525e9@kluug.net> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> <02f119bd-3375-b3de-f897-69dbde9525e9@kluug.net> Message-ID: <64eb9e22-bb15-8d48-c963-8796220baeb4@mfriebe.de> On 09/10/2020 09:06, Ondrej Pokorny via lazarus wrote: > > But the ligatures are not very promising. I get ':=' as ligature but > nothing else. You probably will see more inside comments or strings, or if the highlighter is off. In my tests, I did get in normal pascal source <= >= .. But not ... or => The latter are not a single token to the highlighter, so they get broken into text fragments. From lazarus at kluug.net Fri Oct 9 14:28:51 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Fri, 9 Oct 2020 14:28:51 +0200 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: <64eb9e22-bb15-8d48-c963-8796220baeb4@mfriebe.de> References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> <02f119bd-3375-b3de-f897-69dbde9525e9@kluug.net> <64eb9e22-bb15-8d48-c963-8796220baeb4@mfriebe.de> Message-ID: On 09.10.2020 14:11, Martin Frb via lazarus wrote: > On 09/10/2020 09:06, Ondrej Pokorny via lazarus wrote: >> But the ligatures are not very promising. I get ':=' as ligature but >> nothing else. > > You probably will see more inside comments or strings, or if the > highlighter is off. > > In my tests, I did get in normal pascal source <= >= .. > But not ... or => > > The latter are not a single token to the highlighter, so they get > broken into text fragments. Ah, that's true. Ondrej From ganmax at narod.ru Sat Oct 10 00:28:14 2020 From: ganmax at narod.ru (Maxim Ganetsky) Date: Sat, 10 Oct 2020 01:28:14 +0300 Subject: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]] In-Reply-To: References: <54009597.989770.1601610886473.ref@mail.yahoo.com> <2185897a-99fe-cf68-0dfa-3fa2bcf583f1@googlemail.com> <3bc622bc-89fc-6314-facb-3accc5739b53@ya.ru> <125995113.1541726.1601799288108@mail.yahoo.com> <967505ac-1b07-e678-7277-67af961cd996@mfriebe.de> <64667ea2-23a2-05f7-be04-76642c0d2639@narod.ru> <7c0cdd48-c0b1-dcbb-45c2-ffe59db4d3cf@mfriebe.de> <2ca043ae-9611-dc4f-9750-ddae29434c27@narod.ru> <82723079-8742-d336-ac7c-9a6e468d2107@mfriebe.de> <05a46f7e-8c7a-e452-e7f6-f791f1c7e001@narod.ru> <2673dc0e-2eb1-de0d-e906-46e34228e1f9@mfriebe.de> Message-ID: 09.10.2020 5:33, Martin Frb via lazarus пишет: > It might be dead simple (at least I hope) > > {$IFDEF WINDOWS_LIGATURE} > function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount, > nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD): > DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW'; > {$ENDIF} > > Add stdcall. > > At least on win10 that makes 32bit working. Not booting up win 7 again. Yes, my IDE is 32 bit. It works now correctly for me on Win7 too. Thanks! -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From bo.berglund at gmail.com Sun Oct 11 21:11:10 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 11 Oct 2020 21:11:10 +0200 Subject: [Lazarus] Debugging in Lazarus, cannot inspect values at breakpoints... References: Message-ID: On Tue, 29 Sep 2020 17:49:47 +0200, Bo Berglund via lazarus wrote: >So I am debugging an application that transfers data over a socket >connection. I want to inspect received data so I put a breakpoint in >the method that does the handling of the response. >But when I get there and want to see what has been received Lazarus >does not show it... When I posted this thread there were a lot of responses that went way above my head... Now I am debugging the application where the state of some buttons are set depending on conditions. But again I am unable to inspect what the button state is when I have stopped on a breakpont in the code. One simple example: procedure TfrmSSRemoteClient.elvTasksItemSelect(Sender: TObject; Item: TListItem; Index: Integer); begin btnDeleteTask.Enabled := true; btnTaskProperties.Enabled := true; btnEditTask.Enabled := true; btnStopTask.Enabled := Item.SubItems[1] = '1'; btnRunNow.Enabled := Item.SubItems[1] = '0'; end; For example if I step through this simple piece of code and hover on the Enabled keyword on the line above or on the same line there is only a message popping up: Type TBITBTN has no component named ENABLED..... According to my memory Enabled for buittons has existed from Delphi1 and onwards and I am pretty sure that it also exists in Lazarus/FPC... Why can I not see the state of the buttons while debugging? I am using Lazarus 2.0.8/FPC 3.0.4 on Windows 10 installed using the official installer. Please help with whatever customization I need to do in Lazarus to enable this seemingly natural function while debugging! It is driving me nuts. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Tue Oct 13 10:15:46 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 13 Oct 2020 10:15:46 +0200 Subject: [Lazarus] What to replace Application.Processmessages with? Message-ID: I have been working some time to convert a rather big Delphi2007 Windows service application to a regular Linux program possible to run as a Linux systemd service. In Linux I was told that the application needs to be a regular program to run in a non-logged on setting on a Linux server (without desktop). So I have come a long way now and it feels like i am in the final stretch. All of the TCP/IP socket communications to a client config app and handling of serial ports and digital I/O has been solved. The program runs OK at its core as a non-gui app and I can use the existing client application on Windows to talk to it and configure the system etc. But now when I approach the actual core of the service, the ability to run a longish task on external hardware while still being able to handle incoming client requests etc I have found a possible problem... The original server on Windows was built as a TService application and had the GUI support maybe via a Delphi data module or otherwise so the Application object is available. I had to change this to a simple program instead and so I lost the Application object. In a lot of places in the task execution code there are Application.Processmessages in wait loops and these I had to switch off via a conditional named GUI_MODE and instead I have a sleep(T) call there. Example: while FContactResTestRunning and not FCancelOp do begin {$IFDEF GUI_MODE} Application.ProcessMessages; {$ENDIF} Sleep(50); end; Here the booleans FContactResTestRunning and FCancelOp are supposed to be set in the main application on reception of certain events. NOTICE: The class file where all of this is coded is also used in a GUI application on Windows where the user communicates with the instrumentation manually from the app. In that setting Application is available and all works well. The service application itself (from 2004) is based on timers to perform things like execution of the measurement task itself in order to isolate that from the main application. That is why there is Application.Processmessages inside the wait loops so that things like reception of RS232 messages from the equipment can be handled and analyzed and flags be set which are waited for in the timer... The TTimer objects have been replaced by TFpTimer objects in the ported code and this seems to work fine, whereas TTimer does not. I know that the system should have been designed using threads instead, but that is not there and it is probably a too difficult project to try and replace the current structure with threads. Now I wonder if I could put something else into the loops so that the main object of Application.Processmessages will be handled, namely to let event functions run as needed. Can I for example use CheckSynchronize in these loops? I.e. Application.Processmessages ==> CheckSynchronize? Or is there any other way? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Tue Oct 13 11:29:06 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 13 Oct 2020 11:29:06 +0200 Subject: [Lazarus] What to replace Application.Processmessages with? Message-ID: <003601d6a143$4c80d280$e5827780$@gmail.com> (Tried posting this via GMane but it does not appear so now sending email instead) I have been working some time to convert a rather big Delphi2007 Windows service application to a regular Linux program possible to run as a Linux systemd service. In Linux I was told that the application needs to be a regular program to run in a non-logged on setting on a Linux server (without desktop). So I have come a long way now and it feels like i am in the final stretch. All of the TCP/IP socket communications to a client config app and handling of serial ports and digital I/O has been solved. The program runs OK at its core as a non-gui app and I can use the existing client application on Windows to talk to it and configure the system etc. But now when I approach the actual core of the service, the ability to run a longish task on external hardware while still being able to handle incoming client requests etc I have found a possible problem... The original server on Windows was built as a TService application and had the GUI support maybe via a Delphi data module or otherwise so the Application object is available. I had to change this to a simple program instead and so I lost the Application object. In a lot of places in the task execution code there are Application.Processmessages in wait loops and these I had to switch off via a conditional named GUI_MODE and instead I have a sleep(T) call there. Example: while FContactResTestRunning and not FCancelOp do begin {$IFDEF GUI_MODE} Application.ProcessMessages; {$ENDIF} Sleep(50); end; Here the booleans FContactResTestRunning and FCancelOp are supposed to be set in the main application on reception of certain events. NOTICE: The class file where all of this is coded is also used in a GUI application on Windows where the user communicates with the instrumentation manually from the app. In that setting Application is available and all works well. The service application itself (from 2004) is based on timers to perform things like execution of the measurement task itself in order to isolate that from the main application. That is why there is Application.Processmessages inside the wait loops so that things like reception of RS232 messages from the equipment can be handled and analyzed and flags be set which are waited for in the timer... The TTimer objects have been replaced by TFpTimer objects in the ported code and this seems to work fine, whereas TTimer does not. I know that the system should have been designed using threads instead, but that is not there and it is probably a too difficult project to try and replace the current structure with threads. Now I wonder if I could put something else into the loops so that the main object of Application.Processmessages will be handled, namely to let event functions run as needed. Can I for example use CheckSynchronize in these loops? I.e. Application.Processmessages ==> CheckSynchronize? Or is there any other way? /Bo B, Sweden -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaa5500 at ya.ru Wed Oct 14 19:17:52 2020 From: aaa5500 at ya.ru (AlexeyT) Date: Wed, 14 Oct 2020 20:17:52 +0300 Subject: [Lazarus] Font "default_mono" Message-ID: I suggest to introduce LCL font "default_mono"(we have "default" font only): - on first access to getter/resolver, and find some monospaced font: a) if font list has "Courier" or "Courier new" or "Consolas", we take it (to support Win32 usual font) b) if no usual names found (case for *BSD+Solaris+Wine) we enumerate font list, find some, by testing Canvas.TextWidth('W')=Canvas.TextWidth('i'). The problem here is - we don't have some Canvas in getter - on next access to getter, we return calculated name. - I can find the avg time of this action (step b) on Linux/BSD/Solaris, if it's needed Alexey Torgashin From juha.manninen62 at gmail.com Fri Oct 16 15:00:32 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Fri, 16 Oct 2020 16:00:32 +0300 Subject: [Lazarus] Object Inspector, FValueFont and FDefaultValueFont Message-ID: Regarding issue : https://bugs.freepascal.org/view.php?id=37901 I improved the property name/value hints in OI. I had to comment out code that selects FValueFont or FDefaultValueFont. The relevant code is below. Q: How to get a font with negated color? Does it even make sense to tweak it? The hint works OK with the default color now. I ask in case somebody knows the topic well. I did not study what Editor.ValueIsStreamed means. It never triggered in my tests. Regards, Juha --- procedure DoShow(pt: TPoint); inline; //var HintFont: TFont; begin if WidgetSet.GetLCLCapability(lcTransparentWindow)=LCL_CAPABILITY_NO then Inc(pt.Y, fPropRow.Height); { By Juha : FValueFont and FDefaultValueFont are nearly unreadable. We should maybe get their negated color as the hint background is black. if HintType<>pehValue then HintFont := Screen.HintFont else if fPropRow.Editor.ValueIsStreamed then HintFont:=FValueFont else HintFont:=FDefaultValueFont; } FHintManager.ShowHint(ClientToScreen(pt), TheHint, False{, HintFont}); if FHintManager.CurHintWindow<>nil then FHintManager.CurHintWindow.OnMouseLeave := @HintMouseLeave; end; -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at z505.com Sun Oct 18 19:18:02 2020 From: noreply at z505.com (noreply at z505.com) Date: Sun, 18 Oct 2020 12:18:02 -0500 Subject: [Lazarus] TTimer simple issue Message-ID: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> When building a simple TTimer demo I cannot seem to get it working Any idea what the problem could be if you paste this code into your form with a memo? var TimeSpent: integer; procedure TForm2.Button1Click(Sender: TObject); var i, answer: integer; begin Timer1.enabled := false; TimeSpent := 0; Timer1.Enabled := true; Timer1.interval := 1; for i := 0 to 999999999 do begin answer := i * answer; end; memo1.lines.add('time spent: ' + inttostr(timespent)); end; procedure TForm2.Timer1Timer(Sender: TObject); begin inc(TimeSpent); end; It says time spent: 0 Whereas the time should be a lot. Regards, Lars From larrydalton71 at gmail.com Mon Oct 19 20:06:58 2020 From: larrydalton71 at gmail.com (larrydalton71) Date: Mon, 19 Oct 2020 14:06:58 -0400 Subject: [Lazarus] I use the Windows procedure WinExec() to open directries and files out of a lazarus application on a Windows box. I also use the same application in a Linux mint box. Is there a procedure in Lazarus or Linux to replace or mimic WinExec? Message-ID: <5f8dd5c4.1c69fb81.244cf.1f9d@mx.google.com> Sent from my Verizon, Samsung Galaxy smartphone -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sun Oct 25 10:35:53 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 25 Oct 2020 10:35:53 +0100 Subject: [Lazarus] Checking Lazarus list response Message-ID: <000001d6aab2$3c0d8d30$b428a790$@gmail.com> This message is a test of the Lazarus mail list to see if it is really down. No messages have appeared in the GMane mirror server for over 2 weeks now... -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Sun Oct 25 10:38:30 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 25 Oct 2020 10:38:30 +0100 Subject: [Lazarus] Test1 Message-ID: <20201025103830.308edbf1@limapholos.matflo.wg> From marc at dommelstein.nl Mon Oct 26 10:32:47 2020 From: marc at dommelstein.nl (Marc Weustink) Date: Mon, 26 Oct 2020 10:32:47 +0100 Subject: [Lazarus] Test Message-ID: <10413740-e0ec-096a-133d-97e8827b238f@dommelstein.nl> Test From luca at wetron.es Mon Oct 26 11:27:40 2020 From: luca at wetron.es (Luca Olivetti) Date: Mon, 26 Oct 2020 11:27:40 +0100 Subject: [Lazarus] TTimer simple issue In-Reply-To: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> References: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> Message-ID: <2d4bb535-01af-f9a4-b2d8-cd70e91eb278@wetron.es> El 18/10/20 a les 19:18, Lars via lazarus ha escrit: > When building a simple TTimer demo I cannot seem to get it working > > Any idea what the problem could be if you paste this code into your form > with a memo? > > var >   TimeSpent: integer; > > procedure TForm2.Button1Click(Sender: TObject); > var >   i, answer: integer; > begin >   Timer1.enabled := false; >   TimeSpent := 0; >   Timer1.Enabled := true; >   Timer1.interval := 1; >   for i := 0 to 999999999 do >   begin >     answer := i * answer; >   end; > >   memo1.lines.add('time spent: ' + inttostr(timespent)); > > end; > > procedure TForm2.Timer1Timer(Sender: TObject); > begin >   inc(TimeSpent); > end; > > It says > time spent: 0 > Whereas the time should be a lot. No, since your loop is busy waiting the Timer1Timer method is never fired. Events are only processed in the main gui loop. You could add an "Application.Processmessages" inside your loop but you must know what you are doing (e.g. you could click again button1 and that's not desirable). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From lazarus at mfriebe.de Mon Oct 26 11:29:06 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 26 Oct 2020 11:29:06 +0100 Subject: [Lazarus] Debugging in Lazarus, cannot inspect values at breakpoints... In-Reply-To: References: Message-ID: On 11/10/20 21:11, Bo Berglund via lazarus wrote: > > Type TBITBTN has no component named ENABLED..... Enabled is a *property* Fpc currently does not add debug-info for properties at all. You can inspect only fields and variables. The only exception is: when the project (or package) settings specify "dwarf" debug info type *AND* the property does not have a "getter function", but instead directly accesses the field "read FEnabled". ------------ Unfortunately the debugger can not yet call functions (e.g. GetEnabled) yet. Work for this is in progress, as part of fpdebug. But not yet use-able. From bartjunk64 at gmail.com Mon Oct 26 11:59:42 2020 From: bartjunk64 at gmail.com (Bart) Date: Mon, 26 Oct 2020 11:59:42 +0100 Subject: [Lazarus] I use the Windows procedure WinExec() to open directries and files out of a lazarus application on a Windows box. I also use the same application in a Linux mint box. Is there a procedure in Lazarus or Linux to replace or mimic WinExec? In-Reply-To: <5f8dd5c4.1c69fb81.244cf.1f9d@mx.google.com> References: <5f8dd5c4.1c69fb81.244cf.1f9d@mx.google.com> Message-ID: On Mon, Oct 26, 2020 at 10:34 AM larrydalton71 via lazarus wrote: Is there anything wrong with TOpenDialog or TSelectDirectoryDialog? And what exactly does "open a file" mean in your situation (open it in your application, let windows open it in the default associated application, something else)? Oh, and please don't use such a big font, it is the equivalent of shouting... -- Bart From michael at freepascal.org Mon Oct 26 13:00:26 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 26 Oct 2020 13:00:26 +0100 (CET) Subject: [Lazarus] What to replace Application.Processmessages with? In-Reply-To: References: Message-ID: On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote: > Now I wonder if I could put something else into the loops so that the > main object of Application.Processmessages will be handled, namely to > let event functions run as needed. > Can I for example use CheckSynchronize in these loops? > > I.e. Application.Processmessages ==> CheckSynchronize? Based on your description, that is all you need to do. But I would create a routine Procedure HandleMainLoop; begin {$IFDEF NOGUI} CheckSynchronize; {$ELSE} Application.ProcessMessages; {$ENDIF} end; And call that both in GUI and NOGUI. Michael. From pascaldragon at googlemail.com Mon Oct 26 14:11:01 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Mon, 26 Oct 2020 14:11:01 +0100 Subject: [Lazarus] I use the Windows procedure WinExec() (...) In-Reply-To: References: <5f8dd5c4.1c69fb81.244cf.1f9d@mx.google.com> Message-ID: Bart via lazarus schrieb am Mo., 26. Okt. 2020, 12:00: > On Mon, Oct 26, 2020 at 10:34 AM larrydalton71 via lazarus > wrote: > > Is there anything wrong with TOpenDialog or TSelectDirectoryDialog? > And what exactly does "open a file" mean in your situation (open it in > your application, let windows open it in the default associated > application, something else)? > > Oh, and please don't use such a big font, it is the equivalent of > shouting... > The problem is not the font, the problem is that the user's message is completely contained inside the Subject instead of the body... 🙄 (and at least in the Android GMail app the Subject of the first mail of a thread is rendered with a larger font) Regards, Sven > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Tue Oct 27 10:34:38 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 27 Oct 2020 10:34:38 +0100 Subject: [Lazarus] Fixed-pitch font on windows with difference between 1 and l in code editor? Message-ID: I am trying to find a font to use in the code editor window on Lazarus 2.0.10 on Windows 10 x64 where I can see a difference between 1 and l (number and letter). The closest I have gotten is Lucida Console, but it uses extra space between letters making the lines un-necessarily rather long.... Is there another suitable coding font that has a fixed pitch and is showing a visible difference between the 20 characters? -- Bo Berglund Developer in Sweden From fjf.vanleeuwen at quicknet.nl Tue Oct 27 10:42:48 2020 From: fjf.vanleeuwen at quicknet.nl (frans) Date: Tue, 27 Oct 2020 10:42:48 +0100 Subject: [Lazarus] Fixed-pitch font on windows with difference between 1 and l in code editor? In-Reply-To: References: Message-ID: I'm using Courier New. mvg Frans van Leeuwen M 06-51695390 Op 27-10-2020 om 10:34 schreef Bo Berglund via lazarus: > I am trying to find a font to use in the code editor window on Lazarus > 2.0.10 on Windows 10 x64 where I can see a difference between 1 and l > (number and letter). > The closest I have gotten is Lucida Console, but it uses extra space > between letters making the lines un-necessarily rather long.... > > Is there another suitable coding font that has a fixed pitch and is > showing a visible difference between the 20 characters? > > -- Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com From svaa at ciberpiula.net Tue Oct 27 13:27:49 2020 From: svaa at ciberpiula.net (Santiago A.) Date: Tue, 27 Oct 2020 13:27:49 +0100 Subject: [Lazarus] TTimer simple issue In-Reply-To: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> References: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> Message-ID: <599f94bb-37f1-e00c-c996-3adf40892a40@ciberpiula.net> El 18/10/2020 a las 19:18, Lars via lazarus escribió: > When building a simple TTimer demo I cannot seem to get it working > > Any idea what the problem could be if you paste this code into your > form with a memo? > > var >   TimeSpent: integer; > > procedure TForm2.Button1Click(Sender: TObject); > var >   i, answer: integer; > begin >   Timer1.enabled := false; >   TimeSpent := 0; >   Timer1.Enabled := true; >   Timer1.interval := 1; >   for i := 0 to 999999999 do >   begin >     answer := i * answer; >   end; > >   memo1.lines.add('time spent: ' + inttostr(timespent)); > > end; > > procedure TForm2.Timer1Timer(Sender: TObject); > begin >   inc(TimeSpent); > end; > > It says > time spent: 0 > Whereas the time should be a lot. > > Regards, > Lars I don't know what are you trying to do, but if you are trying to find out how long it takes certain process, you should try other approach. Timer is low precision and it is only fired by events, so you must process event's queue. A first and bad approach: for i := 0 to 999999999 do begin    answer := i * answer;    application.processmessages; //<-- process event queue end; But this is very not a very efficient way. The best is to get the start time, get the end time and subtract. var StartTime,EndTime:TDataTime; i, answer: integer; begin StartTime:=now;  for i := 0 to 999999999 do begin     answer := i * answer; end; EndTime:=now; memo1.lines.add('time spent: ' + TimeToStr(EndTime-StarTime) ); end; But TDateTime is not accurate at all if you are measuring short periods (milliseconds). EpikTimer is a component with much better precision. https://wiki.lazarus.freepascal.org/EpikTimer -- Saludos Santiago A. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Tue Oct 27 13:40:07 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Tue, 27 Oct 2020 13:40:07 +0100 Subject: [Lazarus] Fixed-pitch font on windows with difference between 1 and l in code editor? In-Reply-To: References: Message-ID: <86d239b2-db2c-6ff2-bd9d-18468d954c9b@mfriebe.de> On 27/10/20 10:34, Bo Berglund via lazarus wrote: > I am trying to find a font to use in the code editor window on Lazarus > 2.0.10 on Windows 10 x64 where I can see a difference between 1 and l > (number and letter). I think you can also use "user defined markup" to make all "1" (one) bold or italic...... or color them (that includes inside words, strings, comments..... From kadissov.e at gmail.com Tue Oct 27 13:46:35 2020 From: kadissov.e at gmail.com (=?UTF-8?B?0JXQstCz0LXQvdC40Lkg0JrQsNC00LjRgdC+0LI=?=) Date: Tue, 27 Oct 2020 15:46:35 +0300 Subject: [Lazarus] TTimer simple issue In-Reply-To: <599f94bb-37f1-e00c-c996-3adf40892a40@ciberpiula.net> References: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> <599f94bb-37f1-e00c-c996-3adf40892a40@ciberpiula.net> Message-ID: The problem of your code is that the variable is not initialized. Regards Evgueny вт, 27 окт. 2020 г. в 15:28, Santiago A. via lazarus < lazarus at lists.lazarus-ide.org>: > El 18/10/2020 a las 19:18, Lars via lazarus escribió: > > When building a simple TTimer demo I cannot seem to get it working > > Any idea what the problem could be if you paste this code into your form > with a memo? > > var > TimeSpent: integer; > > procedure TForm2.Button1Click(Sender: TObject); > var > i, answer: integer; > begin > Timer1.enabled := false; > TimeSpent := 0; > Timer1.Enabled := true; > Timer1.interval := 1; > for i := 0 to 999999999 do > begin > answer := i * answer; > end; > > memo1.lines.add('time spent: ' + inttostr(timespent)); > > end; > > procedure TForm2.Timer1Timer(Sender: TObject); > begin > inc(TimeSpent); > end; > > It says > time spent: 0 > Whereas the time should be a lot. > > Regards, > Lars > > > I don't know what are you trying to do, but if you are trying to find out > how long it takes certain process, you should try other approach. Timer is > low precision and it is only fired by events, so you must process event's > queue. > > A first and bad approach: > > for i := 0 to 999999999 do > begin > answer := i * answer; > application.processmessages; //<-- process event queue > end; > > But this is very not a very efficient way. The best is to get the start > time, get the end time and subtract. > > var > StartTime,EndTime:TDataTime; > i, answer: integer; > begin > StartTime:=now; > for i := 0 to 999999999 do > begin > answer := i * answer; > end; > EndTime:=now; > memo1.lines.add('time spent: ' + TimeToStr(EndTime-StarTime) ); > end; > > But TDateTime is not accurate at all if you are measuring short periods > (milliseconds). > > EpikTimer is a component with much better precision. > > https://wiki.lazarus.freepascal.org/EpikTimer > > > -- > Saludos > > Santiago A. > > -- > _______________________________________________ > 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 coppolastudio at gmail.com Tue Oct 27 14:31:13 2020 From: coppolastudio at gmail.com (Salvatore Coppola) Date: Tue, 27 Oct 2020 14:31:13 +0100 Subject: [Lazarus] I use the Windows procedure WinExec() to open directries and files out of a lazarus application on a Windows box. I also use the same application in a Linux mint box. Is there a procedure in Lazarus or Linux to replace or mimic WinExec? In-Reply-To: <5f8dd5c4.1c69fb81.244cf.1f9d@mx.google.com> References: <5f8dd5c4.1c69fb81.244cf.1f9d@mx.google.com> Message-ID: Take a look at TProcess Regards ⁣Ottieni BlueMail per Android ​ Il giorno 26 Ott 2020, 10:34, alle ore 10:34, larrydalton71 via lazarus ha scritto: > >Sent from my Verizon, Samsung Galaxy smartphone > >------------------------------------------------------------------------ > >-- >_______________________________________________ >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 dhkblaszyk at gmail.com Tue Oct 27 14:40:27 2020 From: dhkblaszyk at gmail.com (Darius Blaszyk) Date: Tue, 27 Oct 2020 14:40:27 +0100 Subject: [Lazarus] TTimer simple issue In-Reply-To: References: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> <599f94bb-37f1-e00c-c996-3adf40892a40@ciberpiula.net> Message-ID: The first multiplication is when i = 0, so it should be ok. I am wondering though, the OP wants to calculate the factorial of 999999999. That would require a larger data type than an integer to store the result in! ;) On Tue, Oct 27, 2020 at 1:46 PM Евгений Кадисов via lazarus < lazarus at lists.lazarus-ide.org> wrote: > The problem of your code is that the variable is not > initialized. > Regards > Evgueny > > вт, 27 окт. 2020 г. в 15:28, Santiago A. via lazarus < > lazarus at lists.lazarus-ide.org>: > >> El 18/10/2020 a las 19:18, Lars via lazarus escribió: >> >> When building a simple TTimer demo I cannot seem to get it working >> >> Any idea what the problem could be if you paste this code into your form >> with a memo? >> >> var >> TimeSpent: integer; >> >> procedure TForm2.Button1Click(Sender: TObject); >> var >> i, answer: integer; >> begin >> Timer1.enabled := false; >> TimeSpent := 0; >> Timer1.Enabled := true; >> Timer1.interval := 1; >> for i := 0 to 999999999 do >> begin >> answer := i * answer; >> end; >> >> memo1.lines.add('time spent: ' + inttostr(timespent)); >> >> end; >> >> procedure TForm2.Timer1Timer(Sender: TObject); >> begin >> inc(TimeSpent); >> end; >> >> It says >> time spent: 0 >> Whereas the time should be a lot. >> >> Regards, >> Lars >> >> >> I don't know what are you trying to do, but if you are trying to find out >> how long it takes certain process, you should try other approach. Timer is >> low precision and it is only fired by events, so you must process event's >> queue. >> >> A first and bad approach: >> >> for i := 0 to 999999999 do >> begin >> answer := i * answer; >> application.processmessages; //<-- process event queue >> end; >> >> But this is very not a very efficient way. The best is to get the start >> time, get the end time and subtract. >> >> var >> StartTime,EndTime:TDataTime; >> i, answer: integer; >> begin >> StartTime:=now; >> for i := 0 to 999999999 do >> begin >> answer := i * answer; >> end; >> EndTime:=now; >> memo1.lines.add('time spent: ' + TimeToStr(EndTime-StarTime) ); >> end; >> >> But TDateTime is not accurate at all if you are measuring short periods >> (milliseconds). >> >> EpikTimer is a component with much better precision. >> >> https://wiki.lazarus.freepascal.org/EpikTimer >> >> >> -- >> Saludos >> >> Santiago A. >> >> -- >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Tue Oct 27 15:21:12 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 27 Oct 2020 15:21:12 +0100 Subject: [Lazarus] TTimer simple issue References: <5f801a95aade93b0bce4cba80e74ab9b@z505.com> <599f94bb-37f1-e00c-c996-3adf40892a40@ciberpiula.net> Message-ID: <2pagpf181o64o97bfdhe85odj2m8j8alt7@4ax.com> On Tue, 27 Oct 2020 14:40:27 +0100, Darius Blaszyk via lazarus wrote: >>> But this is very not a very efficient way. The best is to get the start >>> time, get the end time and subtract. >>> >>> var >>> StartTime,EndTime:TDataTime; >>> i, answer: integer; >>> begin >>> StartTime:=now; >>> for i := 0 to 999999999 do >>> begin >>> answer := i * answer; >>> end; >>> EndTime:=now; >>> memo1.lines.add('time spent: ' + TimeToStr(EndTime-StarTime) ); >>> end; >>> >>> But TDateTime is not accurate at all if you are measuring short periods >>> (milliseconds). var StartTime,EndTime: Int64; i, answer: integer; begin answer := 1; StartTime := GetTickCount64; for i := 0 to 999999999 do begin answer := i * answer; //What does this really do? end; EndTime := GetTickCount64; memo1.lines.add('ms spent: ' + IntToStr(EndTime-StartTime)); end; Now() is an extremely bad time source since it is really only fairly accurate to seconds. It also uses floating point so it is rounding. Int64 holds the same bumber of bits as a double but all of it is dedicated to the number. -- Bo Berglund Developer in Sweden From pascal at riekenberg.eu Tue Oct 27 16:17:19 2020 From: pascal at riekenberg.eu (Pascal Riekenberg) Date: Tue, 27 Oct 2020 16:17:19 +0100 (CET) Subject: [Lazarus] Fixed-pitch font on windows with difference between 1 and l in code editor? In-Reply-To: References: Message-ID: <675299581.33326.1603811840159@ox.hosteurope.de> I use Hack: https://sourcefoundry.org/hack/ Pascal > frans via lazarus hat am 27.10.2020 10:42 geschrieben: > > > I'm using Courier New. > > mvg > Frans van Leeuwen > M 06-51695390 > > Op 27-10-2020 om 10:34 schreef Bo Berglund via lazarus: > > I am trying to find a font to use in the code editor window on Lazarus > > 2.0.10 on Windows 10 x64 where I can see a difference between 1 and l > > (number and letter). > > The closest I have gotten is Lucida Console, but it uses extra space > > between letters making the lines un-necessarily rather long.... > > > > Is there another suitable coding font that has a fixed pitch and is > > showing a visible difference between the 20 characters? > > > > > > > -- > Deze e-mail is gecontroleerd op virussen door AVG. > http://www.avg.com > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From bo.berglund at gmail.com Tue Oct 27 20:12:00 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 27 Oct 2020 20:12:00 +0100 Subject: [Lazarus] Fixed-pitch font on windows with difference between 1 and l in code editor? References: <675299581.33326.1603811840159@ox.hosteurope.de> Message-ID: <75sgpf57v5htehnf512jpbbkn4h9ae0m19@4ax.com> On Tue, 27 Oct 2020 16:17:19 +0100 (CET), Pascal Riekenberg via lazarus wrote: >I use Hack: https://sourcefoundry.org/hack/ > > Thank you! This is really what I have been looking for! An annoyance: The font installer insists on restarting the computer, but it works without that. -- Bo Berglund Developer in Sweden From mailinglists at geldenhuys.co.uk Tue Oct 27 22:25:55 2020 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Tue, 27 Oct 2020 21:25:55 +0000 Subject: [Lazarus] What to replace Application.Processmessages with? In-Reply-To: References: Message-ID: <0a36e1ee-83b5-7881-8283-e28ef2a06283@geldenhuys.co.uk> On 13/10/2020 9:15 am, Bo Berglund via lazarus wrote: > The TTimer objects have been replaced by TFpTimer objects in the > ported code and this seems to work fine, whereas TTimer does not. That is the key part, using TFPTimer is thread based, so calling CheckSynchronized() would be the solution to keep things ticking over. Michael made a good suggestion, by wrapping that code into a method, so it is easier to maintain, and that wrapper method is more descriptive (ie: self documenting your code). In the long term I would highly suggest converting that code / tasks to multiple theads. From what you described, they sound like good candidates for a thread based system. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp From nc-gaertnma at netcologne.de Tue Oct 27 23:46:39 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Tue, 27 Oct 2020 23:46:39 +0100 Subject: [Lazarus] What to replace Application.Processmessages with? In-Reply-To: References: Message-ID: <20201027234639.5849a920@limapholos.matflo.wg> On Mon, 26 Oct 2020 13:00:26 +0100 (CET) Michael Van Canneyt via lazarus wrote: >[...] > Procedure HandleMainLoop; > > begin > {$IFDEF NOGUI} > CheckSynchronize; > {$ELSE} > Application.ProcessMessages; > {$ENDIF} > end; > > And call that both in GUI and NOGUI. Application.ProcessMessages calls CheckSynchronize in NoGUI. Mattias From michael at freepascal.org Wed Oct 28 08:05:12 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 28 Oct 2020 08:05:12 +0100 (CET) Subject: [Lazarus] What to replace Application.Processmessages with? In-Reply-To: <20201027234639.5849a920@limapholos.matflo.wg> References: <20201027234639.5849a920@limapholos.matflo.wg> Message-ID: On Tue, 27 Oct 2020, Mattias Gaertner via lazarus wrote: > On Mon, 26 Oct 2020 13:00:26 +0100 (CET) > Michael Van Canneyt via lazarus wrote: > >> [...] >> Procedure HandleMainLoop; >> >> begin >> {$IFDEF NOGUI} >> CheckSynchronize; >> {$ELSE} >> Application.ProcessMessages; >> {$ENDIF} >> end; >> >> And call that both in GUI and NOGUI. > > Application.ProcessMessages calls CheckSynchronize in NoGUI. NOGUI does not mean 'use nogui LCL' He does not use the LCL in that mode, so Application is not available. Michael. From bo.berglund at gmail.com Wed Oct 28 10:46:22 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 28 Oct 2020 10:46:22 +0100 Subject: [Lazarus] What to replace Application.Processmessages with? References: Message-ID: <5dfipf9urg9jqsnbs4avlp7ligthibrcad@4ax.com> On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote: > >> Now I wonder if I could put something else into the loops so that the >> main object of Application.Processmessages will be handled, namely to >> let event functions run as needed. >> Can I for example use CheckSynchronize in these loops? >> >> I.e. Application.Processmessages ==> CheckSynchronize? > >Based on your description, that is all you need to do. > >But I would create a routine > >Procedure HandleMainLoop; > >begin >{$IFDEF NOGUI} > CheckSynchronize; >{$ELSE} > Application.ProcessMessages; >{$ENDIF} >end; > >And call that both in GUI and NOGUI. > Is NOGUI defined also when *not* using the nogui widgetset? I.e. in a simple program? -- Bo Berglund Developer in Sweden From michael at freepascal.org Wed Oct 28 10:48:45 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 28 Oct 2020 10:48:45 +0100 (CET) Subject: [Lazarus] What to replace Application.Processmessages with? In-Reply-To: <5dfipf9urg9jqsnbs4avlp7ligthibrcad@4ax.com> References: <5dfipf9urg9jqsnbs4avlp7ligthibrcad@4ax.com> Message-ID: On Wed, 28 Oct 2020, Bo Berglund via lazarus wrote: > On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via > lazarus wrote: > >> >> >> On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote: >> >>> Now I wonder if I could put something else into the loops so that the >>> main object of Application.Processmessages will be handled, namely to >>> let event functions run as needed. >>> Can I for example use CheckSynchronize in these loops? >>> >>> I.e. Application.Processmessages ==> CheckSynchronize? >> >> Based on your description, that is all you need to do. >> >> But I would create a routine >> >> Procedure HandleMainLoop; >> >> begin >> {$IFDEF NOGUI} >> CheckSynchronize; >> {$ELSE} >> Application.ProcessMessages; >> {$ENDIF} >> end; >> >> And call that both in GUI and NOGUI. >> > > Is NOGUI defined also when *not* using the nogui widgetset? I.e. in a > simple program? As far as I know you must define this yourself. Michael. From bo.berglund at gmail.com Thu Oct 29 09:16:21 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 29 Oct 2020 09:16:21 +0100 Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? Message-ID: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> Yesterday I was working on an application using Lazarus 2.0.20/fpc 3.2.0 on a Windows 10 notebook. Suddenly Win10 decided to crash with a memory fault and restarted itself. But now Lazarus no longer works and when I inspected the config dir I found that two files had been hosed (filled with NUL characters): environmentoptions.xml inputhistory.xml All other files seem to be OK, so now I wonder what I can do to repair my Lazarus installation? Unlike on Linux this installation is created using the official windows installer for Lazarus 2.0.10 so I do not really know how the two files were created. On Linux I always install from SVN sources using a script I created years ago and then I can backtrack there... I tried to use files from my 2.0.8 installation after editing the items pointing to locations in the 2.0.8 tree to instead point to 2.0.10, but that was not successful. Grateful for any suggestions on how to fix this. (I do not really want to start over from scratch after spending time installing extra packages and customizations and the like). -- Bo Berglund Developer in Sweden From michael at freepascal.org Thu Oct 29 09:23:23 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 29 Oct 2020 09:23:23 +0100 (CET) Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? In-Reply-To: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> References: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> Message-ID: On Thu, 29 Oct 2020, Bo Berglund via lazarus wrote: > Yesterday I was working on an application using Lazarus 2.0.20/fpc > 3.2.0 on a Windows 10 notebook. > Suddenly Win10 decided to crash with a memory fault and restarted > itself. > > But now Lazarus no longer works and when I inspected the config dir I > found that two files had been hosed (filled with NUL characters): > > environmentoptions.xml > inputhistory.xml > > All other files seem to be OK, so now I wonder what I can do to repair > my Lazarus installation? > > Unlike on Linux this installation is created using the official > windows installer for Lazarus 2.0.10 so I do not really know how the > two files were created. On Linux I always install from SVN sources > using a script I created years ago and then I can backtrack there... > > I tried to use files from my 2.0.8 installation after editing the > items pointing to locations in the 2.0.8 tree to instead point to > 2.0.10, but that was not successful. > > Grateful for any suggestions on how to fix this. > > (I do not really want to start over from scratch after spending time > installing extra packages and customizations and the like). The packages should be OK. But as the names indicate, your input history is lost, and the environment options (essentially what you entered in tools - options) also. Just delete those 2 files. Michael. From bo.berglund at gmail.com Thu Oct 29 10:51:59 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 29 Oct 2020 10:51:59 +0100 Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? References: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> Message-ID: On Thu, 29 Oct 2020 09:23:23 +0100 (CET), Michael Van Canneyt via lazarus wrote: >> Grateful for any suggestions on how to fix this. >> >> (I do not really want to start over from scratch after spending time >> installing extra packages and customizations and the like). > >The packages should be OK. But as the names indicate, your input history is >lost, and the environment options (essentially what you entered in tools - >options) also. > >Just delete those 2 files. Thanks Michael, after doing that Lazarus starts up with the after-installation-dialog where one can check the important paths etc. Then I got to a pristine Lazarus but with my editor configurations intact and the installed packages still there. I could successfully build my project and run the resulting exe. My custom desktop was gone so I re-created it and saved it. I guess the custom desktops are saved in environmentoptions.xml... Lesson learned: --------------- This is the second time Windows 10 crashed and trashed the configuration fles, last time when using Lazarus 2.0.8. >From now on I will make a backup copy of all of the files in the config dir into a zipfile so I can resurrect a broken file after a crash. Rant: ----- This thing with Windows crashing never happened in the many years I used Windows 7, but in Dec 2019 I had to finally move to a new notebook and of course now Win 7 is no longer available so I have Win 10... And that has caused all kinds of problems like the crashes I discuss here but also a self-initiated reboot at irregular times purportedly in order to "upgrade" the system.... And I have found no way to stop it from happening. Win10 also triggers a start of a system backup at non-scheduled times for unknown reasons. I have a scedule set for a backup to run on the night between Friday and Saturday every week, but now it can start any day at any time.... Soo strange. When writing this I realized that I could of course have used the last backup to get my original config files back, but I did not think as far.... I wish I could bring back Windows 7.... Of course on Linux this is not an issue at all, but if the target programs are supposed to run on Windows I have no choice here. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Oct 29 11:04:29 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 29 Oct 2020 11:04:29 +0100 Subject: [Lazarus] What to replace Application.Processmessages with? References: <0a36e1ee-83b5-7881-8283-e28ef2a06283@geldenhuys.co.uk> Message-ID: On Tue, 27 Oct 2020 21:25:55 +0000, Graeme Geldenhuys via lazarus wrote: >In the long term I would highly suggest converting that code / tasks >to multiple theads. From what you described, they sound like good >candidates for a thread based system. Yes, I agree, but... The code is pretty big and very hard to follow these many years since it was created... I wanted to get it running first with as small changes as possible and I thought I had that nailed until I started an actual execution on the hardware and found that I could set it up properly and start it but then nothing more is happening. So there are probably other places where events are important, I guess, and I have to track down these as well... I am now thinking of creating some kind of general purpose thread object in order to track progress on the hardware but without doing much else, because the timer event was there in order to detatch the task execution from the body of the program so that it could run other things meanwhile. Some tasks take hours to execute... But initializing a run takes only some seconds so that could remain in mainline code if only the progress monitoring is handled in the thread. Of course I have to communicate the state of affairs to mainline from the thread... Could be done by changing boolean variable states (I assume a boolean which is just a single bit should be inherently thread-safe). Or else having an event in the thread to message into the mainline code using Synchronize(). -- Bo Berglund Developer in Sweden From jmlandmesser at gmx.de Thu Oct 29 12:25:18 2020 From: jmlandmesser at gmx.de (John Landmesser) Date: Thu, 29 Oct 2020 12:25:18 +0100 Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? In-Reply-To: References: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> Message-ID: Am 29.10.20 um 10:51 schrieb Bo Berglund via lazaru > Rant: > ----- > This thing with Windows crashing never happened in the many years I > used Windows 7, but in Dec 2019 I had to finally move to a new > notebook and of course now Win 7 is no longer available so I have Win > 10... > > And that has caused all kinds of problems like the crashes I discuss > here but also a self-initiated reboot at irregular times purportedly > in order to "upgrade" the system.... > And I have found no way to stop it from happening. > > Win10 also triggers a start of a system backup at non-scheduled times > for unknown reasons. I have a scedule set for a backup to run on the > night between Friday and Saturday every week, but now it can start any > day at any time.... > Soo strange. > When writing this I realized that I could of course have used the last > backup to get my original config files back, but I did not think as > far.... > > I wish I could bring back Windows 7.... > > Of course on Linux this is not an issue at all, but if the target > programs are supposed to run on Windows I have no choice here. > >  What about Win 7 + Lazarus in a VirtualBox? From mguerra13 at gmail.com Fri Oct 30 00:32:04 2020 From: mguerra13 at gmail.com (Mario Guerra) Date: Thu, 29 Oct 2020 20:32:04 -0300 Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? In-Reply-To: References: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> Message-ID: <9f9b7753-caee-8d99-4ec0-779df6a24cab@gmail.com> El 29/10/20 a las 06:51, Bo Berglund via lazarus escribió: > On Thu, 29 Oct 2020 09:23:23 +0100 (CET), Michael Van Canneyt via > lazarus wrote: > >>> Grateful for any suggestions on how to fix this. >>> >>> (I do not really want to start over from scratch after spending time >>> installing extra packages and customizations and the like). >> The packages should be OK. But as the names indicate, your input history is >> lost, and the environment options (essentially what you entered in tools - >> options) also. >> >> Just delete those 2 files. > Thanks Michael, > after doing that Lazarus starts up with the after-installation-dialog > where one can check the important paths etc. > Then I got to a pristine Lazarus but with my editor configurations > intact and the installed packages still there. > I could successfully build my project and run the resulting exe. > My custom desktop was gone so I re-created it and saved it. > > I guess the custom desktops are saved in environmentoptions.xml... > > Lesson learned: > --------------- > This is the second time Windows 10 crashed and trashed the > configuration fles, last time when using Lazarus 2.0.8. > From now on I will make a backup copy of all of the files in the > config dir into a zipfile so I can resurrect a broken file after a > crash. > > Rant: > ----- > This thing with Windows crashing never happened in the many years I > used Windows 7, but in Dec 2019 I had to finally move to a new > notebook and of course now Win 7 is no longer available so I have Win > 10... > > And that has caused all kinds of problems like the crashes I discuss > here but also a self-initiated reboot at irregular times purportedly > in order to "upgrade" the system.... > And I have found no way to stop it from happening. > > Win10 also triggers a start of a system backup at non-scheduled times > for unknown reasons. I have a scedule set for a backup to run on the > night between Friday and Saturday every week, but now it can start any > day at any time.... > Soo strange. > When writing this I realized that I could of course have used the last > backup to get my original config files back, but I did not think as > far.... > > I wish I could bring back Windows 7.... > > Of course on Linux this is not an issue at all, but if the target > programs are supposed to run on Windows I have no choice here. > > I use Lazarus 2.0.10 for Windows installed over Wine in GNU/Linux and it works ok, even for some projects I share the same source tree, and I'm able to compile for the two platforms. From jean.suzineau at wanadoo.fr Fri Oct 30 03:13:37 2020 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Fri, 30 Oct 2020 03:13:37 +0100 Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? In-Reply-To: <9f9b7753-caee-8d99-4ec0-779df6a24cab@gmail.com> References: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> <9f9b7753-caee-8d99-4ec0-779df6a24cab@gmail.com> Message-ID: I do this too, using VirtualBox shared folders. The physical machine is a Windows 8 with the source directory, where I can compile with Lazarus for Windows. I run an Ubuntu vm  using Virtual Box, with shared folders pointing to my source directory. The Lazarus on Ubuntu can compile directly in this directory. I just have a small problem, I need to add LCLBase to the requirements when I compile in Linux. May be this this is because I don't have the same versions of Lazarus in Windows and Ubuntu. A few years ago, I had go back to an older version of Lazarus on windows because I got curious effects with the last ones. My source code produce a dll used by a program written in Genero (www.4js.com). On Windows, some threads in Genero get a high cpu activity when then dll is compiled with recent Lazarus. The probleme does not occur with Ubuntu. I haven't had time yet to find exactly why. From bo.berglund at gmail.com Sat Oct 31 07:28:36 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 31 Oct 2020 07:28:36 +0100 Subject: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair? References: <6rtkpftsg6ump5sod1m065r7g2ur8lap6q@4ax.com> Message-ID: <0q0qpfpufc5f8avdbt4ekqpg76iog44tb0@4ax.com> On Thu, 29 Oct 2020 12:25:18 +0100, John Landmesser via lazarus wrote: >  What about Win 7 + Lazarus in a VirtualBox? > I do have my old laptop virtualized with VMWare Workstation 15 and can run it but it is a dual layer I only use because of some programs that can no longer be installed in Windows 10. And it would not solve the problem of Windows 10 suddenly just rebooting overnight or plain crashing. That would be equally detrimental to a virtual environment as running on the Win10 laptop directly. -- Bo Berglund Developer in Sweden