From leobronstain at gmail.com Sat May 1 01:08:24 2021 From: leobronstain at gmail.com (Leyba Bronstain) Date: Sat, 1 May 2021 02:08:24 +0300 Subject: [Lazarus] TScrollBox.ScrollInView method does not work for nested child controls Message-ID: <2c71ae81-c5dd-776d-5d6f-5759c089deaf@gmail.com> Hi all. I found that the ScrollInView method doesn't scroll the scrollbar to a "hidden" control unless its parent is a scrollbox but another component that lies on the scrollbox. test case: 1. Put to scrollbox the panel. 2. Put to panel any control (i.e. TEdit) 3. Change border of the scroll bar rectangle so that the nested control becomes "invisible" 4. Call ScrollInView method for this control It's a bug? -- /-- with best regards, Zoltanleo aka Док/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From m-w-vogel at gmx.de Sat May 1 19:53:54 2021 From: m-w-vogel at gmx.de (Michael W. Vogel) Date: Sat, 1 May 2021 19:53:54 +0200 Subject: [Lazarus] TScrollBox.ScrollInView method does not work for nested child controls In-Reply-To: <2c71ae81-c5dd-776d-5d6f-5759c089deaf@gmail.com> References: <2c71ae81-c5dd-776d-5d6f-5759c089deaf@gmail.com> Message-ID: <2b0436b1-c0e8-2690-13af-15e30b00f88e@gmx.de> Am 01.05.2021 um 01:08 schrieb Leyba Bronstain via lazarus: > I found that the ScrollInView method doesn't scroll the scrollbar to a > "hidden" control unless its parent is a scrollbox but another > component that lies on the scrollbox. Fixed in Trunk revision 65078 with code from https://forum.lazarus.freepascal.org/index.php/topic,54354.msg404204.html#msg404204 Michl From leobronstain at gmail.com Sat May 1 20:02:30 2021 From: leobronstain at gmail.com (=?UTF-8?B?0JvQtdCyINCR0YDQvtC90YjRgtC10LnQvQ==?=) Date: Sat, 01 May 2021 21:02:30 +0300 Subject: [Lazarus] TScrollBox.ScrollInView method does not work for nested child controls In-Reply-To: <2b0436b1-c0e8-2690-13af-15e30b00f88e@gmx.de> References: <2c71ae81-c5dd-776d-5d6f-5759c089deaf@gmail.com> <2b0436b1-c0e8-2690-13af-15e30b00f88e@gmx.de> Message-ID: <17929189ef0.27ef.bf752abec8ccb817190c8de93e854ab0@gmail.com> Good news. Thank a lot "Michael W. Vogel via lazarus" 1 мая 2021 г. 8:54:08 ПП написал: > Am 01.05.2021 um 01:08 schrieb Leyba Bronstain via lazarus: >> I found that the ScrollInView method doesn't scroll the scrollbar to a >> "hidden" control unless its parent is a scrollbox but another >> component that lies on the scrollbox. > > Fixed in Trunk revision 65078 with code from > https://forum.lazarus.freepascal.org/index.php/topic,54354.msg404204.html#msg404204 > > Michl > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From leobronstain at gmail.com Sun May 2 21:52:06 2021 From: leobronstain at gmail.com (Leyba Bronstain) Date: Sun, 2 May 2021 22:52:06 +0300 Subject: [Lazarus] TScrollBox.ScrollInView method does not work for nested child controls In-Reply-To: <2b0436b1-c0e8-2690-13af-15e30b00f88e@gmx.de> References: <2c71ae81-c5dd-776d-5d6f-5759c089deaf@gmail.com> <2b0436b1-c0e8-2690-13af-15e30b00f88e@gmx.de> Message-ID: <76ce5dab-466e-110a-93d9-085567648a37@gmail.com> I'm sorry. The last patch doesn't work on a more complex project https://forum.lazarus.freepascal.org/index.php/topic,54354.msg404381.html#msg404381 01.05.2021 20:53, Michael W. Vogel via lazarus пишет: > Am 01.05.2021 um 01:08 schrieb Leyba Bronstain via lazarus: >> I found that the ScrollInView method doesn't scroll the scrollbar to a >> "hidden" control unless its parent is a scrollbox but another >> component that lies on the scrollbox. > > Fixed in Trunk revision 65078 with code from > https://forum.lazarus.freepascal.org/index.php/topic,54354.msg404204.html#msg404204 > > > Michl -- /-- with best regards, Zoltanleo aka Док/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Mon May 3 15:59:08 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 03 May 2021 15:59:08 +0200 Subject: [Lazarus] Is there a global timezone-independent time available? Message-ID: If I use Now() to retrieve a TDateTime value I get it in whatever timezone (including DST) the box I run on is set to... And there is no indication of the timezone used (TDateTime is just a double after all). So now I wonder if there is some kind of globally constant time one can read which can be used in scheduling applications no matter what time zone is used. For example something like NowUTC() or similar? I have been struggling with the user part of a remote monitoring system, which will run on a RaspberryPi under Linux (Debian flavour). And there are lots of problems when going between the actual remote system and the config application because of the time zone differences. It would help a lot if one could use a time that is not messed with and is the same everywhere... The important thing here is that two systems located at different places on Earth should agree on such a time value if it is taken at the same absolute instant. And what is the useful resolution of the times? seconds, miliseconds or what? -- Bo Berglund Developer in Sweden From dezlov at gmail.com Mon May 3 20:20:49 2021 From: dezlov at gmail.com (Denis Kozlov) Date: Mon, 3 May 2021 19:20:49 +0100 Subject: [Lazarus] Is there a global timezone-independent time available? In-Reply-To: References: Message-ID: You can use LazSysUtils.NowUTC, and then there is also PascalTZ package if you want to convert between timezones. There is a ticket with a patch for adding a similar function to FPC, but it needs some attention: https://bugs.freepascal.org/view.php?id=30394 Regards, Denis On 03/05/2021 14:59, Bo Berglund via lazarus wrote: > If I use Now() to retrieve a TDateTime value I get it in whatever timezone > (including DST) the box I run on is set to... > And there is no indication of the timezone used (TDateTime is just a double > after all). > > So now I wonder if there is some kind of globally constant time one can read > which can be used in scheduling applications no matter what time zone is used. > For example something like NowUTC() or similar? > > I have been struggling with the user part of a remote monitoring system, which > will run on a RaspberryPi under Linux (Debian flavour). > > And there are lots of problems when going between the actual remote system and > the config application because of the time zone differences. > It would help a lot if one could use a time that is not messed with and is the > same everywhere... > > The important thing here is that two systems located at different places on > Earth should agree on such a time value if it is taken at the same absolute > instant. > > And what is the useful resolution of the times? > seconds, miliseconds or what? > From michael at freepascal.org Mon May 3 20:28:43 2021 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 3 May 2021 20:28:43 +0200 (CEST) Subject: [Lazarus] Is there a global timezone-independent time available? In-Reply-To: References: Message-ID: On Mon, 3 May 2021, Denis Kozlov via lazarus wrote: > You can use LazSysUtils.NowUTC, and then there is also PascalTZ package > if you want to convert between timezones. > > There is a ticket with a patch for adding a similar function to FPC, but > it needs some attention: > https://bugs.freepascal.org/view.php?id=30394 > I'm terribly sorry, I totally forgot about this bugreport :/ But Ondrej Pokorny has meanwhile implemented NowUTC and other related functions that allow more flexibility regarding the timezone. So, Mr. Berglund, with FPC trunk, your problem will be solved. I'm not sure it will be in 3.2.2, because it is rather sensitive. Michael. From fpc at pascalprogramming.org Mon May 3 22:00:26 2021 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Mon, 3 May 2021 22:00:26 +0200 Subject: [Lazarus] Is there a global timezone-independent time available? In-Reply-To: References: Message-ID: <1a1c343b-9e86-f22e-80fc-0c0c24d09152@pascalprogramming.org> Op 2021-05-03 om 20:28 schreef Michael Van Canneyt via lazarus: > > > So, Mr. Berglund, with FPC trunk, your problem will be solved. > I'm not sure it will be in 3.2.2, because it is rather sensitive. > Indeed, it (r47306) /won't be in 3.2.2 From bo.berglund at gmail.com Mon May 3 23:22:17 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 03 May 2021 23:22:17 +0200 Subject: [Lazarus] Is there a global timezone-independent time available? References: Message-ID: <24q09gdsnn3r1b6o40ans1elvi710uk5q4@4ax.com> On Mon, 3 May 2021 20:28:43 +0200 (CEST), Michael Van Canneyt via lazarus wrote: > > >On Mon, 3 May 2021, Denis Kozlov via lazarus wrote: > >> You can use LazSysUtils.NowUTC, and then there is also PascalTZ package >> if you want to convert between timezones. >> >> There is a ticket with a patch for adding a similar function to FPC, but >> it needs some attention: >> https://bugs.freepascal.org/view.php?id=30394 >> > >I'm terribly sorry, I totally forgot about this bugreport :/ > >But Ondrej Pokorny has meanwhile implemented NowUTC and other related functions that >allow more flexibility regarding the timezone. > >So, Mr. Berglund, with FPC trunk, your problem will be solved. >I'm not sure it will be in 3.2.2, because it is rather sensitive. > I only run with released versions so I will wait until then. I guess I can always do this to get an UTC timestamp: function MyNowUTC: TDateTime; begin Result := LocalTimeToUniversal(Now); end; Now I am at least running an UTC clock on screen using this call. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Fri May 7 02:14:36 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 07 May 2021 02:14:36 +0200 Subject: [Lazarus] Lazarus created an lfm form file from the dfm but uses both causing confusion... Message-ID: So I have a project with a few forms. It is maintained in SVN and both pas and dfm files are in SVN. I have ported the project from Delphi so I have these pas/dfm files. This week I have modified form layouts by moving stuff around and changing properties etc. For some reason Lazarus then created lfm form files where the new layout can be seen. In fact Lazarus uses the lfm files in the IDE... I did not notice thta tyhis had happened. Today I had an accident that deleted the code folder completely except for some remaining files from which I have reconstructed the project using the last SVN commit and the weekly backup of my PC taken Saturday night too. Since the commit did not include the lfm files (I was not aware of their existence) they are not in SVN, but they are in a leftover folder (I cannot say why it was left there...) Now I have both dfm and lfm form files in the project folder and it seems like Lazarus is using the lfm files because I can see my changed layout in Lazarus. But when I build the project the result is the old layout still. When I discovered the extra lfm files I renamed the dfm to dfm.bak and then tried to build the project. But now it throws up an error complaining that it cannot find the dfm file, which it has replaced by an lfm file all by itself... How can I restore order here and tell Lazarus to use the lfm files, which its editor does but not when Lazarus is building the project. At that time it looks for the dfm file instead. In Lazarus I can switch betweeen code and form view and then I see the lfm view. Lazarus 2.0.12, FPC 3.2.0 on Windows 10 -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sun May 9 21:26:00 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 09 May 2021 21:26:00 +0200 Subject: [Lazarus] Lazarus created an lfm form file from the dfm but uses both causing confusion... References: Message-ID: On Fri, 07 May 2021 02:14:36 +0200, Bo Berglund via lazarus wrote: UPDATE: I managed to clear up the mess and found some interesting things in the process... >This week I have modified form layouts by moving stuff around and changing >properties etc. For some reason Lazarus then created lfm form files where the >new layout can be seen. In fact Lazarus uses the lfm files in the IDE... >I did not notice that this had happened. In fact this was NOT what had happened! The files were still dfm files up until the "delete accident" happened! I just assumed this was what had happened. > >Today I had an accident that deleted the code folder completely except for some >remaining files from which I have reconstructed the project using the last SVN >commit and the weekly backup of my PC taken Saturday night too. In addition to the SVN commit and the backup done earlier I also had this "mysterious" client folder contaiining actual source files all with a file date about the time of the accidental delete. And here all form files had extension lfm. Yesterday while driving I realized what must have happened is this: - At the time of the accidental delete Lazarus was running and had a dozen or more source files open in the code editor. - When the source dir suddenly disappeared Lazarus noted this - When I saw that Lazarus was running I thought this was not a good idea so I tried shutting it down - This caused Lazarus to pop up a lot of error messages, which I clicked away until done. - The error messages were popped up because Lazarus apparently had lost connection to the files on disk and it tried to solve the situation. The end result of this was that Lazarus *saved* the contrent of all the sources it had open to the path they were read from, recreating the missing folders in the process! And since there were no dfm files to overwrite it saved the forms in native Lazarus format as lfm files. So the folder I found is actually *all* of the sources in the editor as they were when the crash happened! When I then could reach my computer I tested by: 1) Renaming all lfm files to dfm extension in the "save" directory 2) Copying the content of this directory to the newly checked out project overwriting all existing files 3) Now started Lazarus. At this point the project auto-loaded again and when I ran a build it succeeded and the binary looked exactly like it did before all this happened! :) So I was saved by Lazarus! It would not let the loaded files disappear! -- Bo Berglund Developer in Sweden From sysrpl at gmail.com Mon May 10 11:45:23 2021 From: sysrpl at gmail.com (Anthony Walter) Date: Mon, 10 May 2021 05:45:23 -0400 Subject: [Lazarus] Going Through My Educational Projects Material Message-ID: Upon request of some of the parents of the kids I teach, I am working on a document providing an overview of the methods, materials, and content used in my online classes. Thanks to a new government resource upon approval the parents of the kids I teach may be able to get reimbursement from the government for payments made to me. As such I've finally begun going through the materials I've generated for my classes and pushing some of them to Github. Recently Github added the ability to embed videos in their markdown files, so tonight I started the task of checking in code, recording videos, and taking screenshots. I have probably 100 projects to go through, but I pushed a couple to Github already along with a brief demonstration video or picture for each project. Until I finish my overview document, I am listing the projects I go through, review, and publish at this location: https://www.getlazarus.org/learn/tutorials/examples/ There are several big projects I need to push include my webkit based web browser controls and tools project, a powerful and current javascript engine library, from scratch json parser, a high resolution satellite image movie make r, a simple platform game engine using opengl, text to speech and speech to text using web services demo and so on. I also have many smaller but interesting projects to go through as well. Please note, I haven't updated my main Codebot.Cross library used in most of the examples linked above. I should have it updated in a few days after I send out my document overview. After it's been updated all the examples should be able to cross compile on Linux, Mac, and Windows. Finally, I have been working on some other projects unrelated to Lazarus, but they might be of interest to some of you. For the past few months I have been working on custom electronics and programming `IoT` code for the Raspberry Pi. I am also designing custom PCBs to pair with my Pi software library. Some of that material is hosted here . -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Wed May 12 00:06:50 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 12 May 2021 00:06:50 +0200 Subject: [Lazarus] Lazarus AutoSave package does not autosave all files.... Message-ID: Is there a way to make AutoSave save also the main project file? I have noted that when I build a more complex program I have an lpr (or dpr for Delphi compatibility) project file but if the project is a simple program the project file becomes a pas file. In both cases I have found that the AutoSave plug-in (available from OnLine Package Manager) does its job concerning the extra units in the project so when working on these there is regular disk saves happening. Not so with the dpr/lpr files or the pas file which contains the simple program. Have I missed something here or is there some hidden config which has to be enabled to get it to save ALL files? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu May 20 21:10:27 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 20 May 2021 19:10:27 -0000 Subject: [Lazarus] AutoSave does not save project file... References: Message-ID: On Sun, 11 Apr 2021 11:29:36 +0200, Bo Berglund via lazarus wrote: >I have installed AutoSave from the OnlinePackageManager on all of my numerous >Lazarus installations and in general it works well. >I started to do this following several Lazarus crashes where I lost modified >code and had to try restoring from memory... > >However, when I write console (simple program) applications I have noted that >AutoSave does not save the lpr file! And when looking closely the lpi file in >GUI apps is also not saved. > >Since lpr is the only file in simple programs AutoSave does not help from >disaster if a crash happens. >Is there a way to configure or modify AutoSave so it also saves the main project >files? > Reviving this thread in order to find a solution (did not get a single reply). ------------------------------------------------------------------------------ I am relying heavily on AutoSave when programming in Lazarus on a remote RaspberryPi via VNC connection. In this situation it happens way too often that Lazarus suddenly just unloads from memory and I see a blank desktop. Thanks to AutoSave in most cases I have just to start Lazarus again to be back in business, at worst with the last 5 seconds of typing lost. But that does not hold true if I am working in the lpr file because that is not saved automatically!!! It just happened to me again and it causes problems trying to re-create the last hour or so of work done on this file. :( So I would REALLY be happy if someone who understands the workings of AutoSave can make it include the project file among the files saved by AutoSave! I have never ever looked at stuff that integrate within Lazarus itself so I could not fix it.... For a console program maybe I should create a mainprogram.pas file and put *everything* now located in the lpr file into that instead? Just leave a bare minimum in the lpr file... Pity to be forced to do that though. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Fri May 21 13:44:31 2021 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 21 May 2021 11:44:31 -0000 Subject: [Lazarus] Lazarus AutoSave package does not autosave all files.... References: Message-ID: On Wed, 12 May 2021 00:06:50 +0200, Bo Berglund via lazarus wrote: >Is there a way to make AutoSave save also the main project file? >I have noted that when I build a more complex program I have an lpr (or dpr for >Delphi compatibility) project file but if the project is a simple program the >project file becomes a pas file. > >In both cases I have found that the AutoSave plug-in (available from OnLine >Package Manager) does its job concerning the extra units in the project so when >working on these there is regular disk saves happening. >Not so with the dpr/lpr files or the pas file which contains the simple program. > >Have I missed something here or is there some hidden config which has to be >enabled to get it to save ALL files? So I decided to move "everything" out of the lpr file and put the program itself as a procedure in the new mainprogram.pas file instead. Basically I now have an empty lpr file with this: program Myprogram; uses {$IFDEF UNIX} cthreads, baseunix, {$ENDIF} mainprogram; {Main program start} {$R *.res} begin MainProg; end. Everything that was in the lpr has moved to mainprogram.pas Now I have a question regarding uses in the lpr file: Whenever I create a new unit in Lazarus it puts its name into the lpr file uses clause. Why does it do this? Is it required that all units used by the program must be listed in the lpr file uses clause? It seems to work anyway, I moved all of the uses from dpr into mainprogram.pas and now Lazarus "Hints" that there are lots of units not used by mainprogram.pas. Why were these not hinted when they were in the lpr file? Now at least I am not losing my code edits the next time Lazarus crashes on me... Autosaved every 5 seconds. -- Bo Berglund Developer in Sweden From fpc at pascalprogramming.org Fri May 21 14:21:12 2021 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Fri, 21 May 2021 12:21:12 -0000 Subject: [Lazarus] FPC 3.2.2 released Message-ID: Hello, Finally, the Free Pascal 3.2.2 release is available from our servers and from sourceforge. Changes that may break backwards compatibility will be documented at: http://wiki.freepascal.org/User_Changes_3.2.2 For an overview of what is new see the summary below The website has been updated for the major targets and work is still being done for the rest. All downloads are available at the main FTP server and sourceforge. https://sourceforge.net/projects/freepascal/files/ ftp://ftp.freepascal.org/pub/fpc/dist/3.2.2/ Enjoy! The Free Pascal Compiler Team ----------------------------------------------------------------------------                             Free Pascal Compiler                                 Version 3.2.2 ****************************************************************************** Free Pascal 3.2.2 is a minor release of the 3.2.x fixes branch. As such, it contains mostly fixes of bugs discovered in the previous version, plus some updates for included packages. In this case a new target was also backported from trunk. Please also see https://wiki.freepascal.org/User_Changes_3.2.2 for a list of changes that may affect the behaviour of previously working code, and how to cope with these changes. The main highlights of this version: Platforms:   * New platform: aarch64-darwin   * A new 32/64-bit combined installer for Windows. Utilities:   * fpcres provides support for compiling resources from *.rc files Packages:   * fcl-db extended with support for MySQL 8.0   * fcl-passrc updates   * pas2js updates   * fpdoc updates   * fcl-base includes new support for logging to StdOut and StdErr   * rtl-extra includes improvements for Sockets