From b_lists at patandbrian.org Tue Jun 2 12:13:12 2020 From: b_lists at patandbrian.org (Brian) Date: Tue, 2 Jun 2020 06:13:12 -0400 Subject: [Lazarus] Keyboard mapping probelm In-Reply-To: <26e5232a-5632-d555-448b-967b35a8a683@patandbrian.org> References: <270997bb-878f-a31b-7174-861331251772@patandbrian.org> <9cf493fa-e266-cbfc-6c5e-6b8452159a24@patandbrian.org> <7dcbb6d1-2707-eb2d-835d-ac5045e141d7@patandbrian.org> <932e326e-2d38-ba7b-41e5-8a15c9c31649@patandbrian.org> <090aa94b-6107-8a45-d229-3d3019c0fbe2@patandbrian.org> <978e16af-07e8-2b94-00e5-940545af3a56@patandbrian.org> <518ceca3-7613-7a40-dfed-0a5f7be48514@patandbrian.org> <1000b329-45b3-ed81-21ab-e46271c84640@patandbrian.org> <4a6ee43a-c472-ea4a-89c9-15f0284a6c42@patandbrian.org> <3bd51b59-1d7a-483d-9595-3bd69a3c58ba@geldenhuys.co.uk> <26e5232a-5632-d555-448b-967b35a8a683@patandbrian.org> Message-ID: <1dcf3c0f-5494-8f7b-f9cf-1a9cee682729@patandbrian.org> On 5/31/20 8:47 AM, Brian via lazarus wrote: > On 5/30/20 6:56 PM, Graeme Geldenhuys via lazarus wrote: >> On 30/05/2020 9:04 pm, Brian via lazarus wrote: >>> Copyright (c) 1993-2017 by Florian Klaempfl and others >>> (1002) Target OS: Linux for x86-64 >>> (3104) Compiling fcllaz.pas >>> /home/brian/subversion/lazarus/packager/registration/fcllaz.pas(11,3) Fatal: (10022) Can't find unit db used by fcllaz >>> Fatal: (1018) Compilation aborted >>> Makefile:2929: recipe for target 'fcllaz.ppu' failed >> >> From that errer, that tells me you have some problem with your FPC >> setup, not Lazarus. FPC is trying to compile the Lazarus fcllaz >> package that uses the FPC's db.pp unit, but can't find it. >> >> The "db.pp" unit is part of FPC's fcl-db package. I would double >> check your ~/.fpc.cfg file and make sure all the paths are correct. >> >> > > Well, I guess things are progressing, after a fashion! > > Thank you, Graeme, for sorting this one. I took the two fpc debs > currently with the latest lazarus on sourceforge, installed them, and > now lazarus (from subversion, and I updated this morning, before > building) builds without error. So far, so good. > > So then I ran up the IDE, and changed to the QT5 widgets, per John's > suggestion, and rebuilt the IDE. Nope! Back to this error which Don > Alfredo says is due to an outdated libQT5pas.so when fpcupdeluxe is > used, so I assume it's the same problem here. > > A quick search on the error finds details of building the Qt5 on a > previous version of Mint > >> https://tondrej.blogspot.com/2018/04/first-steps-with-lazarus-qt5-interface.html > > which seems to be downloading an update of some of the QT5 stuff, so > I'll try this lot when I get chance. > > In the meantime, my Gtk2 build running under the Debian-based version > of Mint in a VirtualBox VM continues to work just fine - so whatever > the cause of all this, it seems that EITHER it rests with the Ubuntu > version of Mint OR it's a multi-way interaction with some of the > software I have installed on the host but not on the VM. > I decided to try the multi-way interaction idea, and I reinstalled Mint Ubuntu, reformatting the root partition. Lazarus now works perfectly using gtk2, no 'i' and 'm' problems. :) I don't have everything installed again, I cut thinks back to the minimum that I must have, so I guess the thing now is to test Lazarus before and after I install anything else, see whether I can find the installation which breaks things, if in fact it still does. If there was anybody else but me seeing this problem, then that's my recommendation if you can do it, reinstall your OS and you may find it all goes away. It certainly took less time than all the other things I did trying to solve the problem. Thanks again to everyone who tried to help. Brian. From special at joepgen.com Wed Jun 3 12:55:53 2020 From: special at joepgen.com (Special) Date: Wed, 3 Jun 2020 12:55:53 +0200 Subject: [Lazarus] SQLdb Tab lost In-Reply-To: References: <04d00392-3a5c-4783-1528-d9a3ed78adde@joepgen.com> Message-ID: <086fa56a-254f-fb64-a6fa-c1915dd05b31@joepgen.com> Am 30.05.2020 um 21:02 schrieb Juha Manninen via lazarus: > On Sat, May 30, 2020 at 1:17 PM Special via lazarus > wrote: >> On a Raspberry Pi 4B 4GB, I installed Lazarus Trunc with fpcupdeluxe. >> All seemed well, but then I discovered the SQLdb tab is lost. So I >> cannot compile my SQLite Applications. How to fix? > Install package sqldblaz. > >> Version # 2.1.0, FPC Version 3.3.1, SVN Revision: 63249. (Same problem >> was already on SVN Version 6327). > It does not depend on revision because it is a local configuration issue. > > Juha Install succeeded. Thank You, Juha. Regards --  Joe From francesco.sammarco at gmail.com Wed Jun 3 13:47:17 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Wed, 3 Jun 2020 13:47:17 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question Message-ID: Hi everyone, I have the following problem. I have a calendar (Italian) to sync with Google Calendar. With the following code I can work quite well. If today (2020-06-03) I set a new appointment it is saved on google calendar on the right day and time, but if for example: always today if I set an appointment for December 10, 2020 at 9 am, I find myself there appointment set on the right day but at 8 am. (So an hour behind) I think it's due to the change between sunlight and daylight. Can anyone explain to me how to solve the problem? Thank you XinYiMan var start_e : TEventDateTime; end_e : TEventDateTime; Entry : TEvent; begin Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, my_id_app); start_e := TEventDateTime.Create(); end_e := TEventDateTime.Create(); start_e.dateTime := data_appuntamento; start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); start_e.timeZone := 'Europe/Rome'; end_e.dateTime := IncMinute(LocalTimeToUniversal(data_appuntamento),15); end_e.timeZone := 'Europe/Rome'; Entry.start := start_e; Entry._end := end_e; -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Wed Jun 3 14:51:59 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 3 Jun 2020 14:51:59 +0200 (CEST) Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: > Hi everyone, I have the following problem. I have a calendar (Italian) to > sync with Google Calendar. With the following code I can work quite well. > If today (2020-06-03) I set a new appointment it is saved on google > calendar on the right day and time, but if for example: always today if I > set an appointment for December 10, 2020 at 9 am, I find myself there > appointment set on the right day but at 8 am. (So an hour behind) I think > it's due to the change between sunlight and daylight. Can anyone explain to > me how to solve the problem? > > Thank you > XinYiMan > > > > var > start_e : TEventDateTime; > end_e : TEventDateTime; > Entry : TEvent; > begin > Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, > my_id_app); > > start_e := TEventDateTime.Create(); > end_e := TEventDateTime.Create(); > > start_e.dateTime := data_appuntamento; > start_e.dateTime := > LocalTimeToUniversal(start_e.dateTime); > start_e.timeZone := 'Europe/Rome'; If you set the timzeone explicitly, I don't think you must do a LocalTimeToUniversal, I think the timezone is then automatically taken into account. As I understand it you specify the timezone in dateTime or you set it in the timezone. Michael. From luca at wetron.es Wed Jun 3 15:30:44 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 3 Jun 2020 15:30:44 +0200 Subject: [Lazarus] fpWeb and server-sent events Message-ID: Hello, I need to embed a simple web server in my application that 1) should server a couple of static files 2) send server-sent events https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events I can see that 1) is easy, but 2) I cannot see how (fpWeb model doesn't seem to allow to take over the socket and keep sending data on it). I saw an old message regarding websockets and bauglir-websocket but it seems it implements a different server and I'd like to run everything from the same socket. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From francesco.sammarco at gmail.com Wed Jun 3 15:42:55 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Wed, 3 Jun 2020 15:42:55 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: sorry I don't understand, you say that just remove the lines where I specify the timezone ?! Il mer 3 giu 2020, 14:51 Michael Van Canneyt ha scritto: > > > On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: > > > Hi everyone, I have the following problem. I have a calendar (Italian) to > > sync with Google Calendar. With the following code I can work quite well. > > If today (2020-06-03) I set a new appointment it is saved on google > > calendar on the right day and time, but if for example: always today if I > > set an appointment for December 10, 2020 at 9 am, I find myself there > > appointment set on the right day but at 8 am. (So an hour behind) I think > > it's due to the change between sunlight and daylight. Can anyone explain > to > > me how to solve the problem? > > > > Thank you > > XinYiMan > > > > > > > > var > > start_e : TEventDateTime; > > end_e : TEventDateTime; > > Entry : TEvent; > > begin > > Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, > > my_id_app); > > > > start_e := TEventDateTime.Create(); > > end_e := TEventDateTime.Create(); > > > > start_e.dateTime := data_appuntamento; > > start_e.dateTime := > > LocalTimeToUniversal(start_e.dateTime); > > start_e.timeZone := 'Europe/Rome'; > > If you set the timzeone explicitly, I don't think you must do a > LocalTimeToUniversal, > I think the timezone is then automatically taken into account. As I > understand it you specify the timezone in dateTime or you set it in the > timezone. > > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Wed Jun 3 15:54:34 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 3 Jun 2020 15:54:34 +0200 (CEST) Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: > Hello, > > I need to embed a simple web server in my application that > > 1) should server a couple of static files > 2) send server-sent events > > https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events > > > I can see that 1) is easy, but 2) I cannot see how (fpWeb model doesn't > seem to allow to take over the socket and keep sending data on it). > I saw an old message regarding websockets and bauglir-websocket but it > seems it implements a different server and I'd like to run everything > from the same socket. Simply said: You can't in FPC. The only way to do this with FPC is using websockets, indeed using bauglir-websocket. I use it myself like that. Michael. From michael at freepascal.org Wed Jun 3 15:55:23 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 3 Jun 2020 15:55:23 +0200 (CEST) Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: On Wed, 3 Jun 2020, Francesco Sammarco wrote: > sorry I don't understand, you say that just remove the lines where I > specify the timezone ?! No, remove the start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); I think it is not necessary if you set the timezone. Michael. > > Il mer 3 giu 2020, 14:51 Michael Van Canneyt ha > scritto: > >> >> >> On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: >> >>> Hi everyone, I have the following problem. I have a calendar (Italian) to >>> sync with Google Calendar. With the following code I can work quite well. >>> If today (2020-06-03) I set a new appointment it is saved on google >>> calendar on the right day and time, but if for example: always today if I >>> set an appointment for December 10, 2020 at 9 am, I find myself there >>> appointment set on the right day but at 8 am. (So an hour behind) I think >>> it's due to the change between sunlight and daylight. Can anyone explain >> to >>> me how to solve the problem? >>> >>> Thank you >>> XinYiMan >>> >>> >>> >>> var >>> start_e : TEventDateTime; >>> end_e : TEventDateTime; >>> Entry : TEvent; >>> begin >>> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, >>> my_id_app); >>> >>> start_e := TEventDateTime.Create(); >>> end_e := TEventDateTime.Create(); >>> >>> start_e.dateTime := data_appuntamento; >>> start_e.dateTime := >>> LocalTimeToUniversal(start_e.dateTime); >>> start_e.timeZone := 'Europe/Rome'; >> >> If you set the timzeone explicitly, I don't think you must do a >> LocalTimeToUniversal, >> I think the timezone is then automatically taken into account. As I >> understand it you specify the timezone in dateTime or you set it in the >> timezone. >> >> Michael. >> > From francesco.sammarco at gmail.com Wed Jun 3 15:57:02 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Wed, 3 Jun 2020 15:57:02 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: sorry and how do I set the date and time of the apartment ?! Il mer 3 giu 2020, 15:55 Michael Van Canneyt ha scritto: > > > On Wed, 3 Jun 2020, Francesco Sammarco wrote: > > > sorry I don't understand, you say that just remove the lines where I > > specify the timezone ?! > > No, remove the > > start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); > > I think it is not necessary if you set the timezone. > > Michael. > > > > > > Il mer 3 giu 2020, 14:51 Michael Van Canneyt ha > > scritto: > > > >> > >> > >> On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: > >> > >>> Hi everyone, I have the following problem. I have a calendar (Italian) > to > >>> sync with Google Calendar. With the following code I can work quite > well. > >>> If today (2020-06-03) I set a new appointment it is saved on google > >>> calendar on the right day and time, but if for example: always today > if I > >>> set an appointment for December 10, 2020 at 9 am, I find myself there > >>> appointment set on the right day but at 8 am. (So an hour behind) I > think > >>> it's due to the change between sunlight and daylight. Can anyone > explain > >> to > >>> me how to solve the problem? > >>> > >>> Thank you > >>> XinYiMan > >>> > >>> > >>> > >>> var > >>> start_e : TEventDateTime; > >>> end_e : TEventDateTime; > >>> Entry : TEvent; > >>> begin > >>> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, > >>> my_id_app); > >>> > >>> start_e := TEventDateTime.Create(); > >>> end_e := TEventDateTime.Create(); > >>> > >>> start_e.dateTime := data_appuntamento; > >>> start_e.dateTime := > >>> LocalTimeToUniversal(start_e.dateTime); > >>> start_e.timeZone := 'Europe/Rome'; > >> > >> If you set the timzeone explicitly, I don't think you must do a > >> LocalTimeToUniversal, > >> I think the timezone is then automatically taken into account. As I > >> understand it you specify the timezone in dateTime or you set it in the > >> timezone. > >> > >> Michael. > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Wed Jun 3 15:59:54 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 3 Jun 2020 15:59:54 +0200 (CEST) Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: On Wed, 3 Jun 2020, Francesco Sammarco wrote: > sorry and how do I set the date and time of the apartment ?! I would think this is sufficient: Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, my_id_app); start_e := TEventDateTime.Create(); end_e := TEventDateTime.Create(); start_e.dateTime := data_appuntamento; start_e.timeZone := 'Europe/Rome'; Michael. > > Il mer 3 giu 2020, 15:55 Michael Van Canneyt ha > scritto: > >> >> >> On Wed, 3 Jun 2020, Francesco Sammarco wrote: >> >>> sorry I don't understand, you say that just remove the lines where I >>> specify the timezone ?! >> >> No, remove the >> >> start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); >> >> I think it is not necessary if you set the timezone. >> >> Michael. >> >> >>> >>> Il mer 3 giu 2020, 14:51 Michael Van Canneyt ha >>> scritto: >>> >>>> >>>> >>>> On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: >>>> >>>>> Hi everyone, I have the following problem. I have a calendar (Italian) >> to >>>>> sync with Google Calendar. With the following code I can work quite >> well. >>>>> If today (2020-06-03) I set a new appointment it is saved on google >>>>> calendar on the right day and time, but if for example: always today >> if I >>>>> set an appointment for December 10, 2020 at 9 am, I find myself there >>>>> appointment set on the right day but at 8 am. (So an hour behind) I >> think >>>>> it's due to the change between sunlight and daylight. Can anyone >> explain >>>> to >>>>> me how to solve the problem? >>>>> >>>>> Thank you >>>>> XinYiMan >>>>> >>>>> >>>>> >>>>> var >>>>> start_e : TEventDateTime; >>>>> end_e : TEventDateTime; >>>>> Entry : TEvent; >>>>> begin >>>>> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, >>>>> my_id_app); >>>>> >>>>> start_e := TEventDateTime.Create(); >>>>> end_e := TEventDateTime.Create(); >>>>> >>>>> start_e.dateTime := data_appuntamento; >>>>> start_e.dateTime := >>>>> LocalTimeToUniversal(start_e.dateTime); >>>>> start_e.timeZone := 'Europe/Rome'; >>>> >>>> If you set the timzeone explicitly, I don't think you must do a >>>> LocalTimeToUniversal, >>>> I think the timezone is then automatically taken into account. As I >>>> understand it you specify the timezone in dateTime or you set it in the >>>> timezone. >>>> >>>> Michael. >>>> >>> >> > From luca at wetron.es Wed Jun 3 16:32:26 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 3 Jun 2020 16:32:26 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: El 3/6/20 a les 15:54, Michael Van Canneyt via lazarus ha escrit: > > > On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: > >> Hello, >> >> I need to embed a simple web server in my application that >> >> 1) should server a couple of static files >> 2) send server-sent events >> >> https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events >> >> >> >> I can see that 1) is easy, but 2) I cannot see how (fpWeb model >> doesn't seem to allow to take over the socket and keep sending data on >> it). >> I saw an old message regarding websockets and bauglir-websocket but it >> seems it implements a different server and I'd like to run everything >> from the same socket. > > Simply said: You can't in FPC. > > The only way to do this with FPC is using websockets, indeed using > bauglir-websocket. I use it myself like that. I didn't look into it too much, but does it also serve "normal" http? If so I could adapt it to manage events (after all it's much simpler than websockets). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Wed Jun 3 16:42:36 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 3 Jun 2020 16:42:36 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: El 3/6/20 a les 16:32, Luca Olivetti via lazarus ha escrit: > El 3/6/20 a les 15:54, Michael Van Canneyt via lazarus ha escrit: >> >> >> On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: >> >>> Hello, >>> >>> I need to embed a simple web server in my application that >>> >>> 1) should server a couple of static files >>> 2) send server-sent events >>> >>> https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events >>> >>> >>> >>> I can see that 1) is easy, but 2) I cannot see how (fpWeb model >>> doesn't seem to allow to take over the socket and keep sending data >>> on it). >>> I saw an old message regarding websockets and bauglir-websocket but >>> it seems it implements a different server and I'd like to run >>> everything from the same socket. >> >> Simply said: You can't in FPC. >> >> The only way to do this with FPC is using websockets, indeed using >> bauglir-websocket. I use it myself like that. > > I didn't look into it too much, but does it also serve "normal" http? If > so I could adapt it to manage events (after all it's much simpler than > websockets). I see that I can connect the EventSource to a different socket, so I can use fpWeb to serve static content and a simple socket to send events. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Wed Jun 3 16:52:34 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 3 Jun 2020 16:52:34 +0200 (CEST) Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: > El 3/6/20 a les 15:54, Michael Van Canneyt via lazarus ha escrit: >> >> >> On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: >> >>> Hello, >>> >>> I need to embed a simple web server in my application that >>> >>> 1) should server a couple of static files >>> 2) send server-sent events >>> >>> > https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events >>> >>> >>> >>> I can see that 1) is easy, but 2) I cannot see how (fpWeb model >>> doesn't seem to allow to take over the socket and keep sending data on >>> it). >>> I saw an old message regarding websockets and bauglir-websocket but it >>> seems it implements a different server and I'd like to run everything >>> from the same socket. >> >> Simply said: You can't in FPC. >> >> The only way to do this with FPC is using websockets, indeed using >> bauglir-websocket. I use it myself like that. > > I didn't look into it too much, but does it also serve "normal" http? If > so I could adapt it to manage events (after all it's much simpler than > websockets). No, it does not serve normal http. Michael. From silvioprog at gmail.com Wed Jun 3 18:53:40 2020 From: silvioprog at gmail.com (silvioprog) Date: Wed, 3 Jun 2020 13:53:40 -0300 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: Hi Luca. I hope you are fine in the current world situation. Some answers below to your questions 1 and 2. On Wed, Jun 3, 2020 at 10:30 AM Luca Olivetti via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Hello, > > I need to embed a simple web server in my application that > > 1) should server a couple of static files > 2) send server-sent events 1) So, you can use any Pascal structure to serve files, even in a single routine. BTW, if you want to resolve media types, you can use fpmimetypes or BrookMediaTypes . 2) As Michael explained, unfortunately, it is not supported in FCL-Web (yet) . However, if you want a SSE structure out-of-the-box, you can provide it using the Brook streaming, e.g.: Minimal console example: https://github.com/risoflora/brookframework/blob/expr/Examples/Console/FPC/httpsrvsse.lpr Minimal LCL example: https://github.com/risoflora/brookframework/blob/expr/Examples/LCL/HTTPServerSSE_frMain.pas Both examples above declare a small HTML client showing how to consume it via event source (EventSource). Optionally, you can use some async structure (e.g.: TSpinWait.SpinUntil) to create a small polling to push/pop the messages provided to the clients in a single long lived event. HTH -- Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca at wetron.es Wed Jun 3 19:03:56 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 3 Jun 2020 19:03:56 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: <1db1dac4-9675-22a7-5ea8-20545369ed6c@wetron.es> El 3/6/20 a les 18:53, silvioprog via lazarus ha escrit: > 2) As Michael explained, unfortunately, it is not supported in FCL-Web > (yet) . However, if you want a SSE structure out-of-the-box, you can > provide it using the Brook streaming, e.g.: > > Minimal console example: > https://github.com/risoflora/brookframework/blob/expr/Examples/Console/FPC/httpsrvsse.lpr > > Minimal LCL example: > https://github.com/risoflora/brookframework/blob/expr/Examples/LCL/HTTPServerSSE_frMain.pas Thank you. I tested the 2 ports approach (fpweb on one port and a custom socket for SSE on a different port) and it works, but this is nicer. Is brookframework stable enough to run 24/7? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From silvioprog at gmail.com Wed Jun 3 19:41:36 2020 From: silvioprog at gmail.com (silvioprog) Date: Wed, 3 Jun 2020 14:41:36 -0300 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: <1db1dac4-9675-22a7-5ea8-20545369ed6c@wetron.es> References: <1db1dac4-9675-22a7-5ea8-20545369ed6c@wetron.es> Message-ID: On Wed, Jun 3, 2020 at 2:04 PM Luca Olivetti via lazarus < lazarus at lists.lazarus-ide.org> wrote: > El 3/6/20 a les 18:53, silvioprog via lazarus ha escrit: > Thank you. > I tested the 2 ports approach (fpweb on one port and a custom socket for > SSE on a different port) and it works, but this is nicer. > Pretty good! Maybe providing a small example would be useful for the community. ☺ Is brookframework stable enough to run 24/7? > Yes, it is. We have been using it as Apache/Nginx replacement running in production in an application as service (daemon) 24/7 in ~47 customers providing data for several clients (web, mobile and desktop). -- Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca at wetron.es Wed Jun 3 20:46:41 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 3 Jun 2020 20:46:41 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: <1db1dac4-9675-22a7-5ea8-20545369ed6c@wetron.es> Message-ID: El 3/6/20 a les 19:41, silvioprog via lazarus ha escrit: > On Wed, Jun 3, 2020 at 2:04 PM Luca Olivetti via lazarus > > > wrote: > > El 3/6/20 a les 18:53, silvioprog via lazarus ha escrit: > Thank you. > I tested the 2 ports approach (fpweb on one port and a custom socket > for > SSE on a different port) and it works, but this is nicer. > > > Pretty good! Maybe providing a small example would be useful for the > community. ☺ Too quick and dirty to be an example ;-) Maybe tomorrow I'll clean it up a bit, or maybe I'll go with brookframework directly :-D > > Is brookframework stable enough to run 24/7? > > > Yes, it is. We have been using it as Apache/Nginx replacement running in > production in an application as service (daemon) 24/7 in ~47 customers > providing data for several clients (web, mobile and desktop). Good, then I guess the question is if firexox and/or chromium are stable enough to run 24/7 (which I doubt...) Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From francesco.sammarco at gmail.com Thu Jun 4 09:02:41 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Thu, 4 Jun 2020 09:02:41 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: if I change my code in this mode, and change Google Calendar configuration, with Greenwich meridian, I see correct result on Google Calendar. But I'm not on Greenwich meridian. I edited the demo calendar. I added a button and inside I put the following code. procedure TMainForm.Button1Click(Sender: TObject); var Entry : TEvent; Insert : TEvent; start_e : TEventDateTime; end_e : TEventDateTime; begin if LBCalendars.ItemIndex<0 then Exit; start_e := TEventDateTime.Create(); end_e := TEventDateTime.Create(); start_e.dateTime := EncodeDateTime(2020,6,3,19,0,0,0); start_e.timeZone := 'Europe/London'; end_e.dateTime := IncHour(start_e.dateTime,2); end_e.timeZone := 'Europe/London'; Entry := TEvent.Create(); Entry.summary := 'My test'; Entry.description := 'My test'; Entry.location := 'My location'; Entry.start := start_e; Entry._end := end_e; Entry.guestsCanInviteOthers := false; Entry.guestsCanSeeOtherGuests := false; Entry.colorId := ''; Insert := FCalendarAPI.EventsResource.Insert(FCurrentCalendar.id,Entry); SaveRefreshToken; Entry.Free; Entry:=nil; ShowMessage('Insert ' + Insert.id); Insert.Free; Insert:=nil; end; Il giorno mer 3 giu 2020 alle ore 15:59 Michael Van Canneyt < michael at freepascal.org> ha scritto: > > > On Wed, 3 Jun 2020, Francesco Sammarco wrote: > > > sorry and how do I set the date and time of the apartment ?! > > I would think this is sufficient: > > Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, my_id_app); > start_e := TEventDateTime.Create(); > end_e := TEventDateTime.Create(); > start_e.dateTime := data_appuntamento; > start_e.timeZone := 'Europe/Rome'; > > Michael. > > > > > Il mer 3 giu 2020, 15:55 Michael Van Canneyt ha > > scritto: > > > >> > >> > >> On Wed, 3 Jun 2020, Francesco Sammarco wrote: > >> > >>> sorry I don't understand, you say that just remove the lines where I > >>> specify the timezone ?! > >> > >> No, remove the > >> > >> start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); > >> > >> I think it is not necessary if you set the timezone. > >> > >> Michael. > >> > >> > >>> > >>> Il mer 3 giu 2020, 14:51 Michael Van Canneyt > ha > >>> scritto: > >>> > >>>> > >>>> > >>>> On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: > >>>> > >>>>> Hi everyone, I have the following problem. I have a calendar > (Italian) > >> to > >>>>> sync with Google Calendar. With the following code I can work quite > >> well. > >>>>> If today (2020-06-03) I set a new appointment it is saved on google > >>>>> calendar on the right day and time, but if for example: always today > >> if I > >>>>> set an appointment for December 10, 2020 at 9 am, I find myself there > >>>>> appointment set on the right day but at 8 am. (So an hour behind) I > >> think > >>>>> it's due to the change between sunlight and daylight. Can anyone > >> explain > >>>> to > >>>>> me how to solve the problem? > >>>>> > >>>>> Thank you > >>>>> XinYiMan > >>>>> > >>>>> > >>>>> > >>>>> var > >>>>> start_e : TEventDateTime; > >>>>> end_e : TEventDateTime; > >>>>> Entry : TEvent; > >>>>> begin > >>>>> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, > >>>>> my_id_app); > >>>>> > >>>>> start_e := TEventDateTime.Create(); > >>>>> end_e := TEventDateTime.Create(); > >>>>> > >>>>> start_e.dateTime := data_appuntamento; > >>>>> start_e.dateTime := > >>>>> LocalTimeToUniversal(start_e.dateTime); > >>>>> start_e.timeZone := 'Europe/Rome'; > >>>> > >>>> If you set the timzeone explicitly, I don't think you must do a > >>>> LocalTimeToUniversal, > >>>> I think the timezone is then automatically taken into account. As I > >>>> understand it you specify the timezone in dateTime or you set it in > the > >>>> timezone. > >>>> > >>>> Michael. > >>>> > >>> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Thu Jun 4 09:32:29 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 4 Jun 2020 09:32:29 +0200 (CEST) Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: Hello, I'm afraid I am of no help here. I am not an expert on the google Calendar API... What you can try to do is set the calendar configuration to your timezone (Italy/Rome, I suppose) and do not provide any timezone information when you create your items. Michael. On Thu, 4 Jun 2020, Francesco Sammarco wrote: > if I change my code in this mode, and change Google Calendar configuration, > with Greenwich meridian, I see correct result on Google Calendar. But I'm > not on Greenwich meridian. > > > I edited the demo calendar. I added a button and inside I put the following > code. > > procedure TMainForm.Button1Click(Sender: TObject); > var > Entry : TEvent; > Insert : TEvent; > start_e : TEventDateTime; > end_e : TEventDateTime; > begin > if LBCalendars.ItemIndex<0 then > Exit; > > start_e := TEventDateTime.Create(); > end_e := TEventDateTime.Create(); > > start_e.dateTime := EncodeDateTime(2020,6,3,19,0,0,0); > start_e.timeZone := 'Europe/London'; > end_e.dateTime := IncHour(start_e.dateTime,2); > end_e.timeZone := 'Europe/London'; > > Entry := TEvent.Create(); > Entry.summary := 'My test'; > Entry.description := 'My test'; > Entry.location := 'My location'; > Entry.start := start_e; > Entry._end := end_e; > > Entry.guestsCanInviteOthers := false; > Entry.guestsCanSeeOtherGuests := false; > > Entry.colorId := ''; > > Insert := FCalendarAPI.EventsResource.Insert(FCurrentCalendar.id,Entry); > > SaveRefreshToken; > > > Entry.Free; > Entry:=nil; > > ShowMessage('Insert ' + Insert.id); > > Insert.Free; > Insert:=nil; > end; > > Il giorno mer 3 giu 2020 alle ore 15:59 Michael Van Canneyt < > michael at freepascal.org> ha scritto: > >> >> >> On Wed, 3 Jun 2020, Francesco Sammarco wrote: >> >>> sorry and how do I set the date and time of the apartment ?! >> >> I would think this is sufficient: >> >> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, my_id_app); >> start_e := TEventDateTime.Create(); >> end_e := TEventDateTime.Create(); >> start_e.dateTime := data_appuntamento; >> start_e.timeZone := 'Europe/Rome'; >> >> Michael. >> >>> >>> Il mer 3 giu 2020, 15:55 Michael Van Canneyt ha >>> scritto: >>> >>>> >>>> >>>> On Wed, 3 Jun 2020, Francesco Sammarco wrote: >>>> >>>>> sorry I don't understand, you say that just remove the lines where I >>>>> specify the timezone ?! >>>> >>>> No, remove the >>>> >>>> start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); >>>> >>>> I think it is not necessary if you set the timezone. >>>> >>>> Michael. >>>> >>>> >>>>> >>>>> Il mer 3 giu 2020, 14:51 Michael Van Canneyt >> ha >>>>> scritto: >>>>> >>>>>> >>>>>> >>>>>> On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: >>>>>> >>>>>>> Hi everyone, I have the following problem. I have a calendar >> (Italian) >>>> to >>>>>>> sync with Google Calendar. With the following code I can work quite >>>> well. >>>>>>> If today (2020-06-03) I set a new appointment it is saved on google >>>>>>> calendar on the right day and time, but if for example: always today >>>> if I >>>>>>> set an appointment for December 10, 2020 at 9 am, I find myself there >>>>>>> appointment set on the right day but at 8 am. (So an hour behind) I >>>> think >>>>>>> it's due to the change between sunlight and daylight. Can anyone >>>> explain >>>>>> to >>>>>>> me how to solve the problem? >>>>>>> >>>>>>> Thank you >>>>>>> XinYiMan >>>>>>> >>>>>>> >>>>>>> >>>>>>> var >>>>>>> start_e : TEventDateTime; >>>>>>> end_e : TEventDateTime; >>>>>>> Entry : TEvent; >>>>>>> begin >>>>>>> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, >>>>>>> my_id_app); >>>>>>> >>>>>>> start_e := TEventDateTime.Create(); >>>>>>> end_e := TEventDateTime.Create(); >>>>>>> >>>>>>> start_e.dateTime := data_appuntamento; >>>>>>> start_e.dateTime := >>>>>>> LocalTimeToUniversal(start_e.dateTime); >>>>>>> start_e.timeZone := 'Europe/Rome'; >>>>>> >>>>>> If you set the timzeone explicitly, I don't think you must do a >>>>>> LocalTimeToUniversal, >>>>>> I think the timezone is then automatically taken into account. As I >>>>>> understand it you specify the timezone in dateTime or you set it in >> the >>>>>> timezone. >>>>>> >>>>>> Michael. >>>>>> >>>>> >>>> >>> >> > From francesco.sammarco at gmail.com Thu Jun 4 09:44:04 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Thu, 4 Jun 2020 09:44:04 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: I tested this way. But not run correctly. Who is the Google API creator? Il giorno gio 4 giu 2020 alle ore 09:32 Michael Van Canneyt < michael at freepascal.org> ha scritto: > > Hello, > > I'm afraid I am of no help here. I am not an expert on the google Calendar > API... > > What you can try to do is set the calendar configuration to your timezone > (Italy/Rome, I suppose) and do not provide any timezone information when > you > create your items. > > Michael. > > On Thu, 4 Jun 2020, Francesco Sammarco wrote: > > > if I change my code in this mode, and change Google Calendar > configuration, > > with Greenwich meridian, I see correct result on Google Calendar. But I'm > > not on Greenwich meridian. > > > > > > I edited the demo calendar. I added a button and inside I put the > following > > code. > > > > procedure TMainForm.Button1Click(Sender: TObject); > > var > > Entry : TEvent; > > Insert : TEvent; > > start_e : TEventDateTime; > > end_e : TEventDateTime; > > begin > > if LBCalendars.ItemIndex<0 then > > Exit; > > > > start_e := TEventDateTime.Create(); > > end_e := TEventDateTime.Create(); > > > > start_e.dateTime := EncodeDateTime(2020,6,3,19,0,0,0); > > start_e.timeZone := 'Europe/London'; > > end_e.dateTime := IncHour(start_e.dateTime,2); > > end_e.timeZone := 'Europe/London'; > > > > Entry := TEvent.Create(); > > Entry.summary := 'My test'; > > Entry.description := 'My test'; > > Entry.location := 'My location'; > > Entry.start := start_e; > > Entry._end := end_e; > > > > Entry.guestsCanInviteOthers := false; > > Entry.guestsCanSeeOtherGuests := false; > > > > Entry.colorId := ''; > > > > Insert := FCalendarAPI.EventsResource.Insert(FCurrentCalendar.id,Entry); > > > > SaveRefreshToken; > > > > > > Entry.Free; > > Entry:=nil; > > > > ShowMessage('Insert ' + Insert.id); > > > > Insert.Free; > > Insert:=nil; > > end; > > > > Il giorno mer 3 giu 2020 alle ore 15:59 Michael Van Canneyt < > > michael at freepascal.org> ha scritto: > > > >> > >> > >> On Wed, 3 Jun 2020, Francesco Sammarco wrote: > >> > >>> sorry and how do I set the date and time of the apartment ?! > >> > >> I would think this is sufficient: > >> > >> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId, > my_id_app); > >> start_e := TEventDateTime.Create(); > >> end_e := TEventDateTime.Create(); > >> start_e.dateTime := data_appuntamento; > >> start_e.timeZone := 'Europe/Rome'; > >> > >> Michael. > >> > >>> > >>> Il mer 3 giu 2020, 15:55 Michael Van Canneyt > ha > >>> scritto: > >>> > >>>> > >>>> > >>>> On Wed, 3 Jun 2020, Francesco Sammarco wrote: > >>>> > >>>>> sorry I don't understand, you say that just remove the lines where I > >>>>> specify the timezone ?! > >>>> > >>>> No, remove the > >>>> > >>>> start_e.dateTime := LocalTimeToUniversal(start_e.dateTime); > >>>> > >>>> I think it is not necessary if you set the timezone. > >>>> > >>>> Michael. > >>>> > >>>> > >>>>> > >>>>> Il mer 3 giu 2020, 14:51 Michael Van Canneyt > > >> ha > >>>>> scritto: > >>>>> > >>>>>> > >>>>>> > >>>>>> On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote: > >>>>>> > >>>>>>> Hi everyone, I have the following problem. I have a calendar > >> (Italian) > >>>> to > >>>>>>> sync with Google Calendar. With the following code I can work quite > >>>> well. > >>>>>>> If today (2020-06-03) I set a new appointment it is saved on google > >>>>>>> calendar on the right day and time, but if for example: always > today > >>>> if I > >>>>>>> set an appointment for December 10, 2020 at 9 am, I find myself > there > >>>>>>> appointment set on the right day but at 8 am. (So an hour behind) I > >>>> think > >>>>>>> it's due to the change between sunlight and daylight. Can anyone > >>>> explain > >>>>>> to > >>>>>>> me how to solve the problem? > >>>>>>> > >>>>>>> Thank you > >>>>>>> XinYiMan > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> var > >>>>>>> start_e : TEventDateTime; > >>>>>>> end_e : TEventDateTime; > >>>>>>> Entry : TEvent; > >>>>>>> begin > >>>>>>> Entry := > FCalendarAPI.EventsResource.Get(CalendarFindedId, > >>>>>>> my_id_app); > >>>>>>> > >>>>>>> start_e := TEventDateTime.Create(); > >>>>>>> end_e := TEventDateTime.Create(); > >>>>>>> > >>>>>>> start_e.dateTime := data_appuntamento; > >>>>>>> start_e.dateTime := > >>>>>>> LocalTimeToUniversal(start_e.dateTime); > >>>>>>> start_e.timeZone := 'Europe/Rome'; > >>>>>> > >>>>>> If you set the timzeone explicitly, I don't think you must do a > >>>>>> LocalTimeToUniversal, > >>>>>> I think the timezone is then automatically taken into account. As I > >>>>>> understand it you specify the timezone in dateTime or you set it in > >> the > >>>>>> timezone. > >>>>>> > >>>>>> Michael. > >>>>>> > >>>>> > >>>> > >>> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Thu Jun 4 10:13:44 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 4 Jun 2020 10:13:44 +0200 (CEST) Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: On Thu, 4 Jun 2020, Francesco Sammarco wrote: > I tested this way. But not run correctly. Who is the Google API creator? Google of course. This is not a problem of the FPC API. The API just tranfers data in a typesafe manner: All it does is give you a way to create and interpret the JSON in a typesafe manner. It does not know or care how Google interprets the data you send, this you need to ask on Google forums or stackoverflow or somesuch. Michael. From luca at wetron.es Thu Jun 4 10:55:14 2020 From: luca at wetron.es (Luca Olivetti) Date: Thu, 4 Jun 2020 10:55:14 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: El 3/6/20 a les 15:54, Michael Van Canneyt via lazarus ha escrit: > > > On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: > >> Hello, >> >> I need to embed a simple web server in my application that >> >> 1) should server a couple of static files >> 2) send server-sent events >> >> https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events >> >> >> >> I can see that 1) is easy, but 2) I cannot see how (fpWeb model >> doesn't seem to allow to take over the socket and keep sending data on >> it). >> I saw an old message regarding websockets and bauglir-websocket but it >> seems it implements a different server and I'd like to run everything >> from the same socket. > > Simply said: You can't in FPC. It turns out I can with some careful, or reckless ;-), overriding. https://paste.ubuntu.com/p/CdHfc7BTHB/ Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Thu Jun 4 11:48:21 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 4 Jun 2020 11:48:21 +0200 (CEST) Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: On Thu, 4 Jun 2020, Luca Olivetti via lazarus wrote: > El 3/6/20 a les 15:54, Michael Van Canneyt via lazarus ha escrit: >> >> >> On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote: >> >>> Hello, >>> >>> I need to embed a simple web server in my application that >>> >>> 1) should server a couple of static files >>> 2) send server-sent events >>> >>> > https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events >>> >>> >>> >>> I can see that 1) is easy, but 2) I cannot see how (fpWeb model >>> doesn't seem to allow to take over the socket and keep sending data on >>> it). >>> I saw an old message regarding websockets and bauglir-websocket but it >>> seems it implements a different server and I'd like to run everything >>> from the same socket. >> >> Simply said: You can't in FPC. > > It turns out I can with some careful, or reckless ;-), overriding. > > https://paste.ubuntu.com/p/CdHfc7BTHB/ Haha, very nice job :-) I'll see if I can integrate this in the HTTPServer request/response. It won't work in fastCGI/CGI of course, but if we can make it available in a http application, why not... Michael. From luca at wetron.es Thu Jun 4 12:04:26 2020 From: luca at wetron.es (Luca Olivetti) Date: Thu, 4 Jun 2020 12:04:26 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: Message-ID: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> El 4/6/20 a les 11:48, Michael Van Canneyt ha escrit: >> It turns out I can with some careful, or reckless ;-),  overriding. >> >> https://paste.ubuntu.com/p/CdHfc7BTHB/ > > Haha, very nice job :-) > > I'll see if I can integrate this in the HTTPServer request/response. > > It won't work in fastCGI/CGI of course, but if we can make it available > in a > http application, why not... I think that approach (take over the socket from the response) could be useful in more cases, e.g. streaming content, websockets, etc. As you say it has to be a stand-alone/embedded server and probably it only works when it's threaded (due to the connection being kept active for an indeterminate time), but that's better than nothing. Now, I have another problem: if the server cannot bind to the port it throws an exception, but then I cannot try again, I have to destroy and recreate the server, e.g. this doesn't work (the second call to FServer.Run return immediately): FServer:=TSseServerHandler.Create(nil); FServer.Port:=8080; FServer.Threaded:=true; while not terminated do try FServer.Run; except on E:Exception do begin writeln(E.Message); sleep(1000); FServer.Terminate; end; end; this does (but I don't like it) while not terminated do try FServer:=TSseServerHandler.Create(nil); FServer.Port:=8080; FServer.Threaded:=true; FServer.Run; except on E:Exception do begin writeln(E.Message); sleep(1000); FServer.Free; end; end; Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Thu Jun 4 14:44:28 2020 From: luca at wetron.es (Luca Olivetti) Date: Thu, 4 Jun 2020 14:44:28 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> References: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> Message-ID: <530fce3a-2ac5-f81c-faa1-945d6c5699c9@wetron.es> El 4/6/20 a les 12:04, Luca Olivetti via lazarus ha escrit: > El 4/6/20 a les 11:48, Michael Van Canneyt ha escrit: > >>> It turns out I can with some careful, or reckless ;-),  overriding. >>> >>> https://paste.ubuntu.com/p/CdHfc7BTHB/ >> >> Haha, very nice job :-) >> >> I'll see if I can integrate this in the HTTPServer request/response. >> >> It won't work in fastCGI/CGI of course, but if we can make it >> available in a >> http application, why not... > > > I think that approach (take over the socket from the response) could be > useful in more cases, e.g. streaming content, websockets, etc. > As you say it has to be a stand-alone/embedded server and probably it > only works when it's threaded (due to the connection being kept active > for an indeterminate time), but that's better than nothing. > > Now, I have another problem: if the server cannot bind to the port it > throws an exception, but then I cannot try again, I have to destroy and > recreate the server, e.g. this doesn't work (the second call to > FServer.Run return immediately): > > >   FServer:=TSseServerHandler.Create(nil); >   FServer.Port:=8080; >   FServer.Threaded:=true; >   while not terminated do >   try >     FServer.Run; >   except >     on E:Exception do >     begin >       writeln(E.Message); >       sleep(1000); >       FServer.Terminate; >     end; >   end; > > > this does (but I don't like it) > >   while not terminated do >   try >     FServer:=TSseServerHandler.Create(nil); >     FServer.Port:=8080; >     FServer.Threaded:=true; >     FServer.Run; >   except >     on E:Exception do >     begin >       writeln(E.Message); >       sleep(1000); >       FServer.Free; >     end; >   end; Oh, and I had to do some more overriding so that the response could have a reference to the calling thread (needed if I want to use synchronize). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Thu Jun 4 15:37:49 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 4 Jun 2020 15:37:49 +0200 (CEST) Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: <530fce3a-2ac5-f81c-faa1-945d6c5699c9@wetron.es> References: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> <530fce3a-2ac5-f81c-faa1-945d6c5699c9@wetron.es> Message-ID: On Thu, 4 Jun 2020, Luca Olivetti via lazarus wrote: >>     FServer.Port:=8080; >>     FServer.Threaded:=true; >>     FServer.Run; >>   except >>     on E:Exception do >>     begin >>       writeln(E.Message); >>       sleep(1000); >>       FServer.Free; >>     end; >>   end; > > Oh, and I had to do some more overriding so that the response could have > a reference to the calling thread (needed if I want to use synchronize). That seems a bit strange, since you can do synchronize without needing access to the thread object using a class method of TThread ? Can you send me the changes you had to do ? Michael. From luca at wetron.es Thu Jun 4 15:51:02 2020 From: luca at wetron.es (Luca Olivetti) Date: Thu, 4 Jun 2020 15:51:02 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> <530fce3a-2ac5-f81c-faa1-945d6c5699c9@wetron.es> Message-ID: El 4/6/20 a les 15:37, Michael Van Canneyt via lazarus ha escrit: > > > On Thu, 4 Jun 2020, Luca Olivetti via lazarus wrote: > >>>      FServer.Port:=8080; >>>      FServer.Threaded:=true; >>>      FServer.Run; >>>    except >>>      on E:Exception do >>>      begin >>>        writeln(E.Message); >>>        sleep(1000); >>>        FServer.Free; >>>      end; >>>    end; >> >> Oh, and I had to do some more overriding so that the response could >> have a reference to the calling thread (needed if I want to use >> synchronize). > > That seems a bit strange, since you can do synchronize without needing > access to the thread object using a class method of TThread ? TThread.Synchronize needs a TThread as the first parameter. This is my work in progress https://paste.ubuntu.com/p/cKdQmCQw7p/ The main difference from the previous pastebin is that I subclass TFPHTTPConnection to add a TThread field and override the CreateConnectionThread to add the thread reference to the connection. And I added more parameters to the server thread to pass on events from the main thread. Tlogger is a simple class defined in utils.pas (not included) that logs messages. The idea is that every time a new sse connection comes in, I notify the main thread (not yet implemented), then in DoSendConnect I enter a loop where I get the data from the main thread (with synchronize) then wait on an event (that the main thread signals every time the data changes). If there is no new data, every 10 seconds I send an empty message as a keepalive. So, I need synchronize: - to notify a new connection - to get data for that connection - to notify that the connection terminated Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From francesco.sammarco at gmail.com Thu Jun 4 16:37:04 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Thu, 4 Jun 2020 16:37:04 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: If anyone cares I think I have found a working way. Basically I do the insertion or updating of the appointment. The API returns the content of the newly updated or inserted appointment, I compare the hours contained with the hours I wanted to set. I calculate the difference and apply it. I make a second update with the correct date / time. I know it's not elegant, but for the moment it seems the only working way. Il giorno gio 4 giu 2020 alle ore 10:13 Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> ha scritto: > > > On Thu, 4 Jun 2020, Francesco Sammarco wrote: > > > I tested this way. But not run correctly. Who is the Google API creator? > > Google of course. > > This is not a problem of the FPC API. > The API just tranfers data in a typesafe manner: > All it does is give you a way to create and interpret the JSON in a > typesafe manner. > > It does not know or care how Google interprets the data you send, this you > need to ask on Google forums or stackoverflow or somesuch. > > Michael. > -- > _______________________________________________ > 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 pascaldragon at googlemail.com Thu Jun 4 17:07:49 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Thu, 4 Jun 2020 17:07:49 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> <530fce3a-2ac5-f81c-faa1-945d6c5699c9@wetron.es> Message-ID: Luca Olivetti via lazarus schrieb am Do., 4. Juni 2020, 15:51: > El 4/6/20 a les 15:37, Michael Van Canneyt via lazarus ha escrit: > > > > > > On Thu, 4 Jun 2020, Luca Olivetti via lazarus wrote: > > > >>> FServer.Port:=8080; > >>> FServer.Threaded:=true; > >>> FServer.Run; > >>> except > >>> on E:Exception do > >>> begin > >>> writeln(E.Message); > >>> sleep(1000); > >>> FServer.Free; > >>> end; > >>> end; > >> > >> Oh, and I had to do some more overriding so that the response could > >> have a reference to the calling thread (needed if I want to use > >> synchronize). > > > > That seems a bit strange, since you can do synchronize without needing > > access to the thread object using a class method of TThread ? > > TThread.Synchronize needs a TThread as the first parameter. > This is my work in progress > The thread parameter can be Nil. TThread will then use the CurrentThread threadvar and failing that it can also work without any thread object. In fact it is safer not to pass a thread. Regards, Sven > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca at wetron.es Thu Jun 4 17:10:03 2020 From: luca at wetron.es (Luca Olivetti) Date: Thu, 4 Jun 2020 17:10:03 +0200 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: <2cfcc67d-d9fb-6401-e7b7-2baeb1f3bc1f@wetron.es> <530fce3a-2ac5-f81c-faa1-945d6c5699c9@wetron.es> Message-ID: El 4/6/20 a les 17:07, Sven Barth ha escrit: > > TThread.Synchronize needs a TThread as the first parameter. > This is my work in progress > > > The thread parameter can be Nil. TThread will then use the CurrentThread > threadvar and failing that it can also work without any thread object. > > In fact it is safer not to pass a thread. Oh, I didn't know that. Thank you. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From wkitty42 at windstream.net Thu Jun 4 17:24:18 2020 From: wkitty42 at windstream.net (wkitty42 at windstream.net) Date: Thu, 4 Jun 2020 11:24:18 -0400 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: Message-ID: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> On 6/4/20 10:37 AM, Francesco Sammarco via lazarus wrote: > If anyone cares I think I have found a working way. Basically I do the insertion > or updating of the appointment. The API returns the content of the newly updated > or inserted appointment, I compare the hours contained with the hours I wanted > to set. I calculate the difference and apply it. I make a second update with the > correct date / time. I know it's not elegant, but for the moment it seems the > only working way. can you not determine if your desired time is in the daylight saving tim eperiod and adjust it as needed before you do the first posting to the calendar? i was going to suggest that yesterday when i first read of your plight but i wanted to wait and see what others might suggest... so basically: 1. you decide your time and date... 2. check if it is within the daylight saving time period for your area... 2a. if #2 is yes, adjust the time as needed... 2b. if #2 is no, leave the time as originally set... 3. publish the appointment/event in the calendar... 4. done ;) -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!* From Special at Joepgen.com Thu Jun 4 18:08:45 2020 From: Special at Joepgen.com (Joe) Date: Thu, 4 Jun 2020 18:08:45 +0200 Subject: [Lazarus] Ignore or Deinstall-Reinstall? Message-ID: During the first run of Lazarus after the installation of the current version of Raspios on a Pi B 8GB it get this error message: "The package EditorMascroScript (pascal script macros) has detected a problem and was deactivated. The package failed its self test with the message "Replace All [Exp: True/Got False]". After restart of Lazarus, this message is not shown again, and the Pascal Script Tab is visible. Can I safely ignore this error message or should I deinstall and install this package? The current Raspios Distro contains Lazarus 2.0.0+dfsg-2, SVN Revision Debian package 2.0.0 arm-linux-gtk2. Regards - Joe From lazarus at mfriebe.de Thu Jun 4 18:13:49 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 4 Jun 2020 18:13:49 +0200 Subject: [Lazarus] Ignore or Deinstall-Reinstall? In-Reply-To: References: Message-ID: On 04/06/2020 18:08, Joe via lazarus wrote: > During the first run of Lazarus after the installation of the current > version of Raspios on a Pi B 8GB it get this error message: > > "The package EditorMascroScript (pascal script macros) has detected a > problem and was deactivated. The package failed its self test with the > message "Replace All [Exp: True/Got False]". > > After restart of Lazarus, this message is not shown again, and the > Pascal Script Tab is visible. > > Can I safely ignore this error message or should I deinstall and > install this package? > > The current Raspios Distro contains Lazarus 2.0.0+dfsg-2, SVN Revision > Debian package 2.0.0 arm-linux-gtk2. > I am not sure that will work on arm (or whatever cpu you have). Pascalscript has some arm support, but not sure it is good enough. The error is about macros in the source editor. You can use normal macros, but not macros with Pascalscript. See https://forum.lazarus.freepascal.org/index.php/topic,50059.msg364619.html#msg364619 From Special at Joepgen.com Thu Jun 4 21:41:38 2020 From: Special at Joepgen.com (Joe) Date: Thu, 4 Jun 2020 21:41:38 +0200 Subject: [Lazarus] Ignore or Deinstall-Reinstall? In-Reply-To: References: Message-ID: Am 04.06.2020 um 18:13 schrieb Martin Frb via lazarus: > On 04/06/2020 18:08, Joe via lazarus wrote: >> During the first run of Lazarus after the installation of the current >> version of Raspios on a Pi B 8GB it get this error message: >> >> "The package EditorMascroScript (pascal script macros) has detected a >> problem and was deactivated. The package failed its self test with >> the message "Replace All [Exp: True/Got False]". >> >> After restart of Lazarus, this message is not shown again, and the >> Pascal Script Tab is visible. >> >> Can I safely ignore this error message or should I deinstall and >> install this package? >> >> The current Raspios Distro contains Lazarus 2.0.0+dfsg-2, SVN >> Revision Debian package 2.0.0 arm-linux-gtk2. >> > > I am not sure that will work on arm (or whatever cpu you have). > Pascalscript has some arm support, but not sure it is good enough. > > The error is about macros in the source editor. > You can use normal macros, but not macros with Pascalscript. > > See > https://forum.lazarus.freepascal.org/index.php/topic,50059.msg364619.html#msg364619 Thank you, Martin. Regards -- Joe From freedos.la at gmail.com Fri Jun 5 03:54:51 2020 From: freedos.la at gmail.com (Ralf Quint) Date: Thu, 4 Jun 2020 18:54:51 -0700 Subject: [Lazarus] Ignore or Deinstall-Reinstall? In-Reply-To: References: Message-ID: On 6/4/2020 9:13 AM, Martin Frb via lazarus wrote: > > The error is about macros in the source editor. > You can use normal macros, but not macros with Pascalscript. I got the same error message when I re-installed Lazarus 2.0.8 on macOS (High Sierra) > > See > https://forum.lazarus.freepascal.org/index.php/topic,50059.msg364619.html#msg364619 Will check this out if this applies in my case too Ralf -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus From francesco.sammarco at gmail.com Fri Jun 5 08:04:22 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Fri, 5 Jun 2020 08:04:22 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> References: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> Message-ID: Of course, it's just not the idea of how to check if the time falls in daylight saving time or not. Il giorno gio 4 giu 2020 alle ore 17:24 wkitty42--- via lazarus < lazarus at lists.lazarus-ide.org> ha scritto: > On 6/4/20 10:37 AM, Francesco Sammarco via lazarus wrote: > > If anyone cares I think I have found a working way. Basically I do the > insertion > > or updating of the appointment. The API returns the content of the newly > updated > > or inserted appointment, I compare the hours contained with the hours I > wanted > > to set. I calculate the difference and apply it. I make a second update > with the > > correct date / time. I know it's not elegant, but for the moment it > seems the > > only working way. > > > can you not determine if your desired time is in the daylight saving tim > eperiod > and adjust it as needed before you do the first posting to the calendar? i > was > going to suggest that yesterday when i first read of your plight but i > wanted to > wait and see what others might suggest... > > so basically: > > 1. you decide your time and date... > 2. check if it is within the daylight saving time period for your area... > 2a. if #2 is yes, adjust the time as needed... > 2b. if #2 is no, leave the time as originally set... > 3. publish the appointment/event in the calendar... > 4. done ;) > > > -- > NOTE: No off-list assistance is given without prior approval. > *Please keep mailing list traffic on the list where it belongs!* > -- > _______________________________________________ > 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 wkitty42 at windstream.net Fri Jun 5 13:54:36 2020 From: wkitty42 at windstream.net (wkitty42 at windstream.net) Date: Fri, 5 Jun 2020 07:54:36 -0400 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> Message-ID: On 6/5/20 2:04 AM, Francesco Sammarco wrote: > Of course, it's just not the idea of how to check if the time falls in daylight > saving time or not. why not? that is the problem and apparently the API and/or backend code at google don't handle it so the creator of the event/appointment must... > Il giorno gio 4 giu 2020 alle ore 17:24 wkitty42--- via lazarus > > ha scritto: > > On 6/4/20 10:37 AM, Francesco Sammarco via lazarus wrote: > > If anyone cares I think I have found a working way. Basically I do the > insertion > > or updating of the appointment. The API returns the content of the newly > updated > > or inserted appointment, I compare the hours contained with the hours I > wanted > > to set. I calculate the difference and apply it. I make a second update > with the > > correct date / time. I know it's not elegant, but for the moment it seems > the > > only working way. > > > can you not determine if your desired time is in the daylight saving tim > eperiod > and adjust it as needed before you do the first posting to the calendar? i was > going to suggest that yesterday when i first read of your plight but i > wanted to > wait and see what others might suggest... > > so basically: > > 1. you decide your time and date... > 2. check if it is within the daylight saving time period for your area... > 2a. if #2 is yes, adjust the time as needed... > 2b. if #2 is no, leave the time as originally set... > 3. publish the appointment/event in the calendar... > 4. done ;) > > > -- >   NOTE: No off-list assistance is given without prior approval. >         *Please keep mailing list traffic on the list where it belongs!* > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!* From francesco.sammarco at gmail.com Fri Jun 5 14:00:23 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Fri, 5 Jun 2020 14:00:23 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> Message-ID: Ok. But not so how to do it. Is there an example? Il giorno ven 5 giu 2020 alle ore 13:54 wkitty42--- via lazarus < lazarus at lists.lazarus-ide.org> ha scritto: > On 6/5/20 2:04 AM, Francesco Sammarco wrote: > > Of course, it's just not the idea of how to check if the time falls in > daylight > > saving time or not. > > > why not? that is the problem and apparently the API and/or backend code at > google don't handle it so the creator of the event/appointment must... > > > > Il giorno gio 4 giu 2020 alle ore 17:24 wkitty42--- via lazarus > > > > ha scritto: > > > > On 6/4/20 10:37 AM, Francesco Sammarco via lazarus wrote: > > > If anyone cares I think I have found a working way. Basically I > do the > > insertion > > > or updating of the appointment. The API returns the content of > the newly > > updated > > > or inserted appointment, I compare the hours contained with the > hours I > > wanted > > > to set. I calculate the difference and apply it. I make a second > update > > with the > > > correct date / time. I know it's not elegant, but for the moment > it seems > > the > > > only working way. > > > > > > can you not determine if your desired time is in the daylight saving > tim > > eperiod > > and adjust it as needed before you do the first posting to the > calendar? i was > > going to suggest that yesterday when i first read of your plight but > i > > wanted to > > wait and see what others might suggest... > > > > so basically: > > > > 1. you decide your time and date... > > 2. check if it is within the daylight saving time period for your > area... > > 2a. if #2 is yes, adjust the time as needed... > > 2b. if #2 is no, leave the time as originally set... > > 3. publish the appointment/event in the calendar... > > 4. done ;) > > > > > > -- > > NOTE: No off-list assistance is given without prior approval. > > *Please keep mailing list traffic on the list where it > belongs!* > > -- > > _______________________________________________ > > lazarus mailing list > > lazarus at lists.lazarus-ide.org > > https://lists.lazarus-ide.org/listinfo/lazarus > > > > > -- > NOTE: No off-list assistance is given without prior approval. > *Please keep mailing list traffic on the list where it belongs!* > -- > _______________________________________________ > 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 jmlandmesser at gmx.de Fri Jun 5 14:04:52 2020 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 5 Jun 2020 14:04:52 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> Message-ID: <5875bf91-8a74-ca2e-bfcb-3d2a044eadcc@gmx.de> As Example for Germany: https://wiki.freepascal.org/Daylight_saving_time/de Am 05.06.20 um 14:00 schrieb Francesco Sammarco via lazarus: > Ok. But not so how to do it. Is there an example? > > Il giorno ven 5 giu 2020 alle ore 13:54 wkitty42--- via lazarus > > > ha scritto: > > On 6/5/20 2:04 AM, Francesco Sammarco wrote: > > Of course, it's just not the idea of how to check if the time > falls in daylight > > saving time or not. > > > why not? that is the problem and apparently the API and/or backend > code at > google don't handle it so the creator of the event/appointment must... > > > > Il giorno gio 4 giu 2020 alle ore 17:24 wkitty42--- via lazarus > > > >> ha scritto: > > > >     On 6/4/20 10:37 AM, Francesco Sammarco via lazarus wrote: > >      > If anyone cares I think I have found a working way. > Basically I do the > >     insertion > >      > or updating of the appointment. The API returns the > content of the newly > >     updated > >      > or inserted appointment, I compare the hours contained > with the hours I > >     wanted > >      > to set. I calculate the difference and apply it. I make a > second update > >     with the > >      > correct date / time. I know it's not elegant, but for the > moment it seems > >     the > >      > only working way. > > > > > >     can you not determine if your desired time is in the > daylight saving tim > >     eperiod > >     and adjust it as needed before you do the first posting to > the calendar? i was > >     going to suggest that yesterday when i first read of your > plight but i > >     wanted to > >     wait and see what others might suggest... > > > >     so basically: > > > >     1. you decide your time and date... > >     2. check if it is within the daylight saving time period for > your area... > >     2a. if #2 is yes, adjust the time as needed... > >     2b. if #2 is no, leave the time as originally set... > >     3. publish the appointment/event in the calendar... > >     4. done ;) > > > > > >     -- > >        NOTE: No off-list assistance is given without prior approval. > >              *Please keep mailing list traffic on the list where > it belongs!* > >     -- > >     _______________________________________________ > >     lazarus mailing list > > lazarus at lists.lazarus-ide.org > > > > > https://lists.lazarus-ide.org/listinfo/lazarus > > > > > -- >   NOTE: No off-list assistance is given without prior approval. >         *Please keep mailing list traffic on the list where it > belongs!* > -- > _______________________________________________ > 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 francesco.sammarco at gmail.com Fri Jun 5 15:57:31 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Fri, 5 Jun 2020 15:57:31 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: <5875bf91-8a74-ca2e-bfcb-3d2a044eadcc@gmx.de> References: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> <5875bf91-8a74-ca2e-bfcb-3d2a044eadcc@gmx.de> Message-ID: Sorry but I knew it is not wise to implement it like this, because being a political choice it can change from year to year. But if there is no alternative, I will proceed on that road too. Il giorno ven 5 giu 2020 alle ore 14:04 John Landmesser via lazarus < lazarus at lists.lazarus-ide.org> ha scritto: > As Example for Germany: > > https://wiki.freepascal.org/Daylight_saving_time/de > > > > > > > > > > Am 05.06.20 um 14:00 schrieb Francesco Sammarco via lazarus: > > Ok. But not so how to do it. Is there an example? > > Il giorno ven 5 giu 2020 alle ore 13:54 wkitty42--- via lazarus < > lazarus at lists.lazarus-ide.org> ha scritto: > >> On 6/5/20 2:04 AM, Francesco Sammarco wrote: >> > Of course, it's just not the idea of how to check if the time falls in >> daylight >> > saving time or not. >> >> >> why not? that is the problem and apparently the API and/or backend code >> at >> google don't handle it so the creator of the event/appointment must... >> >> >> > Il giorno gio 4 giu 2020 alle ore 17:24 wkitty42--- via lazarus >> > > >> ha scritto: >> > >> > On 6/4/20 10:37 AM, Francesco Sammarco via lazarus wrote: >> > > If anyone cares I think I have found a working way. Basically I >> do the >> > insertion >> > > or updating of the appointment. The API returns the content of >> the newly >> > updated >> > > or inserted appointment, I compare the hours contained with the >> hours I >> > wanted >> > > to set. I calculate the difference and apply it. I make a second >> update >> > with the >> > > correct date / time. I know it's not elegant, but for the moment >> it seems >> > the >> > > only working way. >> > >> > >> > can you not determine if your desired time is in the daylight >> saving tim >> > eperiod >> > and adjust it as needed before you do the first posting to the >> calendar? i was >> > going to suggest that yesterday when i first read of your plight >> but i >> > wanted to >> > wait and see what others might suggest... >> > >> > so basically: >> > >> > 1. you decide your time and date... >> > 2. check if it is within the daylight saving time period for your >> area... >> > 2a. if #2 is yes, adjust the time as needed... >> > 2b. if #2 is no, leave the time as originally set... >> > 3. publish the appointment/event in the calendar... >> > 4. done ;) >> > >> > >> > -- >> > NOTE: No off-list assistance is given without prior approval. >> > *Please keep mailing list traffic on the list where it >> belongs!* >> > -- >> > _______________________________________________ >> > lazarus mailing list >> > lazarus at lists.lazarus-ide.org > > >> > https://lists.lazarus-ide.org/listinfo/lazarus >> > >> >> >> -- >> NOTE: No off-list assistance is given without prior approval. >> *Please keep mailing list traffic on the list where it belongs!* >> -- >> _______________________________________________ >> 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 silvioprog at gmail.com Fri Jun 5 18:00:22 2020 From: silvioprog at gmail.com (silvioprog) Date: Fri, 5 Jun 2020 13:00:22 -0300 Subject: [Lazarus] fpWeb and server-sent events In-Reply-To: References: <1db1dac4-9675-22a7-5ea8-20545369ed6c@wetron.es> Message-ID: On Wed, Jun 3, 2020 at 3:46 PM Luca Olivetti via lazarus < lazarus at lists.lazarus-ide.org> wrote: > El 3/6/20 a les 19:41, silvioprog via lazarus ha escrit: > Good, then I guess the question is if firexox and/or chromium are stable > enough to run 24/7 (which I doubt...) 😂 -- Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: From markbass72 at zoho.com Fri Jun 5 18:03:38 2020 From: markbass72 at zoho.com (Marcello) Date: Fri, 5 Jun 2020 18:03:38 +0200 Subject: [Lazarus] Google Calendar API TEvent start or _end (TDatetime) question In-Reply-To: References: <8aa18eaf-7d04-2fe7-ba0b-b4d600dca02c@windstream.net> <5875bf91-8a74-ca2e-bfcb-3d2a044eadcc@gmx.de> Message-ID: <0bf2b965-5d2b-0e04-b6ed-c141d6263274@zoho.com> AFAIK, from 2010, in Italy dayligth starts on last sunday of march and ends the last sunday of october nomorelogic Il 05/06/20 15:57, Francesco Sammarco via lazarus ha scritto: > Sorry but I knew it is not wise to implement it like this, because > being a political choice it can change from year to year. But if there > is no alternative, I will proceed on that road too. > > Il giorno ven 5 giu 2020 alle ore 14:04 John Landmesser via lazarus > > > ha scritto: > > As Example for Germany: > > https://wiki.freepascal.org/Daylight_saving_time/de > From luca at wetron.es Sun Jun 7 11:51:36 2020 From: luca at wetron.es (Luca Olivetti) Date: Sun, 7 Jun 2020 11:51:36 +0200 Subject: [Lazarus] Embed other application window with qt5 Message-ID: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> Hello, I'd like to embed another application window[*] in my application. I found this code https://stackoverflow.com/questions/7611103/embedding-window-into-another-process#7612436 and it works. Since my application should run under windows that should be enough, but I prefer to do my testing under Linux, so I'd like a solution for the qt5 widgetset. I tried this code procedure TForm1.Button1Click(Sender: TObject); var kk:QWindowH; cc: QWidgetH; begin kk:=QWindow_fromWinID(StrToInt64(Edit1.text)); QWindow_setFlags(kk,QtFramelessWindowHint); cc:=QWidget_createWindowContainer(kk); QWidget_setParent(cc,TQtWidget(Self.Handle).Widget); end; and, while the other application window disappears, I don't see it in my form (it's still running though). I tried to find some clues in the mplayer control but it doesn't work with qt (I tried to adapt it with no success), besides it just instructs mplayer to embed itself in a control. [*] actually I need to embed a browser, but none of the alternatives in https://wiki.freepascal.org/Webbrowser work: - turbopower is too limited - I didn't try qtWebkit but it seems qt only - geckoport has been discontinued - fpCEF3 is old and couldn't make it work[**] - CEF4Delphi is windows only at the moment but playing with userChrome.css I could embed firefox as an external application. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Sun Jun 7 12:04:20 2020 From: luca at wetron.es (Luca Olivetti) Date: Sun, 7 Jun 2020 12:04:20 +0200 Subject: [Lazarus] Embed other application window with qt5 In-Reply-To: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> References: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> Message-ID: El 7/6/20 a les 11:51, Luca Olivetti via lazarus ha escrit: > - fpCEF3 is old and couldn't make it work[**] I forgot the [**]: I had to do a couple changes to compile it with fpc 3.2: diff --git a/cef3types.pas b/cef3types.pas index 9598487..6cab661 100644 --- a/cef3types.pas +++ b/cef3types.pas @@ -2412,7 +2412,7 @@ Type // Set to true (1) for thick underline. thick: Integer; end; - TCefCompositionUnderlineArray = array[0..(High(Integer) div SizeOf(TCefCompositionUnderline)) - 1] of TCefCompositionUnderline; + TCefCompositionUnderlineArray = array[0..0 {(High(Integer) div SizeOf(TCefCompositionUnderline)) - 1 FIXME}] of TCefCompositionUnderline; PCefCompositionUnderlineArray = ^TCefCompositionUnderlineArray; Implementation and add ifdefs for LCLQT5 Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Tue Jun 9 09:08:43 2020 From: luca at wetron.es (Luca Olivetti) Date: Tue, 9 Jun 2020 09:08:43 +0200 Subject: [Lazarus] Embed other application window with qt5 In-Reply-To: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> References: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> Message-ID: El 7/6/20 a les 11:51, Luca Olivetti via lazarus ha escrit: > Hello, > > I'd like to embed another application window[*] in my application. > I found this code > > https://stackoverflow.com/questions/7611103/embedding-window-into-another-process#7612436 > > > and it works. Since my application should run under windows that should > be enough, but I prefer to do my testing under Linux, so I'd like a > solution for the qt5 widgetset. > > I tried this code > > procedure TForm1.Button1Click(Sender: TObject); > var kk:QWindowH; >   cc: QWidgetH; > begin >   kk:=QWindow_fromWinID(StrToInt64(Edit1.text)); >   QWindow_setFlags(kk,QtFramelessWindowHint); >   cc:=QWidget_createWindowContainer(kk); >   QWidget_setParent(cc,TQtWidget(Self.Handle).Widget); > end; I also tried QWidget.setParent(cc, TQTMainWindow(handle).GetContainerWidget) and QWidget.setParent(cc, TQTMainWindow(handle).Widget) as well as TQTWidget(panel1.handle).widget but nothing works (the other application disappears but it doesn't show on my form/panel) > > and, while the other application window disappears, I don't see it in my > form (it's still running though). > > I tried to find some clues in the mplayer control but it doesn't work > with qt (I tried to adapt it with no success), besides it just instructs > mplayer to embed itself in a control. > > > [*] actually I need to embed a browser, but none of the alternatives in > https://wiki.freepascal.org/Webbrowser work: > > - turbopower is too limited > - I didn't try qtWebkit but it seems qt only I tried, qt4 only, so no qt5 > - geckoport has been discontinued > - fpCEF3 is old and couldn't make it work[**] > - CEF4Delphi is windows only at the moment > > but playing with userChrome.css I could embed firefox as an external > application. it's tough (firefox is special since firefox.exe isn't directly the owner of its window but it spawns other instances that in turn show the window and it always shows the window borders, no matter what api you try to avoid that) but I managed to do it under windows. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From zeljko at holobit.net Tue Jun 9 09:36:00 2020 From: zeljko at holobit.net (zeljko) Date: Tue, 9 Jun 2020 09:36:00 +0200 Subject: [Lazarus] Embed other application window with qt5 In-Reply-To: References: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> Message-ID: On 6/9/20 9:08 AM, Luca Olivetti via lazarus wrote: >> procedure TForm1.Button1Click(Sender: TObject); >> var kk:QWindowH; >>    cc: QWidgetH; >> begin >>    kk:=QWindow_fromWinID(StrToInt64(Edit1.text)); >>    QWindow_setFlags(kk,QtFramelessWindowHint); >>    cc:=QWidget_createWindowContainer(kk); >>    QWidget_setParent(cc,TQtWidget(Self.Handle).Widget); >> end; > > > I also tried > >    QWidget.setParent(cc, TQTMainWindow(handle).GetContainerWidget) > > and > >    QWidget.setParent(cc, TQTMainWindow(handle).Widget) > > as well as TQTWidget(panel1.handle).widget This works fine here (TPanel on main form, embedded google chrome ): AWindow := QWindow_fromWinID(PtrUInt($8600001)); // found id by xwininfo AWidget := QWidget_createWindowContainer(AWindow, nil, QtWidget or QtForeignWindow); QWidget_setParent(AWidget, TQtWidget(Panel1.Handle).Widget); QWidget_show(AWidget); You're missing QtForeignWindow flag and QWidget_show() for container widget. zeljko From luca at wetron.es Tue Jun 9 10:10:15 2020 From: luca at wetron.es (Luca Olivetti) Date: Tue, 9 Jun 2020 10:10:15 +0200 Subject: [Lazarus] Embed other application window with qt5 In-Reply-To: References: <9a40cfe0-96a9-ae4a-6c55-ed1d41fb4da4@wetron.es> Message-ID: <9cb80bcf-7539-95cb-a5c6-736146e75c75@wetron.es> El 9/6/20 a les 9:36, zeljko ha escrit: > On 6/9/20 9:08 AM, Luca Olivetti via lazarus wrote: > >>> procedure TForm1.Button1Click(Sender: TObject); >>> var kk:QWindowH; >>>    cc: QWidgetH; >>> begin >>>    kk:=QWindow_fromWinID(StrToInt64(Edit1.text)); >>>    QWindow_setFlags(kk,QtFramelessWindowHint); >>>    cc:=QWidget_createWindowContainer(kk); >>>    QWidget_setParent(cc,TQtWidget(Self.Handle).Widget); >>> end; >> >> >> I also tried >> >>     QWidget.setParent(cc, TQTMainWindow(handle).GetContainerWidget) >> >> and >> >>     QWidget.setParent(cc, TQTMainWindow(handle).Widget) >> >> as well as TQTWidget(panel1.handle).widget > > This works fine here (TPanel on main form, embedded google chrome ): > >   AWindow := QWindow_fromWinID(PtrUInt($8600001)); // found id by xwininfo >   AWidget := QWidget_createWindowContainer(AWindow, nil, QtWidget or > QtForeignWindow); >   QWidget_setParent(AWidget, TQtWidget(Panel1.Handle).Widget); >   QWidget_show(AWidget); > > You're missing QtForeignWindow flag and QWidget_show() for container > widget. Thank you! I was also missing the QWidget_show call. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bartjunk64 at gmail.com Wed Jun 10 12:12:12 2020 From: bartjunk64 at gmail.com (Bart) Date: Wed, 10 Jun 2020 12:12:12 +0200 Subject: [Lazarus] WinCE widgetset implementation of TCustomListbox.SelectRange: testers needed. Message-ID: Hi, Can somebody please test the changes I made to the widgetset implementation of TCustomListBox.SelectRange for the WinCE widgetset in r63339. . It compiles and in theory it should work, but I cannot test this. Methods to test: TCustomListBox.SelectAll TCustomListBox.SelectRange, with ALow and AHigh set to values other than zero and Count-1. Thanks in advance. -- Bart From luca at wetron.es Wed Jun 10 13:57:52 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 10 Jun 2020 13:57:52 +0200 Subject: [Lazarus] create bng with transparent background Message-ID: <458fa52c-f5e9-4116-0725-cef8aa403981@wetron.es> Hello, is there a way to create a png with transparent background? I tried the suggestion here http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-to-create-a-transparent-PNG-td4047716.html to set the brush to bsClear but it doesn't work. I also tried with a TFPMemoryImage using either a brush or a pen with alphaTransparent but I couldn't have a transparent png, the background is always black. Regards -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From ryansmithhe at gmail.com Wed Jun 10 14:52:00 2020 From: ryansmithhe at gmail.com (R.Smith) Date: Wed, 10 Jun 2020 14:52:00 +0200 Subject: [Lazarus] create bng with transparent background In-Reply-To: <458fa52c-f5e9-4116-0725-cef8aa403981@wetron.es> References: <458fa52c-f5e9-4116-0725-cef8aa403981@wetron.es> Message-ID: <47913dbc-881d-a23e-7dd5-f83ef43c5c3e@gmail.com> On 2020/06/10 13:57, Luca Olivetti via lazarus wrote: > Hello, > > is there a way to create a png with transparent background? > > I tried the suggestion here > > http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-to-create-a-transparent-PNG-td4047716.html > > > to set the brush to bsClear but it doesn't work. > I also tried with a TFPMemoryImage using either a brush or a pen with > alphaTransparent but I couldn't have a transparent png, the background > is always black. The brush.style:=bsClear merely dictates how any next additive drawing will fill its specific background area, for instance if you were to add Text to the image it will draw the text without a background, which is useful if you wish to write on pictures or transparent PNGs. I think the best way to make a transparent PNG currently, is to do what you did, but then paint at least the upper left corner pixel with a transparency of 1 and not Zero, which you still won't see, however, may I suggest using the very useful BGRA Bitmap package? Then it simply becomes a question of: uses   ... BGRABitmap, BGRABitmapTypes, ... var   bmp : TBGRABitmap;   png : TPortableNetworkGraphic; ...   bmp := TBGRABitmap.Create( neededWidth, neededHeight );   png := TPortableNetworkGraphic.Create;   bmp.FillRect( bmp.ClipRect, BGRAPixelTransparent, dmSet );   png.Assign( bmp ); Done. Obviously the real advantage of those BGRA tools is when you actually wish to draw stuff on the image. Also, how do you know the output PNG file is not transparent? I ask because windows and windows viewers will sometimes show a perfectly transaprent PNG with a Black/White background. The only safe way to know is to open it in Paint or GIMP or such. (Linux typically doesn't lie like that, but any specific viewer may of course still do it some arbitrary way. A graphic editor is obliged to show the real content.) Note: That BGRAPixelTransaprent is simply an internally defined TPixel with R G B and Alpha all set to 0, so you can also make up your own transparent pixel and use that in stead. Good luck! From luca at wetron.es Wed Jun 10 15:04:05 2020 From: luca at wetron.es (Luca Olivetti) Date: Wed, 10 Jun 2020 15:04:05 +0200 Subject: [Lazarus] create bng with transparent background In-Reply-To: <47913dbc-881d-a23e-7dd5-f83ef43c5c3e@gmail.com> References: <458fa52c-f5e9-4116-0725-cef8aa403981@wetron.es> <47913dbc-881d-a23e-7dd5-f83ef43c5c3e@gmail.com> Message-ID: <329112ef-725d-cb19-f211-e9a48dffeb6b@wetron.es> El 10/6/20 a les 14:52, R.Smith via lazarus ha escrit: > I think the best way to make a transparent PNG currently, is to do what > you did, but then paint at least the upper left corner pixel with a > transparency of 1 and not Zero, which you still won't see, however, may > I suggest using the very useful BGRA Bitmap package? Then it simply > becomes a question of: Yes, that's what I finally did, but it's overkill considering that I just need to generate a circle with a specified color. > > Also, how do you know the output PNG file is not transparent? I ask > because windows and windows viewers will sometimes show a perfectly > transaprent PNG with a Black/White background. The only safe way to know > is to open it in Paint or GIMP or such. (Linux typically doesn't lie > like that, but any specific viewer may of course still do it some > arbitrary way. A graphic editor is obliged to show the real content.) I loaded them in firefox (which is the intended usage since the application is a webserver). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From pascaldragon at googlemail.com Thu Jun 11 12:25:34 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Thu, 11 Jun 2020 12:25:34 +0200 Subject: [Lazarus] WinCE widgetset implementation of TCustomListbox.SelectRange: testers needed. In-Reply-To: References: Message-ID: Am 10.06.2020 um 12:12 schrieb Bart via lazarus: > Hi, > > Can somebody please test the changes I made to the widgetset > implementation of TCustomListBox.SelectRange for the WinCE widgetset > in r63339. > . > It compiles and in theory it should work, but I cannot test this. > > Methods to test: > TCustomListBox.SelectAll > TCustomListBox.SelectRange, with ALow and AHigh set to values other > than zero and Count-1. > > Thanks in advance. Had to dust off my old Windows Mobile phone for this and get Windows Mobile Device Center working on Windows 10, but yes, it works as on Windows. :) (boy, that took me back ^^') Regards, Sven From bartjunk64 at gmail.com Thu Jun 11 12:59:54 2020 From: bartjunk64 at gmail.com (Bart) Date: Thu, 11 Jun 2020 12:59:54 +0200 Subject: [Lazarus] WinCE widgetset implementation of TCustomListbox.SelectRange: testers needed. In-Reply-To: References: Message-ID: On Thu, Jun 11, 2020 at 12:25 PM Sven Barth via lazarus wrote: > Had to dust off my old Windows Mobile phone for this and get Windows > Mobile Device Center working on Windows 10, but yes, it works as on > Windows. :) (boy, that took me back ^^') Thanks for testing and reporting back. AFAIK we don't have an official WinCE maintainer for Lazarus ATM. -- Bart From pascaldragon at googlemail.com Thu Jun 11 13:32:39 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Thu, 11 Jun 2020 13:32:39 +0200 Subject: [Lazarus] WinCE widgetset implementation of TCustomListbox.SelectRange: testers needed. In-Reply-To: References: Message-ID: <4623684e-1595-ed0a-9e9a-65530c8b2957@googlemail.com> Am 11.06.2020 um 12:59 schrieb Bart via lazarus: > On Thu, Jun 11, 2020 at 12:25 PM Sven Barth via lazarus > wrote: > >> Had to dust off my old Windows Mobile phone for this and get Windows >> Mobile Device Center working on Windows 10, but yes, it works as on >> Windows. :) (boy, that took me back ^^') > Thanks for testing and reporting back. > AFAIK we don't have an official WinCE maintainer for Lazarus ATM. We don't have an official one for WinCE on the FPC side either, but I *do* look out for it, because back then ('06) it was the reason for me to switch from Delphi to FPC and Lazarus, so I kinda have a soft spot for it. :) Regards, Sven From aaa5500 at ya.ru Thu Jun 11 16:20:14 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Thu, 11 Jun 2020 17:20:14 +0300 Subject: [Lazarus] Gtk2 ExtTextOut internal helper is slow Message-ID: <3b855106-5eb9-b471-6af8-4d0c334f0018@ya.ru> gtk2devicecontext.inc procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt); var   OldStr: PChar; begin   OldStr := pango_layout_get_text(ALayout);   if (strlen(OldStr)<>ALength) or (strlcomp(AText, OldStr, ALength) <> 0) then     pango_layout_set_text(ALayout, AText, ALength); end; as you see it's slow a) get oldstr b) compare oldstr by 2 funcs why this cache is needed? to call ExtTextOut() 20 times with the same x/y/s ? so I suggest to del checks - just call pango_layout_set_text and that's it. Alexey Torgashin From lazarus at mfriebe.de Thu Jun 11 19:54:23 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 11 Jun 2020 19:54:23 +0200 Subject: [Lazarus] Gtk2 ExtTextOut internal helper is slow In-Reply-To: <3b855106-5eb9-b471-6af8-4d0c334f0018@ya.ru> References: <3b855106-5eb9-b471-6af8-4d0c334f0018@ya.ru> Message-ID: <43fa0958-96d7-917b-bcb6-2e6daf160c0d@mfriebe.de> On 11/06/2020 16:20, Alexey Tor. via lazarus wrote: > > to call ExtTextOut() 20 times with the same x/y/s ? > so I suggest to del checks - just call pango_layout_set_text and > that's it. I do not know if this is related. But test your changes with Synedit extra-char-width. You can set the extra char width to 1 (or greater) in the IDE for the source editor. Make sure that works. Also test with Japanese double width chars in SynEdit. アkj (randomly typed, no idea if or what it means) And maybe Arabic right to left script. (checking that the caret works, and text is stable while selection is changed char by char) From maaartinus at gmail.com Fri Jun 12 00:36:41 2020 From: maaartinus at gmail.com (Martin Grajcar) Date: Fri, 12 Jun 2020 00:36:41 +0200 Subject: [Lazarus] How to stop the ChildSizing? Message-ID: There's a TPage containing a few components I want to position and size manually (sort of position: 'absolute' in CSS). It works well, but then the LCL comes and overrides my work.... I've played with Anchors, AutoSize and Align of both the parent (TPage) and child components for quite a while, but nothing helped. I finally sort of solved it by overriding SetBound in the children, so that only my own calls get honoured. It works, but it isn't possible with standard components, so I'm looking for something better. Any idea? -------------- next part -------------- An HTML attachment was scrubbed... URL: From werner.pamler at freenet.de Fri Jun 12 10:41:07 2020 From: werner.pamler at freenet.de (Werner Pamler) Date: Fri, 12 Jun 2020 10:41:07 +0200 Subject: [Lazarus] How to stop the ChildSizing? In-Reply-To: References: Message-ID: <310102b3-3c28-eeac-8dfb-979bde32a936@freenet.de> Am 12.06.2020 um 00:36 schrieb Martin Grajcar via lazarus: > There's a TPage containing a few components I want to position and > size manually (sort of position: 'absolute' in CSS). It works well, > but then the LCL comes and overrides my work.... > > I've played with Anchors, AutoSize and Align of both the parent > (TPage) and child components for quite a while, but nothing helped. I > finally sort of solved it by overriding SetBound in the children, so > that only my own calls get honoured. > > It works, but it isn't possible with standard components, so I'm > looking for something better. Any idea? I don't know what you were doing, but normally the components do not move and resize, they remain at their position relative to the top and left edges of their parent. If - as the title of your message suggests - you misconfigured ChildSizing you should set ChildSizing.Layout to cclNone (for the Parent), and all controls should be movable again. From luca at wetron.es Sun Jun 14 18:51:13 2020 From: luca at wetron.es (Luca Olivetti) Date: Sun, 14 Jun 2020 18:51:13 +0200 Subject: [Lazarus] Customizing image preview in TOpenPictureDialog Message-ID: <79a79a89-4fc4-1111-3f7b-c288f3da3e23@wetron.es> Hello, in order to show animated gif, png and webp images, I subclassed the TOpenPictureDialog and overrode the ClearPreview and UpdatePreview methods. Those methods are called but the picture shown isn't the one I try to show in my overridden UpdatePreview (e.g. I load a different picture that the one selected but the dialog happily shows the selected one, or e.g.2 I added support for webp images and under windows they don't show, they do with qt5 but they show also with the standard control). What's the correct method to customize the preview? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bo.berglund at gmail.com Thu Jun 18 09:54:16 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 18 Jun 2020 09:54:16 +0200 Subject: [Lazarus] Is list down? Message-ID: I seem not to get any new posts recently... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Jun 18 09:55:55 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 18 Jun 2020 09:55:55 +0200 Subject: [Lazarus] Is list down? References: Message-ID: <5f7mef1i6ntktq0uq20gshsf3tkup60gau@4ax.com> On Thu, 18 Jun 2020 09:54:16 +0200, Bo Berglund via lazarus wrote: >I seem not to get any new posts recently... > No, this came through, so it is probably just summer holiday traffic.... -- Bo Berglund Developer in Sweden From kadissov.e at gmail.com Thu Jun 18 10:52:46 2020 From: kadissov.e at gmail.com (=?UTF-8?B?0JXQstCz0LXQvdC40Lkg0JrQsNC00LjRgdC+0LI=?=) Date: Thu, 18 Jun 2020 11:52:46 +0300 Subject: [Lazarus] call stack Message-ID: Hi everybody. In what cases can be such a situation. The call stack is full of strange stuff and does not contain any string of the debugged code. -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca at wetron.es Thu Jun 18 11:42:52 2020 From: luca at wetron.es (Luca Olivetti) Date: Thu, 18 Jun 2020 11:42:52 +0200 Subject: [Lazarus] call stack In-Reply-To: References: Message-ID: <08aefa93-eb63-7c45-4c4e-a606c4e291da@wetron.es> El 18/6/20 a les 10:52, Евгений Кадисов via lazarus ha escrit: > Hi everybody. > In what cases can be such a situation. The call stack is full of strange > stuff and does not contain any string of the debugged code. > That's because it's either an external library or some pascal code with no debug information (i.e. the freepascal rtl/fcl is distributed without debug information). In the latter case you'll have to rebuild the rtl/fcl with debug information (I defer to the experts on how to do this, every time I have to search duckduckgo/google to see how to do it), if the former and you're using linux, you'll have to install the debug/dbgsym packages of the libraries as well as the sources (again, duckduckgo/google is your friend). I noticed that lazarus has some limited support to step through C code, that's nice when you're struggling to see why an external library is failing. It could also be that the code has debug information but in a different format that your application. 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 Thu Jun 18 14:32:02 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 18 Jun 2020 14:32:02 +0200 Subject: [Lazarus] call stack In-Reply-To: References: Message-ID: <9189d0aa-fd26-64a6-3cbe-625c9d0d668b@mfriebe.de> On 18/06/2020 10:52, Евгений Кадисов via lazarus wrote: > Hi everybody. > In what cases can be such a situation. The call stack is full of > strange stuff and does not contain any string of the debugged code. > Make sure to open the threads window, and set each thread to current. Even if your app does not have threads, there may be some. How did your app stop/pause? Did you single step? Did you hit the pause button? Did the app report an error? The pause button: Unless your app is 100% busy (form does not respond), the pause button will probably pause your app in the kernel. Otherwise it may be in the wrong thread. App reported Error. This can be in a library. Sometimes libraries produces stacks that can not be read by the debugger. But also make sure you show more than 10 frame, if available. Or this can be a SigSegV, which can (one of many reasons) be due to a corrupt stack. In that case there is no stack no more. (Make sure you compile with range checking) From aaa5500 at ya.ru Sat Jun 20 11:56:31 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sat, 20 Jun 2020 12:56:31 +0300 Subject: [Lazarus] IDE source editor blue-panel bug Message-ID: <85793e4b-f253-5066-baac-ba86d735cd3e@ya.ru> get project CudaText https://github.com/alexey-t/cudatext/ open its file formmain_py_api.inc, scroll to function Py_GetTokenList(Adapter: TATAdapterEControl; ALineFrom, ALineTo: integer): PPyObject; now move caret lower so that IDE shows blue-ribbon on top of source editor. expected: IDE shows blue panel with title of function. reality: IDE shows blue panel with crap "Token: PecSyntToken" the same - with the next function, function Py_ed_get_token(Self, Args: PPyObject): PPyObject; cdecl; IDE shows blue panel for it: "Ed: TATSynEdit". -- Regards, Alexey -------------- next part -------------- A non-text attachment was scrubbed... Name: tip-ide.png Type: image/png Size: 15036 bytes Desc: not available URL: From fpc at pascalprogramming.org Sat Jun 20 16:28:19 2020 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Sat, 20 Jun 2020 16:28:19 +0200 Subject: [Lazarus] Free Pascal 3.2.0 released ! Message-ID: <58da14fc-3854-e4ff-fc2d-737b304c96b6@pascalprogramming.org> Hello, Finally, the Free Pascal 3.2.0 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.0. For an overview of what is new see https://wiki.freepascal.org/FPC_New_Features_3.2 The website has been update 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.0/ Enjoy! The Free Pascal Compiler Team From lazarus at mfriebe.de Sat Jun 20 16:42:14 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Jun 2020 16:42:14 +0200 Subject: [Lazarus] IDE source editor blue-panel bug In-Reply-To: <85793e4b-f253-5066-baac-ba86d735cd3e@ya.ru> References: <85793e4b-f253-5066-baac-ba86d735cd3e@ya.ru> Message-ID: <9f09a115-e588-4b0c-2955-d6ed19dfd436@mfriebe.de> Updated to 4814dabcf239faf6f0cae913b900160ad2a5a038 With current Lazarus trunk, I can not reproduce this. Please test with default settings of the IDE. I.e. move your existing EditorOptions.xml away, and see if it still happens. If it does not happen with default settings, but only with your EditorOptions.xml, then please provide a copy of it. On 20/06/2020 11:56, Alexey Tor. via lazarus wrote: > get project CudaText > https://github.com/alexey-t/cudatext/ > open its file formmain_py_api.inc, scroll to > function Py_GetTokenList(Adapter: TATAdapterEControl; ALineFrom, > ALineTo: integer): PPyObject; > now move caret lower so that IDE shows blue-ribbon on top of source > editor. > > expected: IDE shows blue panel with title of function. > reality: IDE shows blue panel with crap "Token: PecSyntToken" > > the same - with the next function, > function Py_ed_get_token(Self, Args: PPyObject): PPyObject; cdecl; > IDE shows blue panel for it: "Ed: TATSynEdit". > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Sat Jun 20 16:47:44 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Jun 2020 16:47:44 +0200 Subject: [Lazarus] IDE source editor blue-panel bug In-Reply-To: <9f09a115-e588-4b0c-2955-d6ed19dfd436@mfriebe.de> References: <85793e4b-f253-5066-baac-ba86d735cd3e@ya.ru> <9f09a115-e588-4b0c-2955-d6ed19dfd436@mfriebe.de> Message-ID: On 20/06/2020 16:42, Martin Frb via lazarus wrote: > Updated to 4814dabcf239faf6f0cae913b900160ad2a5a038 > > With current Lazarus trunk, I can not reproduce this. Got it, you must have some lines folded above the function for this to manifest. From lazarus at mfriebe.de Sat Jun 20 17:22:37 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 20 Jun 2020 17:22:37 +0200 Subject: [Lazarus] IDE source editor blue-panel bug In-Reply-To: References: <85793e4b-f253-5066-baac-ba86d735cd3e@ya.ru> <9f09a115-e588-4b0c-2955-d6ed19dfd436@mfriebe.de> Message-ID: On 20/06/2020 16:47, Martin Frb via lazarus wrote: > On 20/06/2020 16:42, Martin Frb via lazarus wrote: >> Updated to 4814dabcf239faf6f0cae913b900160ad2a5a038 >> >> With current Lazarus trunk, I can not reproduce this. > > Got it, you must have some lines folded above the function for this to > manifest. Should be fixed r63403 From bo.berglund at gmail.com Sun Jun 21 07:18:42 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 21 Jun 2020 07:18:42 +0200 Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? Message-ID: Is it possible to switch Lazarus between using fpc 3.0.4 and 3.2.0 so as to compare the two easily? If possible, how? Or do I need a complete installation Lazarus/Fpc for the two fpc versions? -- Bo Berglund Developer in Sweden From leledumbo_cool at yahoo.co.id Sun Jun 21 08:04:36 2020 From: leledumbo_cool at yahoo.co.id (leledumbo) Date: Sat, 20 Jun 2020 23:04:36 -0700 (MST) Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: References: Message-ID: <1592719476863-0.post@n3.nabble.com> > Or do I need a complete installation Lazarus/Fpc for the two fpc versions? Just the FPC is enough. In Lazarus, you can make multiple build modes for each FPC version (set the compiler command right), respectively and set the configuration as default. That's as easy as Lazarus can get in its current state. -- Sent from: http://free-pascal-lazarus.989080.n3.nabble.com/ From michael at freepascal.org Sun Jun 21 09:53:47 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 21 Jun 2020 09:53:47 +0200 (CEST) Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: References: Message-ID: On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote: > Is it possible to switch Lazarus between using fpc 3.0.4 and 3.2.0 so > as to compare the two easily? Yes. Just install the new FPC alongside the old one. The simplest is then to copy the lazarus settings directory, and create a shortcut where you start lazarus with --pcp=/path/to/copy In this, under Tools-Options dialog, page Environment-Files set - the correct compiler binary in 'Compiler Executable', - and the correct path to the 3.2.0 sources in 'FPC Source directory' That's it. Now you can start 2 instances of lazarus, with a different setting for the compiler version. I have 4 or 5 such versions. Michael. From bo.berglund at gmail.com Sun Jun 21 10:59:50 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 21 Jun 2020 10:59:50 +0200 Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? References: Message-ID: On Sun, 21 Jun 2020 09:53:47 +0200 (CEST), Michael Van Canneyt via lazarus wrote: > > >On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote: > >> Is it possible to switch Lazarus between using fpc 3.0.4 and 3.2.0 so >> as to compare the two easily? > >Yes. > >Just install the new FPC alongside the old one. > >The simplest is then to copy the lazarus settings directory, >and create a shortcut where you start lazarus with --pcp=/path/to/copy > >In this, under Tools-Options dialog, page Environment-Files set >- the correct compiler binary in 'Compiler Executable', >- and the correct path to the 3.2.0 sources in 'FPC Source directory' > >That's it. > >Now you can start 2 instances of lazarus, with a different setting for the >compiler version. > >I have 4 or 5 such versions. Thanks, that seems simple enough. :) Just a follow-up: After downloading the 3.2.0 sources via svn I went into the new 3.2.0 dir and did (I am using an RPi4 computer with 4GB RAM): $ time make all FPC=/home/pi/bin/ppcarm OPT=-dFPC_ARMHF So I did not do a "make install"... I also did: $ cp .lazarus_2.0.8 ./.lazarus_2.0.8_3.2 Is the above OK for using the compiler as outlined above pointing the shortcut to to the new dir as you outlined? Beware though!!!! ----------------- I have fallen into the trap of copying the pcp dir when installing a new version of Lazarus before. Then unbeknown to me Lazarua used installed components where the paths pointed to the *previous* version. That resulted in both Lazarus versions sharing the exact same files including generated binaries.... So I had to scan the files in the pcp dir for the old pcp dir path and change it to the new path! It turned out to be a bunch of xml and cfg files, in my case 13 cases: codetoolsoptions.xml environmentoptions.xml includelinks.xml inputhistory.xml packagefiles.xml idemake.cfg -- Bo Berglund Developer in Sweden From michael at freepascal.org Sun Jun 21 11:12:17 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 21 Jun 2020 11:12:17 +0200 (CEST) Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: References: Message-ID: >> Now you can start 2 instances of lazarus, with a different setting for the >> compiler version. >> >> I have 4 or 5 such versions. > > Thanks, that seems simple enough. :) It is. > > Just a follow-up: > After downloading the 3.2.0 sources via svn I went into the new 3.2.0 > dir and did (I am using an RPi4 computer with 4GB RAM): > > $ time make all FPC=/home/pi/bin/ppcarm OPT=-dFPC_ARMHF > > So I did not do a "make install"... > > I also did: > $ cp .lazarus_2.0.8 ./.lazarus_2.0.8_3.2 > > Is the above OK for using the compiler as outlined above pointing the > shortcut to to the new dir as you outlined? You need to do the "make install". How else will the compiler find the units when compiling ? > > Beware though!!!! > ----------------- > I have fallen into the trap of copying the pcp dir when installing a > new version of Lazarus before. Then unbeknown to me Lazarua used > installed components where the paths pointed to the *previous* > version. > That resulted in both Lazarus versions sharing the exact same files > including generated binaries.... This is so, but it does not have to be a problem: you must not recompile lazarus itself using such a secondary copy. I only recompile lazarus using the configuration with the official released FPC. Michael. From bo.berglund at gmail.com Sun Jun 21 12:10:20 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 21 Jun 2020 12:10:20 +0200 Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? References: Message-ID: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> On Sun, 21 Jun 2020 11:12:17 +0200 (CEST), Michael Van Canneyt via lazarus wrote: >This is so, but it does not have to be a problem: you must not recompile >lazarus itself using such a secondary copy. Since Lazarus recompiles itself when one installs a new package, how can I deal with that? The compiler executable was set in Lazarus to "fpc" i.e. no path at all. I changed it to /home/pi/dev/fpc/3.2.0/compiler/ppcarm Is this the correct way to do it? Lazarus help/about still says FPC is version 3.0.4 (I guess it knows which version compiled it).. Is there a way I can verify if the settings are modified correctly and the new fpc is in use for this Lazarus invocation? -- Bo Berglund Developer in Sweden From michael at freepascal.org Sun Jun 21 12:45:31 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 21 Jun 2020 12:45:31 +0200 (CEST) Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> References: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> Message-ID: On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote: > On Sun, 21 Jun 2020 11:12:17 +0200 (CEST), Michael Van Canneyt via > lazarus wrote: > >> This is so, but it does not have to be a problem: you must not recompile >> lazarus itself using such a secondary copy. > > Since Lazarus recompiles itself when one installs a new package, how > can I deal with that? Always make sure you do this with the default. > > The compiler executable was set in Lazarus to "fpc" i.e. no path at > all. > I changed it to /home/pi/dev/fpc/3.2.0/compiler/ppcarm > Is this the correct way to do it? Yes. > > Lazarus help/about still says FPC is version 3.0.4 (I guess it knows > which version compiled it).. Yes. > > Is there a way I can verify if the settings are modified correctly and > the new fpc is in use for this Lazarus invocation? Compile a program begin writeln({$I %FPCVERSION}); end. and check the output. Michael. From michael at freepascal.org Sun Jun 21 12:45:31 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 21 Jun 2020 12:45:31 +0200 (CEST) Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> References: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> Message-ID: On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote: > On Sun, 21 Jun 2020 11:12:17 +0200 (CEST), Michael Van Canneyt via > lazarus wrote: > >> This is so, but it does not have to be a problem: you must not recompile >> lazarus itself using such a secondary copy. > > Since Lazarus recompiles itself when one installs a new package, how > can I deal with that? Always make sure you do this with the default. > > The compiler executable was set in Lazarus to "fpc" i.e. no path at > all. > I changed it to /home/pi/dev/fpc/3.2.0/compiler/ppcarm > Is this the correct way to do it? Yes. > > Lazarus help/about still says FPC is version 3.0.4 (I guess it knows > which version compiled it).. Yes. > > Is there a way I can verify if the settings are modified correctly and > the new fpc is in use for this Lazarus invocation? Compile a program begin writeln({$I %FPCVERSION}); end. and check the output. Michael. From jyv110 at gmail.com Sun Jun 21 14:42:43 2020 From: jyv110 at gmail.com (Jy V) Date: Sun, 21 Jun 2020 14:42:43 +0200 Subject: [Lazarus] Free Pascal 3.2.0 released ! In-Reply-To: <58da14fc-3854-e4ff-fc2d-737b304c96b6@pascalprogramming.org> References: <58da14fc-3854-e4ff-fc2d-737b304c96b6@pascalprogramming.org> Message-ID: maybe a typo in the documentation in section https://wiki.freepascal.org/User_Changes_3.2.0#Process_Unit pnoconsole on Windows New behaviour: ponewconsole maps to CREATE_NO_WINDOW should probably refer to "pnoconsole" instead of "ponewconsole" On Sat, Jun 20, 2020 at 4:28 PM Marco van de Voort via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Hello, > > Finally, the Free Pascal 3.2.0 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.0. > > For an overview of what is new see > > https://wiki.freepascal.org/FPC_New_Features_3.2 > > The website has been update 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.0/ > > Enjoy! > > The Free Pascal Compiler Team > > -- > _______________________________________________ > 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 nc-gaertnma at netcologne.de Sun Jun 21 15:09:59 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 21 Jun 2020 15:09:59 +0200 Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> References: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> Message-ID: <20200621150959.0cd435f5@limapholos.matflo.wg> On Sun, 21 Jun 2020 12:10:20 +0200 Bo Berglund via lazarus wrote: >[...] > Since Lazarus recompiles itself when one installs a new package, how > can I deal with that? The IDE uses the default fpc, set in Tools / Options / Environment / Files. Every project can use its own compiler. When you install a package, the default compiler is used. > The compiler executable was set in Lazarus to "fpc" i.e. no path at > all. Then it is searched via PATH. > I changed it to /home/pi/dev/fpc/3.2.0/compiler/ppcarm The 'compiler' folder looks like the FPC source directory. When you install fpc, the path should be something like /installbasedir/lib/fpc/3.2.0/ppcarm > Is this the correct way to do it? > > Lazarus help/about still says FPC is version 3.0.4 (I guess it knows > which version compiled it).. Yes. > Is there a way I can verify if the settings are modified correctly and > the new fpc is in use for this Lazarus invocation? View / IDE Internals / About FPC Mattias From bo.berglund at gmail.com Sun Jun 21 17:12:08 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 21 Jun 2020 17:12:08 +0200 Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? References: <3ubueflpfrjsjrtlsj2k6qg44dg6seh6u9@4ax.com> <20200621150959.0cd435f5@limapholos.matflo.wg> Message-ID: On Sun, 21 Jun 2020 15:09:59 +0200, Mattias Gaertner via lazarus wrote: >> I changed it to /home/pi/dev/fpc/3.2.0/compiler/ppcarm > >The 'compiler' folder looks like the FPC source directory. > >When you install fpc, the path should be something like >/installbasedir/lib/fpc/3.2.0/ppcarm > Thanks for the pointer! Yes this is the source dir. I now changed it to: /home/pi/lib/fpc/3.2.0/ppcarm This is where "make install" inside the fpc source dir put it. (I always avoid locations outside the home dir...) -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sun Jun 21 18:30:23 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 21 Jun 2020 18:30:23 +0200 Subject: [Lazarus] Making a Linux systemd service, how does one handle the shutdown? Message-ID: I have read that a systemd service on Linux will be taken down by the service manager using kill -TERM, i.e. the application is given a chance for a clean shutdown. So my question is: How/where do I implement a handler for the terminate message in a FreePascal console application (no GUI or form available)? I have never done anything similar to this but I think that this might be a way to solve my problem of porting a Windows TService application to Linux by changing the framework from the Delphi TService to a simple program... -- Bo Berglund Developer in Sweden From michael at freepascal.org Sun Jun 21 18:45:23 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 21 Jun 2020 18:45:23 +0200 (CEST) Subject: [Lazarus] Making a Linux systemd service, how does one handle the shutdown? In-Reply-To: References: Message-ID: On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote: > I have read that a systemd service on Linux will be taken down by the > service manager using kill -TERM, i.e. the application is given a > chance for a clean shutdown. > > So my question is: > How/where do I implement a handler for the terminate message in a > FreePascal console application (no GUI or form available)? https://www.freepascal.org/docs-html/current/rtl/sysutils/hooksignal.html or https://www.freepascal.org/docs-html/current/rtl/baseunix/fpsigaction.html You should install handlers for SIGQUIT/SIGTERM/SIGINT The hooksignal internally uses fpsigaction, by the way. Michael. From michael at freepascal.org Sun Jun 21 18:45:23 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 21 Jun 2020 18:45:23 +0200 (CEST) Subject: [Lazarus] Making a Linux systemd service, how does one handle the shutdown? In-Reply-To: References: Message-ID: On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote: > I have read that a systemd service on Linux will be taken down by the > service manager using kill -TERM, i.e. the application is given a > chance for a clean shutdown. > > So my question is: > How/where do I implement a handler for the terminate message in a > FreePascal console application (no GUI or form available)? https://www.freepascal.org/docs-html/current/rtl/sysutils/hooksignal.html or https://www.freepascal.org/docs-html/current/rtl/baseunix/fpsigaction.html You should install handlers for SIGQUIT/SIGTERM/SIGINT The hooksignal internally uses fpsigaction, by the way. Michael. From lazarus at mfriebe.de Mon Jun 22 16:14:40 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 22 Jun 2020 16:14:40 +0200 Subject: [Lazarus] We are planning the next release: Lazarus 2.0.10 Message-ID: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> The Lazarus team has scheduled      Lazarus 2.0.10      for July 2020 (estimated 4th to 11th) This release will be built with_*FPC 3.2.0*_. Here is the list of fixes for Lazarus 2.0.10 (since 2.0.0): http://wiki.freepascal.org/Lazarus_2.0_fixes_branch We would invite everyone to provide their feedback to help us improve this upcoming release. Please let us know in particular: - Any bug-fixes already made to trunk, that you believe should still be merged to the fixes branch (fixes that are not listed on the above wiki page) - Any regressions that happened in fixes branch since the release of 2.0 - Other urgent (e.g. crashes/data-loss/...) matters, you believe we should know before the release. Please attempt to provide your feedback by: 30th June 2020 More info on our release process can be found at (work in progress): http://wiki.lazarus.freepascal.org/Lazarus_release_engineering Information about the previous release: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_3.0.4 http://wiki.lazarus.freepascal.org/User_Changes_3.2.0 The intended minimum requirements for the release will be: Windows:   2k(*), XP(*), Vista, 7, 8, 8.1 and 10, 32 or 64bit. FreeBSD/Linux:   gtk 2.8 for gtk2, qt4.5 for qt, qt5.6 for qt5, 32 or 64bit. macOS:   10.5 to 10.12; Carbon (32bit), Cocoa (64bit, beta), qt and qt5   (32 or 64bit). (*) requires install from sources -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Mon Jun 22 16:15:47 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 22 Jun 2020 16:15:47 +0200 Subject: [Lazarus] We are planning the next release: Lazarus 2.0.10 In-Reply-To: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> References: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> Message-ID: On 22/06/2020 16:14, Martin Frb via lazarus wrote: > The Lazarus team has scheduled >      Lazarus 2.0.10 >      for July 2020 (estimated 4th to 11th) > > This release will be built with_*FPC 3.2.0*_. > For those who wonder why it is 2.0.10 and not 2.2. We choose to make a 2.0.10 + 3.2.0 release, as this is the faster option. This release can be scheduled for early July. A Lazarus 2.2 release would take more time to prepare. A new 2.2 fixes branch will probably need some month to stabilize, once it has been branched. That would push a release further back. A decision on 2.2 will be made in due course. More information will be posted once available. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglists at geldenhuys.co.uk Mon Jun 22 18:44:20 2020 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Mon, 22 Jun 2020 17:44:20 +0100 Subject: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to? In-Reply-To: References: Message-ID: On 21/06/2020 6:18 am, Bo Berglund via lazarus wrote: > Is it possible to switch Lazarus between using fpc 3.0.4 and 3.2.0 so > as to compare the two easily? Yes. There is no need for duplicate Lazarus installs. Simply have 2 or more FPC versions installed. I believe the build modes would help switch between the two. Alternatively, MSEide makes this extremely easy, as can be seen in the attached screenshot. You can assign shortcuts too, so you don't even have to go into the Project Options. 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: MSEide_multiple_FPC_versions.png Type: image/png Size: 16680 bytes Desc: not available URL: From aaa5500 at ya.ru Mon Jun 22 19:29:15 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Mon, 22 Jun 2020 20:29:15 +0300 Subject: [Lazarus] IDE dialog TabOrders jumps on 1st showing Message-ID: <03907d48-d431-93d3-f3ae-0db79f327baa@ya.ru> On 1st showing, dlg jumps from some top position to lefter/lower one. On next showing, it doesnot. video- http://uvviewsoft.com/c/Kazam_screencast_00001.mp4 , 3Mb Laz today's trunk. Alexey Torgashin From aaa5500 at ya.ru Mon Jun 22 19:45:12 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Mon, 22 Jun 2020 20:45:12 +0300 Subject: [Lazarus] We are planning the next release: Lazarus 2.0.10 In-Reply-To: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> References: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> Message-ID: <6a1b5762-3473-a075-e030-c351dd8c4386@ya.ru>  >Cocoa (64bit, beta), Please move Cocoa to `release` state, it's ready.. Alexey Torgashin From sysrpl at gmail.com Tue Jun 23 14:35:12 2020 From: sysrpl at gmail.com (Anthony Walter) Date: Tue, 23 Jun 2020 08:35:12 -0400 Subject: [Lazarus] We are planning the next release: Lazarus 2.0.10 In-Reply-To: <6a1b5762-3473-a075-e030-c351dd8c4386@ya.ru> References: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> <6a1b5762-3473-a075-e030-c351dd8c4386@ya.ru> Message-ID: Alexey, So Cocoa actually is stable now? That's great news! I'll be sure to test it out. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Tue Jun 23 14:37:25 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 23 Jun 2020 14:37:25 +0200 (CEST) Subject: [Lazarus] We are planning the next release: Lazarus 2.0.10 In-Reply-To: References: <171281f9-2889-28ff-fb04-2f1693a3488a@mfriebe.de> <6a1b5762-3473-a075-e030-c351dd8c4386@ya.ru> Message-ID: On Tue, 23 Jun 2020, Anthony Walter via lazarus wrote: > Alexey, > > So Cocoa actually is stable now? That's great news! I'll be sure to test it > out. I've been using it for some time now: I run the 64-bit lazarus 2.0.8 on Mac OS Catalina, and that is cocoa only AFAIK. Michael. From bo.berglund at gmail.com Tue Jun 23 21:10:44 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 23 Jun 2020 21:10:44 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... Message-ID: I am porting a Delphi application, which uses Indy10, to fpc/lazarus and I have run into a problem regarding an include directive in one source file: interface {$I IdCompilerDefines.inc} This is a file within the Indy package, on Delphi it is found in the Indy sources in the directory where the Indy10 package is installed: Indy10\System\IdCompilerDefines.inc And Delphi has no problem finding it. In Lazarus otoh I get the error message: class_SSRemoteServer.pas(84,2) Fatal: Cannot open include file "IdCompilerDefines.inc" I have added indylaz as a "Required Package" for the project but it does not solve this problem even though it solved a few other Indy related errors. What are you supposed to do in order to make Lazarus find this file? And if you wonder, I do not know why the include directive is present in the source (they are more than a decade old)... It works fine in Delphi 2007, but gives an error in Lazarus 2.0.8 on Windows. My final target is Linux but first I want to get it running on Windows. Googling brought up this: https://www.freepascal.org/docs-html/current/user/usersu8.html where it is stated that: [quote] If you include a file in your source with the {$I filename} directive, the compiler will look for it in the following places: 1. It will look in the path specified in the include file name. 2. It will look in the directory where the current source file is. 3. it will look in all directories specified in the include file search path.[/quote] But afaik you do not enter full paths into FPC/Lazarus sources, a registered package should handle this... And I don't even know where Lazarus has stored the package sources during installation of indylaz so I cannot enter that into the project properties either. -- Bo Berglund Developer in Sweden From juha.manninen62 at gmail.com Tue Jun 23 21:40:19 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 23 Jun 2020 22:40:19 +0300 Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: References: Message-ID: On Tue, Jun 23, 2020 at 10:10 PM Bo Berglund via lazarus wrote: > I have added indylaz as a "Required Package" for the project but it > does not solve this problem even though it solved a few other Indy > related errors. Is the path containing the include file (Indy10\System or similar) in Indy package's include search path? If not then please add it. Otherwise it sounds like a bug. Unit files are found from required packages but apparently include files are not. Please report a bug with steps to reproduce. > What are you supposed to do in order to make Lazarus find this file? As a dirty workaround you can add the path containing the include file into your project's include search path. > And I don't even know where Lazarus has stored the package sources > during installation of indylaz so I cannot enter that into the project > properties either. You will figure it out. Open the Indy's package editor for example. Regards, Juha From bo.berglund at gmail.com Tue Jun 23 22:40:24 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 23 Jun 2020 22:40:24 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: Message-ID: On Tue, 23 Jun 2020 22:40:19 +0300, Juha Manninen via lazarus wrote: >On Tue, Jun 23, 2020 at 10:10 PM Bo Berglund via lazarus > wrote: >> I have added indylaz as a "Required Package" for the project but it >> does not solve this problem even though it solved a few other Indy >> related errors. > >Is the path containing the include file (Indy10\System or similar) in >Indy package's include search path? >If not then please add it. How can I see what paths are part of the indylaz package? I just installed it using OnLine Package Manager so I have no idea where it is located. >Otherwise it sounds like a bug. Unit files are found from required >packages but apparently include files are not. Please report a bug >with steps to reproduce. > > >> What are you supposed to do in order to make Lazarus find this file? > >As a dirty workaround you can add the path containing the include file >into your project's include search path. Does not seem like the right way to do it, for one it will not be portable to another Linux installation (the one I will move to on Linux for instance)... > >> And I don't even know where Lazarus has stored the package sources >> during installation of indylaz so I cannot enter that into the project >> properties either. > >You will figure it out. Open the Indy's package editor for example. OK, I do know how to search for and find it but as I said it will not be portable that way. I believe Lazarus should resolve this from the package data... For Lazarus 2.0.8 on my Windows 10 installation: C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\Indy10\System For Lazarus 2.0.8 on my RPi4 installation: ~/.lazarus_2.0.8/onlinepackagemanager/packages/Indy10/System and (Lazarus using fpc 3.2.0): ~/.lazarus_2.0.8_3.2/onlinepackagemanager/packages/Indy10/System -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Tue Jun 23 23:55:49 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Tue, 23 Jun 2020 23:55:49 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: References: Message-ID: <20200623235549.733d7f7d@limapholos.matflo.wg> On Tue, 23 Jun 2020 22:40:24 +0200 Bo Berglund via lazarus wrote: > On Tue, 23 Jun 2020 22:40:19 +0300, Juha Manninen via lazarus > wrote: > > >On Tue, Jun 23, 2020 at 10:10 PM Bo Berglund via lazarus > > wrote: > >> I have added indylaz as a "Required Package" for the project but it > >> does not solve this problem even though it solved a few other Indy > >> related errors. > > > >Is the path containing the include file (Indy10\System or similar) in > >Indy package's include search path? > >If not then please add it. > > How can I see what paths are part of the indylaz package? > I just installed it using OnLine Package Manager so I have no idea > where it is located. Package / Open Loaded Package Choose the Indy package. Then a package editor is opened. Click "Options" to show the package options Compiler Options / Path / Include files Mattias From bo.berglund at gmail.com Wed Jun 24 10:11:47 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 24 Jun 2020 10:11:47 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: <20200623235549.733d7f7d@limapholos.matflo.wg> Message-ID: On Tue, 23 Jun 2020 23:55:49 +0200, Mattias Gaertner via lazarus wrote: >On Tue, 23 Jun 2020 22:40:24 +0200 >Bo Berglund via lazarus wrote: > >> On Tue, 23 Jun 2020 22:40:19 +0300, Juha Manninen via lazarus >> wrote: >> >> >On Tue, Jun 23, 2020 at 10:10 PM Bo Berglund via lazarus >> > wrote: >> >> I have added indylaz as a "Required Package" for the project but it >> >> does not solve this problem even though it solved a few other Indy >> >> related errors. >> > >> >Is the path containing the include file (Indy10\System or similar) in >> >Indy package's include search path? >> >If not then please add it. >> >> How can I see what paths are part of the indylaz package? >> I just installed it using OnLine Package Manager so I have no idea >> where it is located. > >Package / Open Loaded Package >Choose the Indy package. > >Then a package editor is opened. > >Click "Options" to show the package options > >Compiler Options / Path / Include files Will that then have to be modified if I move the project to a Linux box but with the same fpc/lazarus versions? It seems like the system should keep track of which package is in use, maybe by utilizing an environment variable like $INDY10 or $INDYLAZ. Then one could enter a path in the project options/compiler/paths using that env var? Concerning the command in question I really do not understand why it is there in the first place, so I commented it out and then the "Run/Quick Compile" continued and stopped at another point further on... I checked back as far as I could get and found it still in sources from 2013. But we have switched from CVS to Subversion in the meantime and I cannot get any history further back. The file I found from 2013 was at CVS rev 1.78 so there had been a lot of work done on that file. Would have been intersting to find out when and why it was added... -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Wed Jun 24 10:24:04 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Wed, 24 Jun 2020 10:24:04 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: References: <20200623235549.733d7f7d@limapholos.matflo.wg> Message-ID: <20200624102404.19748b1a@limapholos.matflo.wg> On Wed, 24 Jun 2020 10:11:47 +0200 Bo Berglund via lazarus wrote: >[...] > >> How can I see what paths are part of the indylaz package? Open its package editor. Click Options Click Show Options Are you sure indylaz from online package manager is broken? >[...] > Will that then have to be modified if I move the project to a Linux > box but with the same fpc/lazarus versions? If the package is really broken, that you have to fix it, then you have to apply the fix on another machine as well. Or copy the fixed package to the new machine. > It seems like the system should keep track of which package is in use, > maybe by utilizing an environment variable like $INDY10 or $INDYLAZ. > Then one could enter a path in the project options/compiler/paths > using that env var? I'm not sure what you are trying to achieve. It is enough to open the indylaz lpk once. The IDE then remembers the location. Or execute once at command line: /path/of/your/lazbuild --add-package-link=/path/to/indylaz.lpk Mattias From bo.berglund at gmail.com Wed Jun 24 10:27:58 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 24 Jun 2020 10:27:58 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: <20200623235549.733d7f7d@limapholos.matflo.wg> Message-ID: On Wed, 24 Jun 2020 10:11:47 +0200, Bo Berglund via lazarus wrote: >Concerning the command in question I really do not understand why it >is there in the first place, so I commented it out and then the >"Run/Quick Compile" continued and stopped at another point further >on... > >I checked back as far as I could get and found it still in sources >from 2013. But we have switched from CVS to Subversion in the meantime >and I cannot get any history further back. The file I found from 2013 >was at CVS rev 1.78 so there had been a lot of work done on that file. > >Would have been intersting to find out when and why it was added... > ****UPDATE**** I found a WinCVS changelog file among the old sources where I can trace back to earlier times... Turns out that this include file is there in order to handle the use of Indy10 when Indy9 was still what Delphi7 used... 2007-03-30 Bosse * Classes/class_SSRemoteServer.pas 1.47: * Server/FormSSRemoteConfig.pas 1.8: Added conditionals for Indy10 support while leaving Indy9 original in place. It was included in these two source files and the FormSSRemoteConfig.pas is excluded from the porting to linux anyway... I will just remove it and move on. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed Jun 24 10:32:44 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 24 Jun 2020 10:32:44 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: <20200623235549.733d7f7d@limapholos.matflo.wg> <20200624102404.19748b1a@limapholos.matflo.wg> Message-ID: On Wed, 24 Jun 2020 10:24:04 +0200, Mattias Gaertner via lazarus wrote: >On Wed, 24 Jun 2020 10:11:47 +0200 >Bo Berglund via lazarus wrote: > >>[...] >> >> How can I see what paths are part of the indylaz package? > >Open its package editor. >Click Options >Click Show Options > >Are you sure indylaz from online package manager is broken? I did not claim that... >>[...] >> Will that then have to be modified if I move the project to a Linux >> box but with the same fpc/lazarus versions? > >If the package is really broken, that you have to fix it, then you have >to apply the fix on another machine as well. Or copy the fixed package >to the new machine. I just wanted to know how one could include a package file in a platform independent way. But it is no longer needed. > >> It seems like the system should keep track of which package is in use, >> maybe by utilizing an environment variable like $INDY10 or $INDYLAZ. >> Then one could enter a path in the project options/compiler/paths >> using that env var? > >I'm not sure what you are trying to achieve. >It is enough to open the indylaz lpk once. The IDE then remembers the >location. >Or execute once at command line: >/path/of/your/lazbuild --add-package-link=/path/to/indylaz.lpk > No, as I described in a follow-up the include is no longer needed. But what I was curious about is how one can include files from a package, I never said that indylaz was broken, but my understanding of Lazarus is incomplete... But since it is no longer needed I think we can drop it altogether. Sorry for the noise. -- Bo Berglund Developer in Sweden From juha.manninen62 at gmail.com Wed Jun 24 10:44:29 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Wed, 24 Jun 2020 11:44:29 +0300 Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: References: Message-ID: On Tue, Jun 23, 2020 at 10:40 PM Juha Manninen wrote: > Is the path containing the include file (Indy10\System or similar) in > Indy package's include search path? Bo, why don't you just answer my question? Juha From bo.berglund at gmail.com Wed Jun 24 15:39:35 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 24 Jun 2020 15:39:35 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: Message-ID: <6ik6ff1ppa2b1roi7sj6p5htmb3q2p9ohb@4ax.com> On Tue, 23 Jun 2020 22:40:19 +0300, Juha Manninen via lazarus wrote: >Is the path containing the include file (Indy10\System or similar) in >Indy package's include search path? >If not then please add it. >Otherwise it sounds like a bug. Unit files are found from required >packages but apparently include files are not. Please report a bug >with steps to reproduce. > To answer your question: So I re-enabled the include and added a path below packages to it as follows: interface {$I Indy10\System\IdCompilerDefines.inc} {$I ssremote.inc} uses .... class_SSRemoteServer.pas(84,2) Fatal: Cannot open include file "Indy10\System\IdCompilerDefines.inc" Same with \ as with / as delimiter. Butit worked when I did this, , but triggered other errors from inside the inc file: {$I C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\Indy10\System\IdCompilerDefines.inc} Now working but the source file is cluttered with an installation path that should not be there. So I then went into project options/compiler options/paths and I added this to the include path setting: C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\ Then I changed the source file include statement to: {$I Indy10\System\IdCompilerDefines.inc} This too worked, the file was found and parsed. So this is the best solution, one has to remember to change it when the project moves to a different lazarus version or platform. It would have been good to be able to set something like $PACKAGEDIR to C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\ in a Lazarus global context so all package files could be reached using the env var. It then has to be set Lazarus globally like is possible in Delphi. But I found no such way... HTH -- Bo Berglund Developer in Sweden From jmlandmesser at gmx.de Wed Jun 24 16:33:44 2020 From: jmlandmesser at gmx.de (John Landmesser) Date: Wed, 24 Jun 2020 16:33:44 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: <6ik6ff1ppa2b1roi7sj6p5htmb3q2p9ohb@4ax.com> References: <6ik6ff1ppa2b1roi7sj6p5htmb3q2p9ohb@4ax.com> Message-ID: <3d76fe7d-e80a-142d-c307-2097aac152e2@gmx.de> Am 24.06.20 um 15:39 schrieb Bo Berglund via lazarus: > On Tue, 23 Jun 2020 22:40:19 +0300, Juha Manninen via lazarus > wrote: > >> Is the path containing the include file (Indy10\System or similar) in >> Indy package's include search path? >> If not then please add it. >> Otherwise it sounds like a bug. Unit files are found from required >> packages but apparently include files are not. Please report a bug >> with steps to reproduce. >> > To answer your question: > > So I re-enabled the include and added a path below packages to it as > follows: > > interface > {$I Indy10\System\IdCompilerDefines.inc} > {$I ssremote.inc} > > > uses > .... > > class_SSRemoteServer.pas(84,2) Fatal: Cannot open include file > "Indy10\System\IdCompilerDefines.inc" > > Same with \ as with / as delimiter. > > Butit worked when I did this, , but triggered other errors from inside > the inc file: > > {$I > C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\Indy10\System\IdCompilerDefines.inc} > > Now working but the source file is cluttered with an installation path > that should not be there. > > So I then went into project options/compiler options/paths > and I added this to the include path setting: > > C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\ > > Then I changed the source file include statement to: > {$I Indy10\System\IdCompilerDefines.inc} > > This too worked, the file was found and parsed. > > So this is the best solution, one has to remember to change it when > the project moves to a different lazarus version or platform. > > It would have been good to be able to set something like $PACKAGEDIR > to C:\Programs\Lazarus_2.0.8\config\onlinepackagemanager\packages\ in > a Lazarus global context so all package files could be reached using > the env var. It then has to be set Lazarus globally like is possible > in Delphi. > But I found no such way... > > HTH > > Hi Bo, Never used Indy 10 but just installed it with Online Package Manager on Lazarus 2.1.0 r63354 FPC 3.0.4 x86_64-linux-gtk2 .. no probs with paths! regards John From bo.berglund at gmail.com Thu Jun 25 20:51:22 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 25 Jun 2020 20:51:22 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: Message-ID: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> On Wed, 24 Jun 2020 11:44:29 +0300, Juha Manninen via lazarus wrote: >On Tue, Jun 23, 2020 at 10:40 PM Juha Manninen > wrote: >> Is the path containing the include file (Indy10\System or similar) in >> Indy package's include search path? >> >> I did not understand the question. >> Where do I find the "Indy packages include search path"? > >Mattias already explained it. Please read your replies. > Open its package editor. > Click Options > Click Show Options > >I installed Indy10 and checked. "Include files (-Fi)" says : > .;Core;Protocols;System >So the System directory is there. Not in my case, OPM did not place it there. The box is empty. >Then I added to my project source : > {$I IdCompilerDefines.inc} >and indeed it is not found. I added IdCompilerDefines.inc into the >Indy10 files collection but it still is not found. >This is a bug. Unit files from -Fu path are found but include files >from -Fi path are not. OK, so I did the following: 1) Opened the indylaz package and added an include path looking the same as the previous two: .;Core;Protocols;System Notice. Before I did this the inclute path box was empty. 2) Removed the path to the OPM installation from my project options 3) Uncommented the include statement in my source file 4) Tried a test compile But it stopped at the exact same place again with the error message: class_SSRemoteServer.pas(84,2) Fatal: Cannot open include file "IdCompilerDefines.inc" So adding a path to the include path box for the package does not work either. >Please report in bug tracker so it is not forgotten. How is that done? I have never evr done such a report. Do I have to have an account somewhere to do it? -- Bo Berglund Developer in Sweden From pascal at riekenberg.eu Fri Jun 26 08:04:07 2020 From: pascal at riekenberg.eu (Pascal Riekenberg) Date: Fri, 26 Jun 2020 08:04:07 +0200 (CEST) Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> References: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> Message-ID: <211067867.15605.1593151447333@ox.hosteurope.de> > >Please report in bug tracker so it is not forgotten. > > How is that done? I have never evr done such a report. Do I have to > have an account somewhere to do it? Yes. Please see https://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report Pascal From juha.manninen62 at gmail.com Fri Jun 26 09:43:07 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Fri, 26 Jun 2020 10:43:07 +0300 Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> References: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> Message-ID: On Thu, Jun 25, 2020 at 9:51 PM Bo Berglund via lazarus wrote: > On Wed, 24 Jun 2020 11:44:29 +0300, Juha Manninen via lazarus > wrote: > >I installed Indy10 and checked. "Include files (-Fi)" says : > > .;Core;Protocols;System > >So the System directory is there. > > Not in my case, OPM did not place it there. The box is empty. OPM does not alter the packages. It only lets you download and install them. I wonder what could cause the difference. I got package indylaz 10.6.2 from OPM. > But it stopped at the exact same place again with the error message: > class_SSRemoteServer.pas(84,2) Fatal: Cannot open include file > "IdCompilerDefines.inc" > > So adding a path to the include path box for the package does not work > either. Yes, that was my experience, too, as I explained. Juha From aaa5500 at ya.ru Fri Jun 26 17:17:39 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Fri, 26 Jun 2020 18:17:39 +0300 Subject: [Lazarus] FPC and Lazarus packages for Haiku on Hakilo.ru Message-ID: Some invisible man runs this project. Thanks! Pls update FPC and Laz packages - they are year old! FPC 3.3 package - a) "fpc" command isn't in PATH (some deep dir) b) no fpc.cfg file near fpc binary- Laz cannot work Alexey Torgashin From bo.berglund at gmail.com Fri Jun 26 18:14:41 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 26 Jun 2020 18:14:41 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> <211067867.15605.1593151447333@ox.hosteurope.de> Message-ID: On Fri, 26 Jun 2020 08:04:07 +0200 (CEST), Pascal Riekenberg via lazarus wrote: >> >Please report in bug tracker so it is not forgotten. >> >> How is that done? I have never evr done such a report. Do I have to >> have an account somewhere to do it? > >Yes. Please see https://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report > >Pascal For some reason I am disallowed from creating a new account (email already used) and the "forgot password" path is blocked because I have to supply a "user name" along with the email, which I also do not know/remember. Apparently I have an active account tied to my email and since I have forgotten the details (username and password) I cannot reset it either. Seems like a catch-22 situation. So I am presently unable to log in and enter the bug report. -- Bo Berglund Developer in Sweden From pascal at riekenberg.eu Fri Jun 26 19:12:18 2020 From: pascal at riekenberg.eu (Pascal Riekenberg) Date: Fri, 26 Jun 2020 19:12:18 +0200 (CEST) Subject: [Lazarus] Cannot find inc file from a registered package... In-Reply-To: References: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> <211067867.15605.1593151447333@ox.hosteurope.de> Message-ID: <669907861.13137.1593191539131@ox.hosteurope.de> > For some reason I am disallowed from creating a new account (email > already used) and the "forgot password" path is blocked because I have > to supply a "user name" along with the email, which I also do not > know/remember. > > Apparently I have an active account tied to my email and since I have > forgotten the details (username and password) I cannot reset it > either. > Seems like a catch-22 situation. > > So I am presently unable to log in and enter the bug report. BosseB From bo.berglund at gmail.com Fri Jun 26 19:32:44 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 26 Jun 2020 19:32:44 +0200 Subject: [Lazarus] Cannot find inc file from a registered package... References: <4vr9ffdnj7nlsgf67jl5p5loturru9pof0@4ax.com> Message-ID: On Thu, 25 Jun 2020 20:51:22 +0200, Bo Berglund via lazarus wrote: >>Please report in bug tracker so it is not forgotten. done, report 0037271 -- Bo Berglund Developer in Sweden From jmlandmesser at gmx.de Sun Jun 28 16:59:42 2020 From: jmlandmesser at gmx.de (John Landmesser) Date: Sun, 28 Jun 2020 16:59:42 +0200 Subject: [Lazarus] error building IDE Message-ID: Hi, I have several different  Linux+Lazarus on my HD and i'm wondering about: Info Manjaro XFCE Linux 64bit, fpc trunk: Lazarus 2.1.0 r63454 FPC 3.3.1 x86_64-linux-gtk2 what about this: compiling svn lazarus from within the IDE with success  i see this message: > Lazarus-Quelltext aufräumen: Erfolg > ... > IDE erstellen: Erfolg, *Fehler: 2* > Error: Makefile:2956: warning: overriding recipe for target '.' > Error: Makefile:2954: warning: ignoring old recipe for target '.' Compiling from Terminal with: > make clean lazbuild useride starter compiling stops with error: > Error: (lazarus) IDE erstellen: stopped with exit code 2 > Error: (lazarus) Building IDE: Building IDE failed. > make: *** [Makefile:3618: useride] Fehler 2 My PC is Manjaro Linux XFCE 64bit > System:    Host: manjaro Kernel: 5.7.0-3-MANJARO x86_64 bits: 64 > Desktop: Xfce 4.14.2 Distro: Manjaro Linux > Machine:   Type: Desktop System: LENOVO product: 90FB006AGE v: > ideacentre 710-25ISH serial: >            Mobo: LENOVO model: 3642 v: SDK0J40700 WIN 3258069255609 > serial: UEFI: LENOVO v: FWKT95A >            date: 09/04/2018 > CPU:       Topology: Quad Core model: Intel Core i5-6400 bits: 64 > type: MCP L2 cache: 6144 KiB >            Speed: 3301 MHz min/max: 800/3300 MHz Core speeds (MHz): 1: > 3267 2: 3201 3: 3261 4: 3299 > Graphics:  Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia > v: 440.82 >            Display: x11 server: X.Org 1.20.8 driver: nvidia > resolution: 1920x1080~60Hz >            OpenGL: renderer: GeForce GTX 1050 Ti/PCIe/SSE2 v: 4.6.0 > NVIDIA 440.82 > Audio:     Device-1: Intel 100 Series/C230 Series Family HD Audio > driver: snd_hda_intel >            Device-2: NVIDIA GP107GL High Definition Audio driver: > snd_hda_intel >            Sound Server: ALSA v: k5.7.0-3-MANJARO > Network:   Device-1: Intel Ethernet I219-LM driver: e1000e >            IF: eno1 state: up speed: 1000 Mbps duplex: full mac: > 4c:cc:6a:a3:3b:dd >            Device-2: Intel Wireless 8260 driver: iwlwifi >            IF: wlp2s0 state: down mac: b2:78:1f:e2:91:8f >            IF-ID-1: pan1 state: down mac: d2:55:35:67:d5:f0 > Drives:    Local Storage: total: 3.18 TiB used: 522.28 GiB (16.0%) >            ID-1: /dev/sda vendor: Samsung model: SSD 850 EVO 500GB > size: 465.76 GiB >            ID-2: /dev/sdb vendor: Seagate model: ST2000DM001-1ER164 > size: 1.82 TiB >            ID-3: /dev/sdc type: USB vendor: Western Digital model: > WD10EARX-00N0YB0 size: 931.51 GiB > Partition: ID-1: / size: 57.90 GiB used: 37.56 GiB (64.9%) fs: ext4 > dev: /dev/sda8 >            ID-2: swap-1 size: 16.67 GiB used: 0 KiB (0.0%) fs: swap > dev: /dev/sda9 > Sensors:   System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nvidia > temp: 32 C >            Fan Speeds (RPM): N/A gpu: nvidia fan: 29% > Info:      Processes: 224 Uptime: 3h 12m Memory: 15.59 GiB used: 1.31 > GiB (8.4%) Shell: bash inxi: 3.0.37 No such issue with Linux Mint Cinnamon 64bit: > Lazarus 2.1.0 r63457 FPC 3.0.4 x86_64-linux-gtk2 But same error for KDE-Neon 64bit: > Lazarus 2.1.0 r63457 FPC 3.0.4 x86_64-linux-gtk2 *So fpc trunk or fpc 3.0.4 can't be the culpit??* Hints are welcome :-) John Landmesser -------------- next part -------------- An HTML attachment was scrubbed... URL: From nc-gaertnma at netcologne.de Sun Jun 28 17:08:29 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 28 Jun 2020 17:08:29 +0200 Subject: [Lazarus] error building IDE In-Reply-To: References: Message-ID: <20200628170829.6628a130@limapholos.matflo.wg> On Sun, 28 Jun 2020 16:59:42 +0200 John Landmesser via lazarus wrote: > Hi, > > I have several different  Linux+Lazarus on my HD and i'm wondering > about: > > Info Manjaro XFCE Linux 64bit, fpc trunk: > > Lazarus 2.1.0 r63454 FPC 3.3.1 x86_64-linux-gtk2 > > what about this: > > compiling svn lazarus from within the IDE with success  i see this > message: > > > Lazarus-Quelltext aufräumen: Erfolg > > ... > > IDE erstellen: Erfolg, *Fehler: 2* > > Error: Makefile:2956: warning: overriding recipe for target '.' > > Error: Makefile:2954: warning: ignoring old recipe for target '.' Any idea which Makefile this is coming from? Mattias From jmlandmesser at gmx.de Sun Jun 28 18:14:14 2020 From: jmlandmesser at gmx.de (John Landmesser) Date: Sun, 28 Jun 2020 18:14:14 +0200 Subject: [Lazarus] error building IDE In-Reply-To: <20200628170829.6628a130@limapholos.matflo.wg> References: <20200628170829.6628a130@limapholos.matflo.wg> Message-ID: <58f6980b-61b0-4984-70e5-fadc0f54e252@gmx.de> Am 28.06.20 um 17:08 schrieb Mattias Gaertner via lazarus: > On Sun, 28 Jun 2020 16:59:42 +0200 > John Landmesser via lazarus wrote: > >> Hi, >> >> I have several different  Linux+Lazarus on my HD and i'm wondering >> about: >> >> Info Manjaro XFCE Linux 64bit, fpc trunk: >> >> Lazarus 2.1.0 r63454 FPC 3.3.1 x86_64-linux-gtk2 >> >> what about this: >> >> compiling svn lazarus from within the IDE with success  i see this >> message: >> >>> Lazarus-Quelltext aufräumen: Erfolg >>> ... >>> IDE erstellen: Erfolg, *Fehler: 2* >>> Error: Makefile:2956: warning: overriding recipe for target '.' >>> Error: Makefile:2954: warning: ignoring old recipe for target '.' > Any idea which Makefile this is coming from? > > Mattias There is a lazarus/ide/Makefile?!! Just learned: In VirtualBox with Manjaro fpc trunk AND 3.0.4 everything is fine ... so no need to search at Lazarus code! Must be a peronal issue here! Thanks for your answer! John From nc-gaertnma at netcologne.de Sun Jun 28 18:38:15 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 28 Jun 2020 18:38:15 +0200 Subject: [Lazarus] error building IDE In-Reply-To: <58f6980b-61b0-4984-70e5-fadc0f54e252@gmx.de> References: <20200628170829.6628a130@limapholos.matflo.wg> <58f6980b-61b0-4984-70e5-fadc0f54e252@gmx.de> Message-ID: <20200628183815.57e517b5@limapholos.matflo.wg> On Sun, 28 Jun 2020 18:14:14 +0200 John Landmesser via lazarus wrote: > Am 28.06.20 um 17:08 schrieb Mattias Gaertner via lazarus: > > On Sun, 28 Jun 2020 16:59:42 +0200 > > John Landmesser via lazarus wrote: > > > >> Hi, > >> > >> I have several different  Linux+Lazarus on my HD and i'm wondering > >> about: > >> > >> Info Manjaro XFCE Linux 64bit, fpc trunk: > >> > >> Lazarus 2.1.0 r63454 FPC 3.3.1 x86_64-linux-gtk2 > >> > >> what about this: > >> > >> compiling svn lazarus from within the IDE with success  i see this > >> message: > >> > >>> Lazarus-Quelltext aufräumen: Erfolg > >>> ... > >>> IDE erstellen: Erfolg, *Fehler: 2* > >>> Error: Makefile:2956: warning: overriding recipe for target '.' > >>> Error: Makefile:2954: warning: ignoring old recipe for target > >>> '.' > > Any idea which Makefile this is coming from? > > > > Mattias > > There is a lazarus/ide/Makefile?!! Yes. But this is not called directly. It is called by lazarus/Makefile. And neither define a target near 2956 in svn revision 63461. > Just learned: In VirtualBox with Manjaro fpc trunk AND 3.0.4 > everything is fine ... so no need to search at Lazarus code! ok Mattias From jmlandmesser at gmx.de Sun Jun 28 20:34:58 2020 From: jmlandmesser at gmx.de (John Landmesser) Date: Sun, 28 Jun 2020 20:34:58 +0200 Subject: [Lazarus] error building IDE In-Reply-To: <20200628183815.57e517b5@limapholos.matflo.wg> References: <20200628170829.6628a130@limapholos.matflo.wg> <58f6980b-61b0-4984-70e5-fadc0f54e252@gmx.de> <20200628183815.57e517b5@limapholos.matflo.wg> Message-ID: <06be03b0-0f9c-806a-38e3-ab500764acbf@gmx.de> Am 28.06.20 um 18:38 schrieb Mattias Gaertner via lazarus: > > >> Just learned: In VirtualBox with Manjaro fpc trunk AND 3.0.4 >> everything is fine ... so no need to search at Lazarus code! > ok > > Mattias Adjusted my command -line ... issue is gone :-) # OLD:  make clean lazbuild useride starter # NEW: make all clean  useride From special at joepgen.com Tue Jun 30 00:25:34 2020 From: special at joepgen.com (Special) Date: Tue, 30 Jun 2020 00:25:34 +0200 Subject: [Lazarus] SQLdb: Pseudo Transaction? Message-ID: Hi, I am  using Lazarus 2.0.8, package SQLdb, under Win 10  (64). The following procedure raises an exception with message "TSQLite3Connection: Safety level may not be changed inside a transaction". This is strange, since I think there is no active transition in the moment when the exeption is raised. Why this exception? How to fix? Is it maybe a bug in Lazarus 2.0.8 or in SQLdb? Code: procedure TForm1.TestButtonClick(Sender: TObject); var XConnection:   TSQLite3Connection;     XTransaction:  TSQLTransaction;     XDatasource:   TDataSource;     XQuery:        TSQLQuery; begin   XConnection:= TSQLite3Connection.Create(Form1);   XTransaction:= TSQLTransaction.Create(Form1);   XDatasource:= TDataSource.Create(Form1);   XQuery:= TSQLQuery.Create(Form1);   XQuery.DataBase:= XConnection;   XQuery.Transaction:= XTransaction;   XDatasource.DataSet:= XQuery;   XTransaction.DataBase:= XConnection;   XConnection.Transaction:= XTransaction;   XConnection.DatabaseName:= ExtractFilePath (Application.ExeName) + 'D.sqlite';   XQuery.SQL.Text:= 'PRAGMA synchronous=OFF';   try     XQuery.ExecSQL;     XTransaction.Commit;   except     on e: Exception do     ShowMessage ('Exception "' + e.Message + '"')   end;   XQuery.Free;   XDatasource.Free;   XTransaction.Free;   XConnection.Free; end; Regards --  Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglists at collins-email.co.uk Tue Jun 30 01:10:31 2020 From: mailinglists at collins-email.co.uk (mailinglists at collins-email.co.uk) Date: Tue, 30 Jun 2020 00:10:31 +0100 (BST) Subject: [Lazarus] Treeview Question Message-ID: <503709324.979404.1593472231511@email.ionos.co.uk> An HTML attachment was scrubbed... URL: From ryansmithhe at gmail.com Tue Jun 30 01:55:37 2020 From: ryansmithhe at gmail.com (R.Smith) Date: Tue, 30 Jun 2020 01:55:37 +0200 Subject: [Lazarus] SQLdb: Pseudo Transaction? In-Reply-To: References: Message-ID: <84568f10-ff8c-8e8e-9676-28e488bf6f4d@gmail.com> Hi Joe, I'm hardly a FPC/SQLdb expert, but I am somewhat familiar with SQL databases and SQLite in particular. Your problem is exactly what is expected. Basically you are trying to execute SQL code in SQLite that changes the underlying DB engine to change the journalling mode (or at least, a component of it, namely "synchronous") while you have already started a transaction "XConnection.Transaction:= XTransaction;". Now in SQLite, since it is a file-based DB engine, it needs to be able to lock files (with standard OS file-locking semantics) during reading/writing as needed. It is able to provide full ACID transactions by using "Journals" of various types that funtion in various ways. The best is to use WAL journal mode, but the fastest would be DELETE mode, etc.  It aslo has the "synchronous" pragama switch that controls HOW the underlying engine confirms writes to actual hardware via the current VFS (virtual file system) in use. [Think of a VFS like a driver for EXT4, NTFS, whatever you are using.] With "PRAGMA synchronous = OFF" you are telling the the VFS to stop FSYNCing after writes on your file system. i.e. to not care whether your data has been comitted to the physical hardware, but return immediately after writing and go on with the next thing. This is a nice hack to make it very fast, but it does cause a measure of risk for a power-cut right at the point between sending the write, and accepting it is completed when it really isn't comitted to hardware, will mean data corruption (detected when you next start up). This is called "SAFETY LEVEL" and for obvious reasons, you cannot change how the safety mechanism acts while already inside a transaction which started on a certain safety level. You have to perform this swicth BEFORE starting that transaction. Just remove all the transaction bits of your code, and it should work fine. By the way, if you don't care about safety at all, also make sure the "PRAGMA journal_mode = DELETE;"[1] is called (also before any transaction), set the temp-store to memory[2] and set the cache nice and high[3]. [1] https://sqlite.org/pragma.html#pragma_journal_mode [2] https://sqlite.org/pragma.html#pragma_temp_store [3] https://sqlite.org/pragma.html#pragma_cache_size (and if you do care about data safety, don't do any of those!) (except the cache... you can still do the cache.) :) Cheers, Ryan On 2020/06/30 00:25, Special via lazarus wrote: > Hi, > > I am  using Lazarus 2.0.8, package SQLdb, under Win 10  (64). The > following procedure raises an exception with message > "TSQLite3Connection: Safety level may not be changed inside a > transaction". This is strange, since I think there is no active > transition in the moment when the exeption is raised. > > Why this exception? How to fix? Is it maybe a bug in Lazarus 2.0.8 or > in SQLdb? > > Code: > > procedure TForm1.TestButtonClick(Sender: TObject); > var XConnection:   TSQLite3Connection; >     XTransaction:  TSQLTransaction; >     XDatasource:   TDataSource; >     XQuery:        TSQLQuery; > begin >   XConnection:= TSQLite3Connection.Create(Form1); >   XTransaction:= TSQLTransaction.Create(Form1); >   XDatasource:= TDataSource.Create(Form1); >   XQuery:= TSQLQuery.Create(Form1); >   XQuery.DataBase:= XConnection; >   XQuery.Transaction:= XTransaction; >   XDatasource.DataSet:= XQuery; >   XTransaction.DataBase:= XConnection; >   XConnection.Transaction:= XTransaction; >   XConnection.DatabaseName:= ExtractFilePath (Application.ExeName) + > 'D.sqlite'; >   XQuery.SQL.Text:= 'PRAGMA synchronous=OFF'; >   try >     XQuery.ExecSQL; >     XTransaction.Commit; >   except >     on e: Exception do >     ShowMessage ('Exception "' + e.Message + '"') >   end; >   XQuery.Free; >   XDatasource.Free; >   XTransaction.Free; >   XConnection.Free; > end; > > Regards --  Joe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeljko at holobit.net Tue Jun 30 09:09:36 2020 From: zeljko at holobit.net (zeljko) Date: Tue, 30 Jun 2020 09:09:36 +0200 Subject: [Lazarus] Treeview Question In-Reply-To: <503709324.979404.1593472231511@email.ionos.co.uk> References: <503709324.979404.1593472231511@email.ionos.co.uk> Message-ID: <40c7b8bf-c990-2426-b7d2-ac9e3b37f1b6@holobit.net> On 6/30/20 1:10 AM, Martin via lazarus wrote: > Hi, > > I'm porting an application I started (but never finished) in Pyside to > Lazarus. This question is only about cosmetics as Treeview works as I > want it to. > > In Pyside I could set a space between nodes by setting the node text as > "" and disabling that node so it never gets selection, e.g. > >     self.tvSpace001 = QTreeWidgetItem(self.leftTreeWidget) >     self.tvSpace001.setText(0, "") >     self.tvSpace001.setDisabled(True) > > In Lazarus there seems to be no disabled property for nodes, so when > transversing a node with text "" with the keyboard, it will move onto > that empty node but not highlight it, when I would prefer it instead > moved onto the next or previous node and highlight it. > > I could write a workaround, storing the last node index, working out if > the user has moved up or down, checking if the text is "" and > highlighting the previous or next node as required, BUT I just wondered > if anyone has a more simple, more elegant solution please? > > It's only to show visual definition between groups of parents and childs > and doesn't actually affect how the application works. Lazarus uses it's own implementation of TTreeView, so you have to create your own LCL wrapper for QTreeWidget. zeljko From zeljko at holobit.net Tue Jun 30 09:09:36 2020 From: zeljko at holobit.net (zeljko) Date: Tue, 30 Jun 2020 09:09:36 +0200 Subject: [Lazarus] Treeview Question In-Reply-To: <503709324.979404.1593472231511@email.ionos.co.uk> References: <503709324.979404.1593472231511@email.ionos.co.uk> Message-ID: <40c7b8bf-c990-2426-b7d2-ac9e3b37f1b6@holobit.net> On 6/30/20 1:10 AM, Martin via lazarus wrote: > Hi, > > I'm porting an application I started (but never finished) in Pyside to > Lazarus. This question is only about cosmetics as Treeview works as I > want it to. > > In Pyside I could set a space between nodes by setting the node text as > "" and disabling that node so it never gets selection, e.g. > >     self.tvSpace001 = QTreeWidgetItem(self.leftTreeWidget) >     self.tvSpace001.setText(0, "") >     self.tvSpace001.setDisabled(True) > > In Lazarus there seems to be no disabled property for nodes, so when > transversing a node with text "" with the keyboard, it will move onto > that empty node but not highlight it, when I would prefer it instead > moved onto the next or previous node and highlight it. > > I could write a workaround, storing the last node index, working out if > the user has moved up or down, checking if the text is "" and > highlighting the previous or next node as required, BUT I just wondered > if anyone has a more simple, more elegant solution please? > > It's only to show visual definition between groups of parents and childs > and doesn't actually affect how the application works. Lazarus uses it's own implementation of TTreeView, so you have to create your own LCL wrapper for QTreeWidget. zeljko From juha.manninen62 at gmail.com Tue Jun 30 10:20:58 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 30 Jun 2020 11:20:58 +0300 Subject: [Lazarus] Treeview Question In-Reply-To: <503709324.979404.1593472231511@email.ionos.co.uk> References: <503709324.979404.1593472231511@email.ionos.co.uk> Message-ID: On Tue, Jun 30, 2020 at 2:10 AM Martin via lazarus wrote: > In Lazarus there seems to be no disabled property for nodes, ... It could be implemented in TreeNode. However property "Enabled" instead of "Disabled" would be more consistent with other controls. Juha From mailinglists at collins-email.co.uk Tue Jun 30 10:29:53 2020 From: mailinglists at collins-email.co.uk (Martin Collins) Date: Tue, 30 Jun 2020 09:29:53 +0100 Subject: [Lazarus] Treeview Question In-Reply-To: <40c7b8bf-c990-2426-b7d2-ac9e3b37f1b6@holobit.net> References: <503709324.979404.1593472231511@email.ionos.co.uk> <40c7b8bf-c990-2426-b7d2-ac9e3b37f1b6@holobit.net> Message-ID: <1730458c000.287b.afe91967be68f48d4fea1dbf54471968@collins-email.co.uk> Thank you. I didn't particularly want to use QT in Lazarus but Pyside is QT only. I'll get my application up and working first I think and then maybe have a look at the treeview source for cosmetic tweaks. Writing my own wrapper for a QT widget set is beyond my capabilities but thank you anyway. Best regards, Martin On 30 June 2020 08:09:39 zeljko wrote: > On 6/30/20 1:10 AM, Martin via lazarus wrote: >> Hi, >> >> I'm porting an application I started (but never finished) in Pyside to >> Lazarus. This question is only about cosmetics as Treeview works as I >> want it to. >> >> In Pyside I could set a space between nodes by setting the node text as >> "" and disabling that node so it never gets selection, e.g. >> >> self.tvSpace001 = QTreeWidgetItem(self.leftTreeWidget) >> self.tvSpace001.setText(0, "") >> self.tvSpace001.setDisabled(True) >> >> In Lazarus there seems to be no disabled property for nodes, so when >> transversing a node with text "" with the keyboard, it will move onto >> that empty node but not highlight it, when I would prefer it instead >> moved onto the next or previous node and highlight it. >> >> I could write a workaround, storing the last node index, working out if >> the user has moved up or down, checking if the text is "" and >> highlighting the previous or next node as required, BUT I just wondered >> if anyone has a more simple, more elegant solution please? >> >> It's only to show visual definition between groups of parents and childs >> and doesn't actually affect how the application works. > > Lazarus uses it's own implementation of TTreeView, so you have to create > your own LCL wrapper for QTreeWidget. > > zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From nc-gaertnma at netcologne.de Tue Jun 30 10:34:10 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Tue, 30 Jun 2020 10:34:10 +0200 Subject: [Lazarus] Treeview Question In-Reply-To: References: <503709324.979404.1593472231511@email.ionos.co.uk> Message-ID: <20200630103410.1457c118@limapholos.matflo.wg> On Tue, 30 Jun 2020 11:20:58 +0300 Juha Manninen via lazarus wrote: > On Tue, Jun 30, 2020 at 2:10 AM Martin via lazarus > wrote: > > In Lazarus there seems to be no disabled property for nodes, ... > > It could be implemented in TreeNode. > However property "Enabled" instead of "Disabled" would be more > consistent with other controls. Or you can write a descendant of TTreeView with your descendant of TTreeNode. Mattias From special at joepgen.com Tue Jun 30 12:03:46 2020 From: special at joepgen.com (Special) Date: Tue, 30 Jun 2020 12:03:46 +0200 Subject: [Lazarus] SQLdb: Pseudo Transaction? In-Reply-To: <84568f10-ff8c-8e8e-9676-28e488bf6f4d@gmail.com> References: <84568f10-ff8c-8e8e-9676-28e488bf6f4d@gmail.com> Message-ID: <8e773ab6-2ed7-04e9-307c-ecb1d82000de@joepgen.com> Am 30.06.2020 um 01:55 schrieb R.Smith via lazarus: > Just remove all the transaction bits of your code, and it should work > fine. Ryan, your answer helps a lot; thank you. Another (maybe stupid) question: What exactly is the purpose of a 'transaction'? Do I need it for each SQL statement to be executed? Thanx --  Joe From ryansmithhe at gmail.com Tue Jun 30 16:49:06 2020 From: ryansmithhe at gmail.com (R.Smith) Date: Tue, 30 Jun 2020 16:49:06 +0200 Subject: [Lazarus] SQLdb: Pseudo Transaction? In-Reply-To: <8e773ab6-2ed7-04e9-307c-ecb1d82000de@joepgen.com> References: <84568f10-ff8c-8e8e-9676-28e488bf6f4d@gmail.com> <8e773ab6-2ed7-04e9-307c-ecb1d82000de@joepgen.com> Message-ID: > > Ryan, > > your answer helps a lot; thank you. > > Another (maybe stupid) question: What exactly is the purpose of a > 'transaction'? Do I need it for each SQL statement to be executed? That's an excellent question in fact - lots of confusion out there. Two main reasons, which I will quickly show - 1 - ACID guarantees (especially Isolation and Consistency, the others [Atomicity and Durability] you get anyway), and 2 - Speed. (https://en.wikipedia.org/wiki/ACID) In most DB engines (SQLite definitely) most executed commands gets their own little wrapped transaction if you did not start one explicitly - just to make the nuts and bolts of the engine function correctly. This might be a "lesser" form of transaction, but it has to at a minimum prepare the table, lock tables/rows/whatever, do the reading/writing, and then release those locks. This also means that if you issue four commands, let's use an example (based loosely on a contacts-list table), say you execute these three in order: SELECT MAX(ID) FROM contacts; (The result of the previous statement is put into a variable, say: X) INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ....) VALUES (X+1, 'Joe', 'Soap', Now, ...); INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ....) VALUES (X+2, 'Joe', 'Jones', Now, ...); INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ....) VALUES (X+3, 'Joe', 'Smith', Now, ...); Now inside the DB Engine, it is wrapped in pseudo-code like this (Obviously there is more going on, but I'm just mentioning the interesting bits to our example): tt = Start_Transaction;     qq = prepare query( SELECT MAX(ID) FROM contacts; ) :         if (qq is READ Query)             obtain_read_lock(tt, qq); // Executed         ELSE             obtain_write_lock(tt, qq);// Skipped         run_query(qq);         output_results;         drop_locks(tt, qq);     release_prepared_resources(qq);     IF ERRORS > 0         roll_back(tt);     ELSE         commit(tt); release_transaction(tt); tt = Start_Transaction;     qq = prepare query( INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ...) VALUES (X+1, 'Joe', 'Soap', Now, ...); ) :         if (qq is READ Query)             obtain_read_lock(tt, qq);// Skipped         ELSE             obtain_write_lock(tt, qq); // Executed         run_query(qq);         output_results;         drop_locks(tt, qq);     release_prepared_resources(qq);     IF ERRORS > 0         roll_back(tt);     ELSE         commit(tt); release_transaction(tt); tt = Start_Transaction;     qq = prepare query(INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ...) VALUES (X+2, 'Joe', 'Jones', Now, ...); ) :         if (qq is READ Query)             obtain_read_lock(tt, qq); // Skipped         ELSE             obtain_write_lock(tt, qq); // Executed         run_query(qq);         output_results;         drop_locks(tt, qq);     release_prepared_resources(qq);     IF ERRORS > 0         roll_back(tt);     ELSE         commit(tt); release_transaction(tt); tt = Start_Transaction;     qq = prepare query(INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ...) VALUES (X+3, 'Joe', 'Smith', Now, ...); ) :         if (qq is READ Query)             obtain_read_lock(tt, qq);   // Skipped         ELSE             obtain_write_lock(tt, qq); // Executed         run_query(qq);         output_results;         drop_locks(tt, qq);     release_prepared_resources(qq);     IF ERRORS > 0         roll_back(tt);     ELSE         commit(tt); release_transaction(tt); The "output_results;" command might be a no-op for INSERT queries, though some DBs do return values. Now note some things: Towards Point 1 above:  If someone else also were trying to insert to this database at the same time, they might get an X that is in-between your inserts, and indeed insert values in between. This is called a concurrancy problem and is fixed by the "isolation" in an ACID transaction.   (I know that behaviour can well be fixed by declaring the ID column with AUTO_INCREMENT, but let's imagine it wasn't in this example, you may well have other columns that must be Unique). Note also that the inserted values for "Now()" would be slightly different every time since it's just a littlebit later when the next INSERT happens.  Inside a transaction, the TimeAdded values will all be the same. Basically, while the transaction is in progress, and for the duration of it, no other connection to the same database can mess with those values, plus those values will remain consistent for the duration of the transaction. This is a very important property to many people. There are a few other considerations to get technical with, like Serializability modes etc, allowing Dirty-reads, Read-uncommitted data (they don't fall in the scope of this discussion, but you can look them up if interested) - i'll only say here that not everyone wants their transactions to be closed off completely so Database Engines have switches/ways to allow breaking of the ACID model. Point 2: Also note that the speed magnificently increases when you explicitly START the transaction, because the above script and pseudo-code changes to this: BEGIN TRANSACTION; SELECT MAX(ID) FROM contacts; INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ....) VALUES (X+1, 'Joe', 'Soap', Now, ...); INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ....) VALUES (X+2, 'Joe', 'Jones', Now, ...); INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ....) VALUES (X+3, 'Joe', 'Smith', Now, ...); END TRANSACTION; tt = Start_Transaction;     obtain_read_lock(tt);     qq = prepare query( SELECT MAX(ID) FROM contacts; ) :         if (qq is WRITE Query)escalate_to_write_lock(tt, qq); // Skipped         run_query(qq);         output_results;**     release_prepared_resources(qq);     qq = prepare query( INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ...) VALUES (X+1, 'Joe', 'Soap', Now, ...); ) :         if (qq is WRITE Query) if (qq is WRITE Query)escalate_to_write_lock(tt, qq); // Executed         run_query(qq);     release_prepared_resources(qq);     qq = prepare query( INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ...) VALUES (X+2, 'Joe', 'Jones', Now, ...); ) : if (qq is WRITE Query) if (qq is WRITE Query)escalate_to_write_lock(tt, qq); // No-op because write-lock is already held.         run_query(qq);     release_prepared_resources(qq);     qq = prepare query( INSERT INTO contacts(ID, FirstName, LastName, TimeAdded, ...) VALUES (X+3, 'Joe', 'Smith', Now, ...); ) : if (qq is WRITE Query) if (qq is WRITE Query)escalate_to_write_lock(tt, qq); // No-op because write-lock is already held.         run_query(qq);     release_prepared_resources(qq);     IF ERRORS > 0        roll_back(tt);     ELSE        commit(tt);     output_results;** release_transaction(tt); ** - The exact times and places when results are output in queries differ from Engine to Engine and can be controlled with switches in some. Typically inline after selects, but sometimes you only want to see the results that actually made it into the database (i.e. at the END of the transaction). You can of course get even faster when using multi-line inserts and prepared statements - but that's also another discussion. Note also that only transactions with explicit errors will be rolled back by the Engines typically. If there is an error (a thing that you don't want to commit to the data) but it isn't a problem to commit it for the DB engine, then you have to explicitly tell it to roll back. (In sqlite this is just querying the command: ROLLBACK;) There are also conflict handlers which you can specify on how you want to proceed when a conflict (error) occurs, but again, that's another topic, this one is too long already. :) Cheers, Ryan From special at joepgen.com Tue Jun 30 22:52:34 2020 From: special at joepgen.com (Special) Date: Tue, 30 Jun 2020 22:52:34 +0200 Subject: [Lazarus] SQLdb: Pseudo Transaction? In-Reply-To: References: <84568f10-ff8c-8e8e-9676-28e488bf6f4d@gmail.com> <8e773ab6-2ed7-04e9-307c-ecb1d82000de@joepgen.com> Message-ID: <5c9f6958-1286-bf6f-0189-b8aa9c89b790@joepgen.com> Hi, Ryan, I followed your advice and removed XTransaction and all references to it from TestButtonClick. But now I get an exception with the message "Transaction not set". Any hint? Regards --  Joe From michael at freepascal.org Tue Jun 30 23:47:20 2020 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 30 Jun 2020 23:47:20 +0200 (CEST) Subject: [Lazarus] SQLdb: Pseudo Transaction? In-Reply-To: <5c9f6958-1286-bf6f-0189-b8aa9c89b790@joepgen.com> References: <84568f10-ff8c-8e8e-9676-28e488bf6f4d@gmail.com> <8e773ab6-2ed7-04e9-307c-ecb1d82000de@joepgen.com> <5c9f6958-1286-bf6f-0189-b8aa9c89b790@joepgen.com> Message-ID: On Tue, 30 Jun 2020, Special via lazarus wrote: > Hi, Ryan, > > I followed your advice and removed XTransaction and all references to it > from TestButtonClick. But now I get an exception with the message > "Transaction not set". Any hint? With SQLDB you always need a transaction component. What you can do is set stoUseImplicit in the Transaction.Options: https://www.freepascal.org/docs-html/current/fcl/sqldb/tsqltransaction.options.html In that case the implicit transaction handling of the DB engine (SQLite in this case) will be used, no explicit transaction statements will be emitted. Michael.