From michael at freepascal.org Tue Nov 1 11:45:14 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 1 Nov 2022 11:45:14 +0100 (CET) Subject: [Lazarus] GStreamer API unit added Message-ID: Hello, For all people interested in sound/video streaming: After lots of work, I added the gst unit to the FPC packages. This unit contains the import declarations for the full libgstreamer-1.0 API. I didn't translate all C macros, but if you need some which I didn't translate, let me know and I will add them. For those that are not in the know: gstreamer is a powerful audio/video stream system, used on most modern linux distributions (it may be available on mac/windows, but I didn't test those). I have also added a simple demo, that shows how to play a mp3 file. I'm not an expert in sound/video streams, so if someone can contribute a more elaborate example, it would be most welcome :) Enjoy, Michael. From octopushole at gmail.com Wed Nov 2 19:12:17 2022 From: octopushole at gmail.com (duilio foschi) Date: Wed, 2 Nov 2022 19:12:17 +0100 Subject: [Lazarus] jedi code formatter Message-ID: I could edit file jcfsettings.cfg and get most of the wanted features. There are 2 more features I'd like to get, but I cannot understand how: https://i.ibb.co/YkJ1Txm/1.jpg Any help? Btw: is there any manual available? Thank you Peppe From nc-gaertnma at netcologne.de Wed Nov 2 19:15:11 2022 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Wed, 2 Nov 2022 19:15:11 +0100 Subject: [Lazarus] Possible Codetools issue for embedded targets in main branch In-Reply-To: References: <02ae4f9b-4ec9-7a5d-71d0-8fc162c4fb88@michael-ring.org> <20221007003637.762ba71e@limapholos> <20221007091912.5d6c3dd5@limapholos> Message-ID: <20221102191511.4c3a6515@limapholos> On Fri, 07 Oct 2022 07:31:37 +0000 Alfred via lazarus wrote: > If I am free to make this request, the most easy method (for me) > would be a boolean setting in miscellaneousoptions.xml. > Something with the name "Force-rescan" that gets reset when the > rescan has been performed when Lazarus has been started and the > rescan is finished. > I know I ask a lot, but this would serve me well ... ;-) If you just need a rescan on start, you can simply delete fpcdefines.xml Mattias From octopushole at gmail.com Thu Nov 3 08:53:20 2022 From: octopushole at gmail.com (duilio foschi) Date: Thu, 3 Nov 2022 08:53:20 +0100 Subject: [Lazarus] SQLDBRestBridge Message-ID: I could get client and server talk each other. For the future, it would be nice to have the server (when in debug mode) write a log of commands and data exchanged with the client. Both inbound and outbound commands/data are needed. I have a hard time figuring out where to insert my code. Any help? Thank you Peppe From michael at freepascal.org Thu Nov 3 10:10:51 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 3 Nov 2022 10:10:51 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Thu, 3 Nov 2022, duilio foschi via lazarus wrote: > I could get client and server talk each other. > > For the future, it would be nice to have the server (when in debug > mode) write a log of commands and data exchanged with the client. This exists already. TRestDispatcherLogOption gives you this. In fact, there are 2 properties: // Logging options Property LogOptions : TRestDispatcherLogOptions Read FLogOptions write FLogOptions default DefaultDispatcherLogOptions; // SQL Log options. Only for connections managed by RestDispatcher Property LogSQLOptions : TDBEventTypes Read FDBLogOptions write FDBLogOptions default DefaultLogSQLOptions; And add a OnLog event handler. If you think some extra option is needed, let me know and I will see what I can do. Michael. From octopushole at gmail.com Thu Nov 3 23:08:28 2022 From: octopushole at gmail.com (duilio foschi) Date: Thu, 3 Nov 2022 23:08:28 +0100 Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: Hi Michael, I was able to log the info shown in this pic https://i.ibb.co/f4MJQFJ/1.jpg (I used a rough writeln for now). This is fine when you want to verify the behaviour of the application itself. 1. == Is there a way to have the server log HTTP commands received from the client? Like: http://localhost:3000/EXPENSES?fmt=buf&humanreadable=1 2. == Is there a way to have the server log the data returned to the client? This data will be very valuable when trying to debug a client developed by 3th parties that misbehave (what is my condition now). The alternative will be to use a HTTP proxy. Thank you Peppe On Thu, Nov 3, 2022 at 10:10 AM Michael Van Canneyt via lazarus wrote: > > > > On Thu, 3 Nov 2022, duilio foschi via lazarus wrote: > > > I could get client and server talk each other. > > > > For the future, it would be nice to have the server (when in debug > > mode) write a log of commands and data exchanged with the client. > > This exists already. TRestDispatcherLogOption gives you this. > > In fact, there are 2 properties: > > // Logging options > Property LogOptions : TRestDispatcherLogOptions Read FLogOptions write FLogOptions default DefaultDispatcherLogOptions; > // SQL Log options. Only for connections managed by RestDispatcher > Property LogSQLOptions : TDBEventTypes Read FDBLogOptions write FDBLogOptions default DefaultLogSQLOptions; > > And add a OnLog event handler. > > If you think some extra option is needed, let me know and I will see what I > can do. > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From michael at freepascal.org Thu Nov 3 23:17:06 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 3 Nov 2022 23:17:06 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Thu, 3 Nov 2022, duilio foschi wrote: > Hi Michael, > > I was able to log the info shown in this pic > https://i.ibb.co/f4MJQFJ/1.jpg > > (I used a rough writeln for now). > > This is fine when you want to verify the behaviour of the application itself. > > 1. > == > Is there a way to have the server log HTTP commands received from the client? > > Like: > http://localhost:3000/EXPENSES?fmt=buf&humanreadable=1 Yes. Please look at the intercept example. You can register an interceptor (a kind of middleware) and log all URLs. > 2. > == > Is there a way to have the server log the data returned to the client? > > This data will be very valuable when trying to debug a client > developed by 3th parties that misbehave (what is my condition now). > > The alternative will be to use a HTTP proxy. Same here: you can register an interceptor for this, use the iaAfter to indicate that the interceptor takes place after the request was handled. The content should still be available in the response.content or response.contentstream. Michael. From octopushole at gmail.com Thu Nov 3 23:49:26 2022 From: octopushole at gmail.com (duilio foschi) Date: Thu, 3 Nov 2022 23:49:26 +0100 Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: >Please look at the intercept example could you please expand on this? Where do I find the intercept example? Thank you Peppe On Thu, Nov 3, 2022 at 11:17 PM Michael Van Canneyt via lazarus wrote: > > > > On Thu, 3 Nov 2022, duilio foschi wrote: > > > Hi Michael, > > > > I was able to log the info shown in this pic > > https://i.ibb.co/f4MJQFJ/1.jpg > > > > (I used a rough writeln for now). > > > > This is fine when you want to verify the behaviour of the application itself. > > > > 1. > > == > > Is there a way to have the server log HTTP commands received from the client? > > > > Like: > > http://localhost:3000/EXPENSES?fmt=buf&humanreadable=1 > > Yes. > > Please look at the intercept example. You can register an interceptor (a kind > of middleware) and log all URLs. > > > > 2. > > == > > Is there a way to have the server log the data returned to the client? > > > > This data will be very valuable when trying to debug a client > > developed by 3th parties that misbehave (what is my condition now). > > > > The alternative will be to use a HTTP proxy. > > Same here: you can register an interceptor for this, use the iaAfter to > indicate that the interceptor takes place after the request was handled. > > The content should still be available in the response.content or > response.contentstream. > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From michael at freepascal.org Fri Nov 4 09:05:14 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Fri, 4 Nov 2022 09:05:14 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Thu, 3 Nov 2022, duilio foschi wrote: >> Please look at the intercept example > > could you please expand on this? In the http request router, you can register global handlers which are executed for every request. You can choose if the handler is executed before or after the normal handler for the request. > > Where do I find the intercept example? https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-web/examples/intercept/simpleserver.pas This example shows both kind of handlers, before and after request. The before request handler just logs the URL, just what you need. Michael. From octopushole at gmail.com Sun Nov 6 20:59:32 2022 From: octopushole at gmail.com (duilio foschi) Date: Sun, 6 Nov 2022 20:59:32 +0100 Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: Hi Michael, I am digging into your SQLDBRestBridge component. Very useful code. I could fix and run both the server part and the client part (I used the BufDataset client). My code (with very few changes applied to the original one) can be downloaded from this link: https://mega.nz/file/Gxx3FBya#LbvDvuFnH5rUDVAdPoGyuUCnkNE761A62SZ1MYX8oFQ I hope it be helpful for somebody. I have 2 questions: 1. the client needs to know the name of the primary key (PK) of each table. Is there a way to ask the server for the name of the PK of table A? Or to have the PK listed in the metadata? 2. the client needs to periodically refresh the visible rows in the event that another client applied changes to the DB. How is this done? I reckon that the client will remember the last command like BASEURL/resourcename?limit=10&Offset=50 and reissue it. Right? Thank you Peppe On Fri, Nov 4, 2022 at 9:05 AM Michael Van Canneyt wrote: > > > > On Thu, 3 Nov 2022, duilio foschi wrote: > > >> Please look at the intercept example > > > > could you please expand on this? > > In the http request router, you can register global handlers which are executed > for every request. You can choose if the handler is executed before or after > the normal handler for the request. > > > > > > Where do I find the intercept example? > > https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-web/examples/intercept/simpleserver.pas > > This example shows both kind of handlers, before and after request. The > before request handler just logs the URL, just what you need. > > Michael. From michael at freepascal.org Sun Nov 6 23:27:42 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 6 Nov 2022 23:27:42 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Sun, 6 Nov 2022, duilio foschi wrote: > Hi Michael, > > I am digging into your SQLDBRestBridge component. Very useful code. > > I could fix and run both the server part and the client part (I used > the BufDataset client). > > My code (with very few changes applied to the original one) can be > downloaded from this link: > https://mega.nz/file/Gxx3FBya#LbvDvuFnH5rUDVAdPoGyuUCnkNE761A62SZ1MYX8oFQ > > I hope it be helpful for somebody. > > > > I have 2 questions: > > 1. the client needs to know the name of the primary key (PK) of each > table. Is there a way to ask the server for the name of the PK of > table A? Or to have the PK listed in the metadata? Normally the server has this info, and the primary key is retrieved when exposing a database. It is part of fieldinfo, but not yet exposed in the metadata, I think. I will add it, this is easy to do. > 2. the client needs to periodically refresh the visible rows in the > event that another client applied changes to the DB. How is this done? > I reckon that the client will remember the last command > like > BASEURL/resourcename?limit=10&Offset=50 > and reissue it. Right? Yes, but you need to program this yourself. Michael. From aruna.hewapathirane at gmail.com Mon Nov 7 00:09:59 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Sun, 6 Nov 2022 18:09:59 -0500 Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: Hello Michael, I would be very interested in this. Is there a link to the source and the example code please? Thanks - Aruna On Tue, Nov 1, 2022 at 6:45 AM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > Hello, > > For all people interested in sound/video streaming: > > After lots of work, I added the gst unit to the FPC packages. > This unit contains the import declarations for the full libgstreamer-1.0 > API. > I didn't translate all C macros, but if you need some which I didn't > translate, let me know and I will add them. > > For those that are not in the know: > gstreamer is a powerful audio/video stream system, used on most modern > linux > distributions (it may be available on mac/windows, but I didn't test > those). > > I have also added a simple demo, that shows how to play a mp3 file. > > I'm not an expert in sound/video streams, so if someone can contribute a > more elaborate example, it would be most welcome :) > > Enjoy, > > 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 michael at freepascal.org Mon Nov 7 08:14:47 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 7 Nov 2022 08:14:47 +0100 (CET) Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: Hello, Yes, see here: https://gitlab.com/freepascal.org/fpc/source/-/tree/main/packages/gstreamer Michael. On Sun, 6 Nov 2022, Aruna Hewapathirane wrote: > Hello Michael, > > I would be very interested in this. Is there a link to the source and the > example code please? > > Thanks - Aruna > > On Tue, Nov 1, 2022 at 6:45 AM Michael Van Canneyt via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> >> Hello, >> >> For all people interested in sound/video streaming: >> >> After lots of work, I added the gst unit to the FPC packages. >> This unit contains the import declarations for the full libgstreamer-1.0 >> API. >> I didn't translate all C macros, but if you need some which I didn't >> translate, let me know and I will add them. >> >> For those that are not in the know: >> gstreamer is a powerful audio/video stream system, used on most modern >> linux >> distributions (it may be available on mac/windows, but I didn't test >> those). >> >> I have also added a simple demo, that shows how to play a mp3 file. >> >> I'm not an expert in sound/video streams, so if someone can contribute a >> more elaborate example, it would be most welcome :) >> >> Enjoy, >> >> Michael. >> -- >> _______________________________________________ >> lazarus mailing list >> lazarus at lists.lazarus-ide.org >> https://lists.lazarus-ide.org/listinfo/lazarus >> > From octopushole at gmail.com Mon Nov 7 23:58:34 2022 From: octopushole at gmail.com (duilio foschi) Date: Mon, 7 Nov 2022 23:58:34 +0100 Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: I fixed the code in Lazarus and got a client based on BufDataClient that successfully talks with a restbridge server. As a next step, I'd like to connect to the same server from a TWebForm of TMS Web Core library. I started with a slow step. There is only a TWebHttpRequest in the form (which has the same functions of a TFPHTTPClient) and it issues a GET to URL http://localhost:3000/metadata/?fmt=json&humanreadable=0 This command works ok in the windows client. Here, I get the errors shown in pic https://i.ibb.co/dpsjfQQ/1.jpg The message (a CORS error) is attached below. Weird enough, the message is there even after changing the server code in this way: original code: FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView,rdoHandleCORS]; new code FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView]; Is there a way to tell the server to ignore CORS errors? Or there a way to sweet-talk the server to accept the requests from a TMS Web form? :) Thank you Peppe project1.html:1 Access to XMLHttpRequest at 'http://localhost:3000/metadata/?fmt=json&humanreadable=0' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. project1.js:263 Uncaught {fMessage: 'HTTP request error @http://localhost:3000/metadata/?fmt=json&humanreadable=0'} cb @ project1.js:263 error (async) Execute$2 @ project1.js:12331 Execute @ project1.js:12316 btnClick @ project1.js:12649 cb @ project1.js:241 Click @ project1.js:6631 HandleDoClick @ project1.js:6120 cb @ project1.js:241 project1.js:12356 GET http://localhost:3000/metadata/?fmt=json&humanreadable=0 net::ERR_FAILED Execute$2 @ project1.js:12356 Execute @ project1.js:12316 btnClick @ project1.js:12649 cb @ project1.js:241 Click @ project1.js:6631 HandleDoClick @ project1.js:6120 cb @ project1.js:241 On Sun, Nov 6, 2022 at 11:27 PM Michael Van Canneyt via lazarus wrote: > > > > On Sun, 6 Nov 2022, duilio foschi wrote: > > > Hi Michael, > > > > I am digging into your SQLDBRestBridge component. Very useful code. > > > > I could fix and run both the server part and the client part (I used > > the BufDataset client). > > > > My code (with very few changes applied to the original one) can be > > downloaded from this link: > > https://mega.nz/file/Gxx3FBya#LbvDvuFnH5rUDVAdPoGyuUCnkNE761A62SZ1MYX8oFQ > > > > I hope it be helpful for somebody. > > > > > > > > I have 2 questions: > > > > 1. the client needs to know the name of the primary key (PK) of each > > table. Is there a way to ask the server for the name of the PK of > > table A? Or to have the PK listed in the metadata? > > Normally the server has this info, and the primary key is retrieved when > exposing a database. It is part of fieldinfo, but not yet exposed in the > metadata, I think. I will add it, this is easy to do. > > > 2. the client needs to periodically refresh the visible rows in the > > event that another client applied changes to the DB. How is this done? > > I reckon that the client will remember the last command > > like > > BASEURL/resourcename?limit=10&Offset=50 > > and reissue it. Right? > > Yes, but you need to program this yourself. > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From aruna.hewapathirane at gmail.com Tue Nov 8 01:25:25 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Mon, 7 Nov 2022 19:25:25 -0500 Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: Hi Michael, Many thanks for the link. I have a few more questions please? I am running FPC 3.2.0 and Lazarus 2.0.10 how do I get your gstreamer code into my installation? What is the preferred or best way to do this? It is my first time so apologies if this is a silly question. Many thanks once again for your help. Aruna On Mon, Nov 7, 2022 at 2:14 AM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > Hello, > > Yes, see here: > > https://gitlab.com/freepascal.org/fpc/source/-/tree/main/packages/gstreamer > > Michael. > > On Sun, 6 Nov 2022, Aruna Hewapathirane wrote: > > > Hello Michael, > > > > I would be very interested in this. Is there a link to the source and the > > example code please? > > > > Thanks - Aruna > > > > On Tue, Nov 1, 2022 at 6:45 AM Michael Van Canneyt via lazarus < > > lazarus at lists.lazarus-ide.org> wrote: > > > >> > >> Hello, > >> > >> For all people interested in sound/video streaming: > >> > >> After lots of work, I added the gst unit to the FPC packages. > >> This unit contains the import declarations for the full libgstreamer-1.0 > >> API. > >> I didn't translate all C macros, but if you need some which I didn't > >> translate, let me know and I will add them. > >> > >> For those that are not in the know: > >> gstreamer is a powerful audio/video stream system, used on most modern > >> linux > >> distributions (it may be available on mac/windows, but I didn't test > >> those). > >> > >> I have also added a simple demo, that shows how to play a mp3 file. > >> > >> I'm not an expert in sound/video streams, so if someone can contribute a > >> more elaborate example, it would be most welcome :) > >> > >> Enjoy, > >> > >> Michael. > >> -- > >> _______________________________________________ > >> 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 michael at freepascal.org Tue Nov 8 07:56:08 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 8 Nov 2022 07:56:08 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Mon, 7 Nov 2022, duilio foschi wrote: > I fixed the code in Lazarus and got a client based on BufDataClient > that successfully talks with a restbridge server. > > As a next step, I'd like to connect to the same server from a TWebForm > of TMS Web Core library. Normally, TMS Web Core contains a dataset component that handles SQLDBRest connections?. I wrote it myself for them. > > I started with a slow step. There is only a TWebHttpRequest in the > form (which has the same functions of a TFPHTTPClient) and it issues a > GET to URL > http://localhost:3000/metadata/?fmt=json&humanreadable=0 > > This command works ok in the windows client. > > Here, I get the errors shown in pic > https://i.ibb.co/dpsjfQQ/1.jpg > > The message (a CORS error) is attached below. Aaaahhh... Welcome to CORS hell... :/ > > Weird enough, the message is there even after changing the server code > in this way: > > original code: > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView,rdoHandleCORS]; > > new code > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView]; This is the exact opposite of what you should do. The rdoHandleCORS option must be there, or CORS will not be handled at all. > > Is there a way to tell the server to ignore CORS errors? > The CORS errors are from the browser, not from the server. > Or there a way to sweet-talk the server to accept the requests from a > TMS Web form? :) Yes, you must add localhost as an allowed origin in CORSAllowedOrigins. FDisp.CORSAllowedOrigins:='localhost:3000' If you are not using authentication, as an alternative, you can try FDisp.CORSAllowedOrigins:='*' Michael. From michael at freepascal.org Tue Nov 8 08:00:20 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 8 Nov 2022 08:00:20 +0100 (CET) Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: On Mon, 7 Nov 2022, Aruna Hewapathirane wrote: > Hi Michael, > > Many thanks for the link. I have a few more questions please? I am running > FPC 3.2.0 > and Lazarus 2.0.10 how do I get your gstreamer code into my installation? > What is the > preferred or best way to do this? It is my first time so apologies if this > is a silly question. In your case, I would recommend simply to copy the units into your project folder. Alternatively, copy them to some folder on your harddisk, and add this folder to the unit path in the "project options" dialog in Lazarus. The compiler will then find them. Michael. From aruna.hewapathirane at gmail.com Tue Nov 8 13:29:56 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Tue, 8 Nov 2022 07:29:56 -0500 Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: On Tue, Nov 8, 2022 at 2:00 AM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > > On Mon, 7 Nov 2022, Aruna Hewapathirane wrote: > > > Hi Michael, > > > > Many thanks for the link. I have a few more questions please? I am > running > > FPC 3.2.0 > > and Lazarus 2.0.10 how do I get your gstreamer code into my installation? > > What is the > > preferred or best way to do this? It is my first time so apologies if > this > > is a silly question. > > In your case, I would recommend simply to copy the units into your project > folder. > Understood and will do so. Many thanks! > > Alternatively, copy them to some folder on your harddisk, and add this > folder to the unit path in the "project options" dialog in Lazarus. > The compiler will then find them. > Again understood and will try both methods. Thank you :-) > > 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 octopushole at gmail.com Tue Nov 8 19:15:52 2022 From: octopushole at gmail.com (duilio foschi) Date: Tue, 8 Nov 2022 19:15:52 +0100 Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: I am puzzled by TMS Software. 1. there is one demo specific for SQLDBRestBridge, but the application is obviously bugged, as you see from the following screenshot https://i.ibb.co/m4wVGtM/2.jpg as a start, the code for the login and logout button is the same, what cannot be 2. the support will deny even under torture the idea that TMS code can have bugs. The fault is always yours. You did not read the manual carefully (666 pages) or did not study CORS carefully or have knowledge gaps. All true in my case... but I can see a bug when I meet one :) 3. in the end, they will suggest you buy their bridge solution, called XData, as they cannot waste their time with a bridge server they did not write (verbatim) :) Probably (I reckon) they are not very interested in the Lazarus market, as they gain most income from the Delphi market. As a matter of fact, I find their support not helpful at all. They dont help you to solve your problem: they will deny that a problem exists or will pretend that you will be able to solve your problem after a few months' study of technical documentation :) I bought TMS Web Core months ago with the idea of quickly write web applications in Lazarus, with a special aim at their TWebGridComponent, but I can say today that it was no wise purchase :) Thank you Peppe On Tue, Nov 8, 2022 at 7:56 AM Michael Van Canneyt via lazarus wrote: > > > > On Mon, 7 Nov 2022, duilio foschi wrote: > > > I fixed the code in Lazarus and got a client based on BufDataClient > > that successfully talks with a restbridge server. > > > > As a next step, I'd like to connect to the same server from a TWebForm > > of TMS Web Core library. > > Normally, TMS Web Core contains a dataset component that handles SQLDBRest > connections?. > > I wrote it myself for them. > > > > > I started with a slow step. There is only a TWebHttpRequest in the > > form (which has the same functions of a TFPHTTPClient) and it issues a > > GET to URL > > http://localhost:3000/metadata/?fmt=json&humanreadable=0 > > > > This command works ok in the windows client. > > > > Here, I get the errors shown in pic > > https://i.ibb.co/dpsjfQQ/1.jpg > > > > The message (a CORS error) is attached below. > > Aaaahhh... Welcome to CORS hell... :/ > > > > > Weird enough, the message is there even after changing the server code > > in this way: > > > > original code: > > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView,rdoHandleCORS]; > > > > new code > > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView]; > > This is the exact opposite of what you should do. > > The rdoHandleCORS option must be there, or CORS will not be handled at all. > > > > > Is there a way to tell the server to ignore CORS errors? > > > > The CORS errors are from the browser, not from the server. > > > > Or there a way to sweet-talk the server to accept the requests from a > > TMS Web form? :) > > Yes, you must add localhost as an allowed origin in CORSAllowedOrigins. > > FDisp.CORSAllowedOrigins:='localhost:3000' > > If you are not using authentication, as an alternative, you can try > FDisp.CORSAllowedOrigins:='*' > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From aruna.hewapathirane at gmail.com Wed Nov 9 03:06:36 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Tue, 8 Nov 2022 21:06:36 -0500 Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: On Tue, Nov 8, 2022 at 2:00 AM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > > On Mon, 7 Nov 2022, Aruna Hewapathirane wrote: > > > Hi Michael, > > > > Many thanks for the link. I have a few more questions please? I am > running > > FPC 3.2.0 > > and Lazarus 2.0.10 how do I get your gstreamer code into my installation? > > What is the > > preferred or best way to do this? It is my first time so apologies if > this > > is a silly question. > > In your case, I would recommend simply to copy the units into your project > folder. > > Alternatively, copy them to some folder on your harddisk, and add this > folder to the unit path in the "project options" dialog in Lazarus. > The compiler will then find them. > > Michael. > Hello Michael, I tried to get things working but had problems with the IDE I have attached as screenshot. https://pasteboard.co/xc64IUDOYVBb.png Then I tried to see if I can get it going on the command line but trouble again, screenshot attached. https://pasteboard.co/dHxckB8iMPxh.png See below for details please: -------------------------------------- aruna at debian:/media/aruna/linux-next/home/lazarus/gstreamer/example$ fpc playmp3 Free Pascal Compiler version 3.2.0+dfsg-12 [2021/01/25] for x86_64 Copyright (c) 1993-2020 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling playmp3.pp playmp3.pp(48,95) Warning: range check error while evaluating constants (-1 must be between 0 and 18446744073709551615) Linking playmp3 /usr/bin/ld.bfd: cannot find -lgstreamer-1.0 Error: Error while linking Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode ----------------------------------------------------------------------------- So I changed the -1 to a 0 in line 48,95 and tried again.... ----------------------------------------------------------------------------- aruna at debian:/media/aruna/linux-next/home/lazarus/gstreamer/example$ fpc playmp3 Free Pascal Compiler version 3.2.0+dfsg-12 [2021/01/25] for x86_64 Copyright (c) 1993-2020 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling playmp3.pp Linking playmp3 /usr/bin/ld.bfd: cannot find -lgstreamer-1.0 Error: Error while linking Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode aruna at debian:/media/aruna/linux-next/home/lazarus/gstreamer/example$ This time it tries to link but dies saying can't find : /usr/bin/ld.bfd: cannot find -lgstreamer-1.0 Now what? I will keep trying different things... Thanks, Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca at wetron.es Wed Nov 9 08:34:19 2022 From: luca at wetron.es (Luca Olivetti) Date: Wed, 9 Nov 2022 08:34:19 +0100 Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: <72d73758-b2a1-7b15-0a2f-6006e9fbdeeb@wetron.es> El 9/11/22 a les 3:06, Aruna Hewapathirane via lazarus ha escrit: > This time it tries to link but dies saying can't find : /usr/bin/ld.bfd: > cannot find -lgstreamer-1.0 In debian/ubuntu based distributions you'll have to install the libgstreamer1.0-dev package: $ apt-file search libgstreamer-1.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1404.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1602.0 libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1603.0 libgstreamer1.0-dev: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so libgstreamer1.0-dev: /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1602.0-gdb.py libgstreamer1.0-dev: /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1603.0-gdb.py 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 Nov 9 09:37:15 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 9 Nov 2022 09:37:15 +0100 (CET) Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: On Tue, 8 Nov 2022, Aruna Hewapathirane wrote: >> > Hello Michael, > > I tried to get things working but had problems with the IDE I have attached > screenshots. It seems you opened the .lpi file as a pascal file using the file - open menu ? A .lpi file must be opened with project - open menu. > Then I tried to see if I can get it going on the commandline but trouble > again, see below please. > > aruna at debian:/media/aruna/linux-next/home/lazarus/gstreamer/example$ fpc > playmp3 > Free Pascal Compiler version 3.2.0+dfsg-12 [2021/01/25] for x86_64 > Copyright (c) 1993-2020 by Florian Klaempfl and others > Target OS: Linux for x86-64 > Compiling playmp3.pp > playmp3.pp(48,95) Warning: range check error while evaluating constants (-1 > must be between 0 and 18446744073709551615) > Linking playmp3 > /usr/bin/ld.bfd: cannot find -lgstreamer-1.0 > Error: Error while linking > Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > Error: /usr/bin/ppcx64 returned an error exitcode > This is a typical error when you do not have the gstreamer1-0-dev package installed. normally, sudo apt-get install libgstreamer1.0-dev will fix this. Alternatively, you can try to change the code gstreamerlib = 'libgstreamer-1.0'; {Setup as you need} to gstreamerlib = 'libgstreamer-1.0.so.0'; {Setup as you need} Michael. From michael at freepascal.org Wed Nov 9 13:08:10 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 9 Nov 2022 13:08:10 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Tue, 8 Nov 2022, duilio foschi wrote: > I am puzzled by TMS Software. You are not alone. Your story is recognizable. [snip] > I bought TMS Web Core months ago with the idea of quickly write web > applications in Lazarus, with a special aim at their > TWebGridComponent, but I can say today that it was no wise purchase :) What can I say ? We cooperated with them, we have made pas2js available to them, we provide quick bugfixes and improvements of pas2js, but we have no control over what they do with it or how their helpdesk functions. As for the grid component: In my daily work development environment we switched to using datatables.net. I can recommend it, just as bootstrap-table. It has all you need. It's perfectly usable with pas2js and the import units are available with pas2js. Michael. From aruna.hewapathirane at gmail.com Wed Nov 9 13:11:35 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Wed, 9 Nov 2022 07:11:35 -0500 Subject: [Lazarus] GStreamer API unit added In-Reply-To: <72d73758-b2a1-7b15-0a2f-6006e9fbdeeb@wetron.es> References: <72d73758-b2a1-7b15-0a2f-6006e9fbdeeb@wetron.es> Message-ID: On Wed, Nov 9, 2022 at 2:34 AM Luca Olivetti via lazarus < lazarus at lists.lazarus-ide.org> wrote: > El 9/11/22 a les 3:06, Aruna Hewapathirane via lazarus ha escrit: > > This time it tries to link but dies saying can't find : /usr/bin/ld.bfd: > > cannot find -lgstreamer-1.0 > > > In debian/ubuntu based distributions you'll have to install the > libgstreamer1.0-dev package: > > $ apt-file search libgstreamer-1.0 > libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 > libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1404.0 > libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1602.0 > libgstreamer1.0-0: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1603.0 > libgstreamer1.0-dev: /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so > libgstreamer1.0-dev: > /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/ > libgstreamer-1.0.so.0.1602.0-gdb.py > libgstreamer1.0-dev: > /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/ > libgstreamer-1.0.so.0.1603.0-gdb.py > > > Bye > -- > Luca Olivetti > Wetron Automation Technology http://www.wetron.es/ > Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 > Ahhh.. ofcourse.. thank you Luca. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aruna.hewapathirane at gmail.com Wed Nov 9 13:22:35 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Wed, 9 Nov 2022 07:22:35 -0500 Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: On Wed, Nov 9, 2022 at 3:37 AM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > > On Tue, 8 Nov 2022, Aruna Hewapathirane wrote: > > >> > > Hello Michael, > > > > I tried to get things working but had problems with the IDE I have > attached > > screenshots. > > It seems you opened the .lpi file as a pascal file using the file - open > menu ? > > A .lpi file must be opened with project - open menu. > Oh.. I did not know this thank you. Yes it opens fine now. Screenshot attached. https://pasteboard.co/6vWHLlaCiYc3.png > > > Then I tried to see if I can get it going on the commandline but trouble > > again, see below please. > > > > aruna at debian:/media/aruna/linux-next/home/lazarus/gstreamer/example$ fpc > > playmp3 > > Free Pascal Compiler version 3.2.0+dfsg-12 [2021/01/25] for x86_64 > > Copyright (c) 1993-2020 by Florian Klaempfl and others > > Target OS: Linux for x86-64 > > Compiling playmp3.pp > > playmp3.pp(48,95) Warning: range check error while evaluating constants > (-1 > > must be between 0 and 18446744073709551615) > > Linking playmp3 > > /usr/bin/ld.bfd: cannot find -lgstreamer-1.0 > > Error: Error while linking > > Fatal: There were 1 errors compiling module, stopping > > Fatal: Compilation aborted > > Error: /usr/bin/ppcx64 returned an error exitcode > > > > This is a typical error when you do not have the gstreamer1-0-dev package > installed. > > normally, > > sudo apt-get install libgstreamer1.0-dev > > will fix this. > I installed gstreamer1.0-dev package and now it compiles. Compiles and builds playmp3 - screenshot attached. https://pasteboard.co/Uq4bM35Ykllu.png But new problem now. I have attached screenshots. Errors when trying to play a *.mp3 file: https://pasteboard.co/xK7PNcnRMZa8.png > > Alternatively, you can try to change the code > > gstreamerlib = 'libgstreamer-1.0'; {Setup as you need} > > to > > gstreamerlib = 'libgstreamer-1.0.so.0'; {Setup as you need} > > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus Thank you for your patience and all the guidance, Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Wed Nov 9 13:38:10 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 9 Nov 2022 13:38:10 +0100 (CET) Subject: [Lazarus] GStreamer API unit added In-Reply-To: References: Message-ID: On Wed, 9 Nov 2022, Aruna Hewapathirane wrote: >> normally, >> >> sudo apt-get install libgstreamer1.0-dev >> >> will fix this. >> > > I installed gstreamer1.0-dev package and now it compiles. > Compiles and builds playmp3 - screenshot attached. > https://pasteboard.co/Uq4bM35Ykllu.png > > > But new problem now. I have attached screenshots. > > Errors when trying to play a *.mp3 file: > https://pasteboard.co/xK7PNcnRMZa8.png That's an error of gstreamer itself. At first sight I would say that you are not using pulseaudio on your system, since it seems gstreamer cannot connect to the pulseaudio streamer. Try changing "pulsesink" with "osssink" or "alsasink" in the gst_parse_launch call. If none of those help, I'm also at a loss: I am not a gstreamer expert... Michael. From octopushole at gmail.com Wed Nov 9 15:53:38 2022 From: octopushole at gmail.com (duilio foschi) Date: Wed, 9 Nov 2022 15:53:38 +0100 Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: >we switched to using datatables.net very interesting. Is any sample code available for its use with pas2js? . Thank you Peppe On Wed, Nov 9, 2022 at 1:08 PM Michael Van Canneyt via lazarus wrote: > > > > On Tue, 8 Nov 2022, duilio foschi wrote: > > > I am puzzled by TMS Software. > > You are not alone. Your story is recognizable. > > [snip] > > > I bought TMS Web Core months ago with the idea of quickly write web > > applications in Lazarus, with a special aim at their > > TWebGridComponent, but I can say today that it was no wise purchase :) > > What can I say ? > > We cooperated with them, we have made pas2js available to them, > we provide quick bugfixes and improvements of pas2js, > but we have no control over what they do with it or how their helpdesk > functions. > > As for the grid component: > In my daily work development environment we switched to using datatables.net. > I can recommend it, just as bootstrap-table. It has all you need. > > It's perfectly usable with pas2js and the import units are available with pas2js. > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From michael at freepascal.org Wed Nov 9 16:20:03 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 9 Nov 2022 16:20:03 +0100 (CET) Subject: [Lazarus] SQLDBRestBridge In-Reply-To: References: Message-ID: On Wed, 9 Nov 2022, duilio foschi wrote: >> we switched to using datatables.net > > very interesting. > > Is any sample code available for its use with pas2js? . Hm. I just noticed this was not migrated from our old SVN repo to the Git repo :-/ Luckily I kept a copy of the SVN repos :-) I added the code and an example to git: See packages/datatables demo/datatables or https://gitlab.com/freepascal.org/fpc/pas2js/-/tree/main/packages/datatables https://gitlab.com/freepascal.org/fpc/pas2js/-/tree/main/demo/datatables Should something still be missing, let me know. Michael. > > Thank you > > Peppe > > On Wed, Nov 9, 2022 at 1:08 PM Michael Van Canneyt via lazarus > wrote: >> >> >> >> On Tue, 8 Nov 2022, duilio foschi wrote: >> >>> I am puzzled by TMS Software. >> >> You are not alone. Your story is recognizable. >> >> [snip] >> >>> I bought TMS Web Core months ago with the idea of quickly write web >>> applications in Lazarus, with a special aim at their >>> TWebGridComponent, but I can say today that it was no wise purchase :) >> >> What can I say ? >> >> We cooperated with them, we have made pas2js available to them, >> we provide quick bugfixes and improvements of pas2js, >> but we have no control over what they do with it or how their helpdesk >> functions. >> >> As for the grid component: >> In my daily work development environment we switched to using datatables.net. >> I can recommend it, just as bootstrap-table. It has all you need. >> >> It's perfectly usable with pas2js and the import units are available with pas2js. >> >> Michael. >> -- >> _______________________________________________ >> lazarus mailing list >> lazarus at lists.lazarus-ide.org >> https://lists.lazarus-ide.org/listinfo/lazarus > From bo.berglund at gmail.com Fri Nov 11 16:29:31 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 11 Nov 2022 16:29:31 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? Message-ID: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> I am using a TListbox component on a form for displaying debug data arriving over a serial line at 115200 baud. The data are a set of MQTT telegram texts which arrive in packets of about 40 lines each time (once per 10 seconds). I add them to the listbox as follows: procedure THanSimulatorMain.OnRxData(Sender: TObject; const Data: TBytes); var len, oldlen: integer; DataTxt: AnsiString; begin len := Length(Data); //Incoming packet oldlen := Length(DataBuffer); SetLength(DataBuffer, oldlen + len); Move(Data[0], DataBuffer[oldlen], len); SetLength(DataTxt, Length(DataBuffer)); Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); lbxRxData.Items.Text := DataTxt; //Add the text to the list lbxRxData.ItemIndex := lbxRxData.Items.Count -1; //To make it visible end; DataBuffer is a global TBytes container where the incoming data are stuffed as they arrive (it grows during the session). You see that the buffer contains the complete log history from the start... I have noticed that after a while the display becomes very sluggish when data arrives and I think that is due to the way the component operates. Now I wonder if there is some way to do as I did when I worked in Delphi with TListView objects, where I could use the BeginUpdate and EndUpdate calls to make all screen updates wait until it was all put in place. This was MUCH faster! But I can not find a BeginUpdate on the TListBox object, only BeginUpdateBounds, which does not tell me much.... Any suggestions? -- Bo Berglund Developer in Sweden From zeljko at holobit.hr Fri Nov 11 16:52:29 2022 From: zeljko at holobit.hr (zeljko) Date: Fri, 11 Nov 2022 16:52:29 +0100 Subject: [Lazarus] Qt6 widgetset Message-ID: <6d6e2bbe-32c1-d765-a0fc-cd0b5cc694f8@holobit.hr> Hi all, I've just committed Qt6 widgetset into main :) Tested only under linux atm (win32/64 and mac users can try to build libQt6Pas, if something went wrong pls inform me or open an issue about it), lazarus ide qt6 works just fine. libQt6Pas is based on LTS Qt6-6.2.3, so to build libQt6Pas.so.6.2.3 you must have installed Qt6 with minimum version 6.2. Read lcl/interfaces/qt6/cbindings/README howto build libQt6Pas. Printing (Printers4Lazarus) is not yet implemented, but other stuff is complete. libQt6Pas does not depend on qtnetwork anymore, it's removed since fpc have complete network solution. Bug reports are welcome :) zeljko From luca at wetron.es Fri Nov 11 17:10:08 2022 From: luca at wetron.es (Luca Olivetti) Date: Fri, 11 Nov 2022 17:10:08 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: El 11/11/22 a les 16:29, Bo Berglund via lazarus ha escrit: > I have noticed that after a while the display becomes very sluggish when data > arrives and I think that is due to the way the component operates. You could try using a TSynEdit instead of a TListBox: some years ago I switched from TMemo to TSynEdit to do some logging in a similar (though I add lines instead of assigning the complete text, also, I delete the oldest line when there are 5000 lines) because I found that, under windows, TSynEdit is an order of magnitude (or more) faster than TMemo. No difference under linux though, and maybe it's no longer true nowadays. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bo.berglund at gmail.com Fri Nov 11 17:50:16 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 11 Nov 2022 17:50:16 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: <67vsmhlaumgjsjvaq7nehsfbsh367vemd3@4ax.com> On Fri, 11 Nov 2022 16:29:31 +0100, Bo Berglund via lazarus wrote: >Now I wonder if there is some way to do as I did when I worked in Delphi with >TListView objects, where I could use the BeginUpdate and EndUpdate calls to make >all screen updates wait until it was all put in place. >This was MUCH faster! > >But I can not find a BeginUpdate on the TListBox object, only BeginUpdateBounds, >which does not tell me much.... In fact I found TListbox.Items.Beginupdate/EndUpdate, but it did not do much to improve the handling, too slow anyway.... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Fri Nov 11 17:56:10 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 11 Nov 2022 17:56:10 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: On Fri, 11 Nov 2022 17:10:08 +0100, Luca Olivetti via lazarus wrote: >El 11/11/22 a les 16:29, Bo Berglund via lazarus ha escrit: >> I have noticed that after a while the display becomes very sluggish when data >> arrives and I think that is due to the way the component operates. > >You could try using a TSynEdit instead of a TListBox: some years ago I >switched from TMemo to TSynEdit to do some logging in a similar (though >I add lines instead of assigning the complete text, also, I delete the >oldest line when there are 5000 lines) because I found that, under >windows, TSynEdit is an order of magnitude (or more) faster than TMemo. >No difference under linux though, and maybe it's no longer true nowadays. > I have never used TSynEdit before so I tried dropping one onto my form and it looked a bit "strange" with a wide margin to the left... How does it work (especially the margin that steals space)? Note that I do not need an editor as such, just somewhere to show the log lines, and possibly also a way to copy certain lines or text sections to paste somewhere else. BTW this application is on Windows and I am using Lazarus 2.0.12 and FPC 3.2.0 -- Bo Berglund Developer in Sweden From werner.pamler at freenet.de Fri Nov 11 18:23:53 2022 From: werner.pamler at freenet.de (Werner Pamler) Date: Fri, 11 Nov 2022 18:23:53 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: <6449ab9e-db10-51a8-da5e-6d5999cc5c8b@freenet.de> Am 11.11.2022 um 16:29 schrieb Bo Berglund via lazarus: > You see that the buffer contains the complete log history from the start... When the first block of data has arrived I would store the length of the buffer at this time. Then next time when new data come in, I would extract the "new data", i.e. the bytes between the stored length and the new length of the buffer and add them to the listbox. And store the current length for the next round. Etc... This avoids moving all the data to the listbox, which it already has, again and again. Because extraction of the individual lines in lbxRxdata.Items.Text := DataTxt is a length process. From luca at wetron.es Fri Nov 11 18:49:15 2022 From: luca at wetron.es (Luca Olivetti) Date: Fri, 11 Nov 2022 18:49:15 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: El 11/11/22 a les 17:56, Bo Berglund via lazarus ha escrit: > I have never used TSynEdit before so I tried dropping one onto my form and it > looked a bit "strange" with a wide margin to the left... > How does it work (especially the margin that steals space)? Play with the properties in the project inspector, you can remove the gutter (gutter.visible -> false), the margin (by setting RightEdge to a very big value, say 800) and customize much of its appearance.. > > Note that I do not need an editor as such, just somewhere to show the log lines, > and possibly also a way to copy certain lines or text sections to paste > somewhere else. Me too. Just set the readonly property to true and that's it. Then just treat it like a TMemo (using the Lines property). It has some more goodies that aren't available in a Tmemo. As I said, I was using a TMemo for logging and it was too slow under windows, I switched to a TSynEdit and had great improvement in performance. > > BTW this application is on Windows and I am using Lazarus 2.0.12 and FPC 3.2.0 So you'll probably see an improvement by using a TSynEdit (or maybe not, the only way to know is to try it). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bo.berglund at gmail.com Fri Nov 11 23:37:14 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 11 Nov 2022 23:37:14 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: On Fri, 11 Nov 2022 18:49:15 +0100, Luca Olivetti via lazarus wrote: >Play with the properties in the project inspector, you can remove the >gutter (gutter.visible -> false), the margin (by setting RightEdge to a >very big value, say 800) and customize much of its appearance.. > I replaced the TListBox with a TSynEdit as suggested and I have "played with" the properties a bit. Seems to work quite well so far. > >Me too. Just set the readonly property to true and that's it. >Then just treat it like a TMemo (using the Lines property). It has some >more goodies that aren't available in a Tmemo. >As I said, I was using a TMemo for logging and it was too slow under >windows, I switched to a TSynEdit and had great improvement in performance. > I have a couple of questions: 1) Is there a way to make sure that when adding text the view shifts such that the last line is visible? I.e. Automatically scroll the text up when new text is added. 2) The reason I am not adding incoming data to the listbox as tyhey arrive is that I don't know if the serial component provides the data at line endings or in the middle of a line, so I add the data to the old data in the TBytes array and then dump the content of the TBytes into the text property of the box. What happens if one adds the text as a block to this synedit where the block does not end in a line feed? Will the end of it be some way into the last line such that if I then add the next transmission it will start at tahat position and not on a new line? If that is possible then the handling will become a lot easier since I just have to add the few new lines at the end directly in synedit... I'll test that too. But how to jump to the end of the text on screen? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Nov 12 09:33:51 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 12 Nov 2022 09:33:51 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: On Fri, 11 Nov 2022 23:37:14 +0100, Bo Berglund via lazarus wrote: Concerning TSynEdit: >I have a couple of questions: > >1) Is there a way to make sure that when adding text to synedit the view >shifts such that the last line is visible? >I.e. Automatically scroll the text up when new text is added.... This was my most acute problem with the synedit object, but see below... >2) The reason I am not adding incoming data to the listbox as they arrive is >that I don't know if the serial component provides the data at line endings or >in the middle of a line, so I add the data to the old data in the TBytes array >and then dump the content of the TBytes into the text property of the box. I have dug down into the serial component and found that it actually dumps data at a rather high pace with small packets every time... Example: One transmission contains 16 lines of data totalling 1130 bytes, but the serial port component triggered an ondata event for a lot less, more like less than 10 bytes so the transmission triggered a big number of events, each updating the listbox which totally overloaded the system. So now I have changed two properties on the serial component: - ReadPacketSize := 1500 (default is 16) - ReadTimeout := 200 (default is 2 ms) Since most transfers are shorter than 1500 the timeout of 200 ms will trigger and by then the complete message *is* available, hence only one call to update the screen display with new text. This helps to make it more responsive... >What happens if one adds the text as a block to this synedit where the block >does not end in a line feed? >Will the end of it be some way into the last line such that if I then add the >next transmission it will start at that position and not on a new line? It is my belief that even though there is no data following the end of the last line (like an explicit linefeed), the next data added will start on a new line... Unless of course one could do the following (pseudocode): synedit.lines[lastline] := synedit.lines[lastline] + incomingdata; This would extend the last line with the incoming data... > >If that is possible then the handling will become a lot easier since I just have >to add the few new lines at the end directly in synedit... No just simply adding incoming data to the lines does not work, they will start on a new line (see above)... >But how to jump to the end of the text on screen? Right now this was my one remaining issue, since the Lines property does not have a settable "ItemIndex" value that will move a line into the visible area. But I found out that there is another useful property: synRxData.CaretY := synRxData.Lines.Count; This tries to put the cursor 1 line beyond the end and it does exactly what I need to do by showing the incoming new data and scrolling up the display visibly. This is how it is now done in full: SetLength(DataTxt, Length(DataBuffer)); //Set string length Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); //Copy data to string {$ifdef USESYNEDIT} synRxData.Lines.Beginupdate; synRxData.Lines.Text := DataTxt; synRxData.CaretY := synRxData.Lines.Count; synRxData.Lines.Endupdate; {$else} lbxRxData.Items.Beginupdate; lbxRxData.Items.Text := DataTxt; lbxRxData.ItemIndex := lbxRxDataBak.Items.Count -1; lbxRxData.Items.Endupdate; {$endif} -- Bo Berglund Developer in Sweden From luca at wetron.es Sat Nov 12 09:45:15 2022 From: luca at wetron.es (Luca Olivetti) Date: Sat, 12 Nov 2022 09:45:15 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: > But how to jump to the end of the text on screen? > TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 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 Sat Nov 12 12:13:05 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 12 Nov 2022 12:13:05 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> Message-ID: On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus wrote: >El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: > >> But how to jump to the end of the text on screen? >> > >TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 > Did not work, but this does work: synRxData.CaretY := synRxData.Lines.Count; -- Bo Berglund Developer in Sweden From giuliano.colla at fastwebnet.it Sat Nov 12 22:00:46 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Sat, 12 Nov 2022 22:00:46 +0100 Subject: [Lazarus] Debug issue on Mac Ventura Message-ID: <336cd570-d549-2731-5d94-865ab763dceb@fastwebnet.it> Hi folks, I just installed Lazarus (2.2.4) on my new MacBook pro 16", which runs the Ventura Os. Everything is ok, except the debugger. I followed the? instructions on the wiki page, selected the LLDB debugger, but both with "Enable Dwarf 3 (-gw3)" and "Enable Dwarf2 with sets" the debugger crashes on start. Is it happening because Ventura Os is quite new and they must still iron out some bugs, or I'm missing some point? Any hint is welcome. Thanks in advance, Giuliano -- Do not do to others as you would have them do to you.They might have different tastes. From giuliano.colla at fastwebnet.it Sat Nov 12 22:57:09 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Sat, 12 Nov 2022 22:57:09 +0100 Subject: [Lazarus] Debug issue on Mac Ventura In-Reply-To: <336cd570-d549-2731-5d94-865ab763dceb@fastwebnet.it> References: <336cd570-d549-2731-5d94-865ab763dceb@fastwebnet.it> Message-ID: <17e81a28-d4c6-b5fe-4526-e4df40a362de@fastwebnet.it> Sorry for the noise. My fault. I had inadvertently made some operation with Xcode before moving it from the Download folder to the Applications folder, so that it was left a path pointing to the Download folder. An xcode-select -p told me the full story. Now I must find how to have the debugger window not being hidden behind the editor window, but I'll sort it out, I hope! Giuliano Il 12/11/2022 22:00, Giuliano Colla via lazarus ha scritto: > Hi folks, > > I just installed Lazarus (2.2.4) on my new MacBook pro 16", which runs > the Ventura Os. Everything is ok, except the debugger. I followed the? > instructions on the wiki page, selected the LLDB debugger, but both > with "Enable Dwarf 3 (-gw3)" and "Enable Dwarf2 with sets" the > debugger crashes on start. > > Is it happening because Ventura Os is quite new and they must still > iron out some bugs, or I'm missing some point? Any hint is welcome. > > Thanks in advance, > > Giuliano > -- Do not do to others as you would have them do to you.They might have different tastes. From luca at wetron.es Sun Nov 13 22:36:27 2022 From: luca at wetron.es (Luca Olivetti) Date: Sun, 13 Nov 2022 22:36:27 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> Message-ID: <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit: > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus > wrote: > >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: >> >>> But how to jump to the end of the text on screen? >>> >> >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 >> > > Did not work, but this does work: Strange, I've been using it for many years (and still use it) to ensure the last line is visible. > > synRxData.CaretY := synRxData.Lines.Count; > -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From aruna.hewapathirane at gmail.com Tue Nov 15 20:11:57 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Tue, 15 Nov 2022 14:11:57 -0500 Subject: [Lazarus] Creating a library Message-ID: Hello Everyone, I was wondering if it is possible for me to create a library with my own set of code snippets I use on a regular basis . Is there any example code I can possibly look at how this is done? Or a small single function example if someone is willing would help immensely. Thank you. Aruna Hewapathirane -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascaldragon at googlemail.com Tue Nov 15 20:28:39 2022 From: pascaldragon at googlemail.com (Sven Barth) Date: Tue, 15 Nov 2022 20:28:39 +0100 Subject: [Lazarus] Creating a library In-Reply-To: References: Message-ID: <1e840817-c08e-999f-bd49-b9fbae574120@googlemail.com> Am 15.11.2022 um 20:11 schrieb Aruna Hewapathirane via lazarus: > Hello Everyone, > > I was wondering if it is possible for me to create a library with my > own set of code snippets I use on a regular basis . Is there any > example code I can possibly look at how this is done? > > Or a small single function example if someone is willing would help > immensely. Do you really mean a library in the sense of a DLL or SO which requires you to pay a bit more attention to how you code it due to the crossing of the module boundaries or do you mean a Lazarus package which is a collection of units that Lazarus will compile for you if necessary and that you can use freely? Regards, Sven From aruna.hewapathirane at gmail.com Tue Nov 15 20:31:29 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Tue, 15 Nov 2022 14:31:29 -0500 Subject: [Lazarus] Creating a library In-Reply-To: <1e840817-c08e-999f-bd49-b9fbae574120@googlemail.com> References: <1e840817-c08e-999f-bd49-b9fbae574120@googlemail.com> Message-ID: On Tue, Nov 15, 2022 at 2:28 PM Sven Barth via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Am 15.11.2022 um 20:11 schrieb Aruna Hewapathirane via lazarus: > > Hello Everyone, > > > > I was wondering if it is possible for me to create a library with my > > own set of code snippets I use on a regular basis . Is there any > > example code I can possibly look at how this is done? > > > > Or a small single function example if someone is willing would help > > immensely. > > Do you really mean a library in the sense of a DLL or SO which requires > you to pay a bit more attention to how you code it due to the crossing > of the module boundaries or do you mean a Lazarus package which is a > collection of units that Lazarus will compile for you if necessary and > that you can use freely? > > Regards, > Sven > Hi Sven, my apologies I should have been more specific and yes it is the linux SO I am specifically interested in but certainly also interested in how to create the DLL for Windows.Thanks! > _______________________________________________ > 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 Tue Nov 15 21:50:12 2022 From: pascaldragon at googlemail.com (Sven Barth) Date: Tue, 15 Nov 2022 21:50:12 +0100 Subject: [Lazarus] Creating a library In-Reply-To: References: <1e840817-c08e-999f-bd49-b9fbae574120@googlemail.com> Message-ID: <1cbd9731-a7ed-6ac6-782b-9d1a6a253c27@googlemail.com> Am 15.11.2022 um 20:31 schrieb Aruna Hewapathirane: > > On Tue, Nov 15, 2022 at 2:28 PM Sven Barth via lazarus > wrote: > > Am 15.11.2022 um 20:11 schrieb Aruna Hewapathirane via lazarus: > > Hello Everyone, > > > > I was wondering if it is possible for me to create a library > with my > > own set of code snippets I use on a regular basis . Is there any > > example code I can possibly look at how this is done? > > > > Or a small single function example if someone is willing would help > > immensely. > > Do you really mean a library in the sense of a DLL or SO which > requires > you to pay a bit more attention to how you code it due to the > crossing > of the module boundaries or do you mean a Lazarus package which is a > collection of units that Lazarus will compile for you if necessary > and > that you can use freely? > > Regards, > Sven > > > Hi Sven, my apologies I should have been more specific and yes it is > the linux SO > I am specifically interested in but certainly also interested in how > to create the DLL > for Windows.Thanks! > Then please take a look here: https://www.freepascal.org/docs-html/prog/progch12.html#x262-27800012 But also pay attention to these articles on the Wiki which raise a few issues you need to be aware of: - https://wiki.freepascal.org/Lazarus/FPC_Libraries - https://wiki.freepascal.org/shared_library Important points of these to keep in mind: - don't allocate memory in the module and release in the program (or vice versa) - unless you use a common memory manager between them like ShareMem or cmem - this also includes strings and arrays - don't pass classes between module and program - don't propagate exceptions from the module to the program (or vice versa) Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From aruna.hewapathirane at gmail.com Wed Nov 16 12:33:16 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Wed, 16 Nov 2022 06:33:16 -0500 Subject: [Lazarus] Creating a library In-Reply-To: <1cbd9731-a7ed-6ac6-782b-9d1a6a253c27@googlemail.com> References: <1e840817-c08e-999f-bd49-b9fbae574120@googlemail.com> <1cbd9731-a7ed-6ac6-782b-9d1a6a253c27@googlemail.com> Message-ID: On Tue, Nov 15, 2022 at 3:50 PM Sven Barth via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Am 15.11.2022 um 20:31 schrieb Aruna Hewapathirane: > > > On Tue, Nov 15, 2022 at 2:28 PM Sven Barth via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> Am 15.11.2022 um 20:11 schrieb Aruna Hewapathirane via lazarus: >> > Hello Everyone, >> > >> > I was wondering if it is possible for me to create a library with my >> > own set of code snippets I use on a regular basis . Is there any >> > example code I can possibly look at how this is done? >> > >> > Or a small single function example if someone is willing would help >> > immensely. >> >> Do you really mean a library in the sense of a DLL or SO which requires >> you to pay a bit more attention to how you code it due to the crossing >> of the module boundaries or do you mean a Lazarus package which is a >> collection of units that Lazarus will compile for you if necessary and >> that you can use freely? >> >> Regards, >> Sven >> > > > Hi Sven, my apologies I should have been more specific and yes it is the > linux SO > I am specifically interested in but certainly also interested in how to > create the DLL > for Windows.Thanks! > > Then please take a look here: > https://www.freepascal.org/docs-html/prog/progch12.html#x262-27800012 > Thank you, this is what I was looking for. Very much appreciate you taking the time to help a noob. That is some serious documentation by the way.. :-) > > > But also pay attention to these articles on the Wiki which raise a few > issues you need to be aware of: > - https://wiki.freepascal.org/Lazarus/FPC_Libraries > - https://wiki.freepascal.org/shared_library > Understood and shall comply. Thank you again! > > > Important points of these to keep in mind: > - don't allocate memory in the module and release in the program (or vice > versa) - unless you use a common memory manager between them like ShareMem > or cmem - this also includes strings and arrays > - don't pass classes between module and program > - don't propagate exceptions from the module to the program (or vice versa) > > Regards, > Sven > Once again thank you very much for your time Sven. Aruna > -- > _______________________________________________ > 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 aruna.hewapathirane at gmail.com Thu Nov 17 00:03:05 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Wed, 16 Nov 2022 18:03:05 -0500 Subject: [Lazarus] How to populate a TListView programatically Message-ID: Hello Everyone, I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically? Does anyone have any example code that populates a Listview component through code please? Thank you, Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthieugiroux at yahoo.fr Thu Nov 17 00:20:12 2022 From: matthieugiroux at yahoo.fr (Matthieu Giroux) Date: Wed, 16 Nov 2022 23:20:12 +0000 (UTC) Subject: [Lazarus] How to populate a TListView programatically In-Reply-To: References: Message-ID: <2093195475.221250.1668640812991@mail.yahoo.com> I have created a TDBLIstView which populates a TListView with data.But you car test it. Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 RennesT?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via lazarus a ?crit : Hello Everyone, I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically? Does anyone have any example code that populates a Listview component through code please? Thank you, Aruna -- _______________________________________________ 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 werner.pamler at freenet.de Thu Nov 17 00:29:20 2022 From: werner.pamler at freenet.de (Werner Pamler) Date: Thu, 17 Nov 2022 00:29:20 +0100 Subject: [Lazarus] How to populate a TListView programatically In-Reply-To: References: Message-ID: Am 17.11.2022 um 00:03 schrieb Aruna Hewapathirane via lazarus: > Does anyone have any example code that populates a Listview component > through code please? procedure TForm1.FormCreate(Sender: TObject); var ? item: TListItem; ? i: Integer; begin ? for i := 0 to 9 do ? begin ??? item := ListView1.Items.Add; ??? item.Caption := 'Item ' + IntToStr(i); ??? item.SubItems.Add('Subitem ' + IntToStr(i) + '/1'); ??? item.SubItems.Add('Subitem ' + IntToStr(i) + '/2'); ??? item.ImageIndex := i; ??? item.SubItemImages[0] := i+1; ??? item.SubItemImages[1] := i+2; ? end; end; From aruna.hewapathirane at gmail.com Thu Nov 17 02:29:11 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Wed, 16 Nov 2022 20:29:11 -0500 Subject: [Lazarus] How to populate a TListView programatically In-Reply-To: <2093195475.221250.1668640812991@mail.yahoo.com> References: <2093195475.221250.1668640812991@mail.yahoo.com> Message-ID: On Wed, Nov 16, 2022 at 6:20 PM Matthieu Giroux wrote: > I have created a TDBLIstView which populates a TListView with data. > But you car test it. > Do you have a link to the code please? > > Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 Rennes > T?l : 02 23 46 06 54 - 06 44 733 008 > http://www.liberlog.fr > > > Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via > lazarus a ?crit : > > > Hello Everyone, > > I tried going through the fpc documentation and did some searching on > Google and found this video on youtube: > https://www.youtube.com/watch?v=ohfG7KISNq0 > > The video did help me to understand what to do in the Lazarus IDE but I am > unable to find any code that shows me how to populate a TListView > programmatically/dynamically? > > Does anyone have any example code that populates a Listview component > through code please? > > Thank you, > > Aruna > -- > _______________________________________________ > 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 aruna.hewapathirane at gmail.com Thu Nov 17 02:30:47 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Wed, 16 Nov 2022 20:30:47 -0500 Subject: [Lazarus] How to populate a TListView programatically In-Reply-To: References: Message-ID: On Wed, Nov 16, 2022 at 6:29 PM Werner Pamler via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Am 17.11.2022 um 00:03 schrieb Aruna Hewapathirane via lazarus: > > Does anyone have any example code that populates a Listview component > > through code please? > procedure TForm1.FormCreate(Sender: TObject); > var > item: TListItem; > i: Integer; > begin > for i := 0 to 9 do > begin > item := ListView1.Items.Add; > item.Caption := 'Item ' + IntToStr(i); > item.SubItems.Add('Subitem ' + IntToStr(i) + '/1'); > item.SubItems.Add('Subitem ' + IntToStr(i) + '/2'); > item.ImageIndex := i; > item.SubItemImages[0] := i+1; > item.SubItemImages[1] := i+2; > end; > end; > -- > This is exactly what I was looking for. It is the subitems that was giving me a real problem. Thank you very much Werner. > _______________________________________________ > 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 aruna.hewapathirane at gmail.com Thu Nov 17 12:31:41 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 17 Nov 2022 06:31:41 -0500 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting Message-ID: Hello Everyone, I managed to get the TListView to work after studying the example Sven sent. You can see a screenshot here: https://pasteboard.co/inCtdrOWwAvV.png How do I set the caption/Title for each column header? How do I set column header 1 to 'Country' and column header 2 to 'Region' please? Is it possible to sort? By each column ? If so how? Thank you, Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Thu Nov 17 12:39:28 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 17 Nov 2022 12:39:28 +0100 (CET) Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: On Thu, 17 Nov 2022, Aruna Hewapathirane via lazarus wrote: > Hello Everyone, > > I managed to get the TListView to work after studying the example Sven > sent. You can see a screenshot here: https://pasteboard.co/inCtdrOWwAvV.png > > How do I set the caption/Title for each column header? How do I set column > header 1 to 'Country' and column header 2 to 'Region' please? Var aCol : TListviewColumn; begin aCol:=Listview1.Columns.Add; aCol.Caption:='Country'; aCol:=Listview1.Columns.Add; aCol.Caption:='Region'; end; > > Is it possible to sort? By each column ? If so how? It is possible to sort: Listview1.SortColumn:=0; // change to column you need Listview1.SortDirection:=sdAscending; Listview1.Sort; Michael. From aruna.hewapathirane at gmail.com Thu Nov 17 12:47:15 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 17 Nov 2022 06:47:15 -0500 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: On Thu, Nov 17, 2022 at 6:39 AM Michael Van Canneyt via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > > On Thu, 17 Nov 2022, Aruna Hewapathirane via lazarus wrote: > > > Hello Everyone, > > > > I managed to get the TListView to work after studying the example Sven > > sent. You can see a screenshot here: > https://pasteboard.co/inCtdrOWwAvV.png > > > > How do I set the caption/Title for each column header? How do I set > column > > header 1 to 'Country' and column header 2 to 'Region' please? > > Var > aCol : TListviewColumn; > > begin > aCol:=Listview1.Columns.Add; > aCol.Caption:='Country'; > aCol:=Listview1.Columns.Add; > aCol.Caption:='Region'; > end; > Ah.. I am now beginning to understand. So you get the column into a variable then use the variable to access and set any properties? Thank you so much for your time Michael. > > > > > > Is it possible to sort? By each column ? If so how? > > It is possible to sort: > > Listview1.SortColumn:=0; // change to column you need > Listview1.SortDirection:=sdAscending; > Listview1.Sort; > Wow this is sweet! > > Michael > I just want to say this has to be the fastest support I have ever received and always with a response that is a concrete solution effectively diminishing the barriers for entry for newcomers. I am extremely grateful and humbled. Thank you! Aruna > _______________________________________________ > 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 aruna.hewapathirane at gmail.com Thu Nov 17 13:49:34 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 17 Nov 2022 07:49:34 -0500 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: Hello again, I have column headers and sorting works on a button click . Thank you once again Michael. I am trying to figure out how to sort when a user clicks a column header? Screenshot: https://pasteboard.co/QSf8hNafG0x5.png And I notice the column headers are sort of greyed out. Is it possible to make them bold if we want? And the column width am guessing we can set through code? Thank you, Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryansmithhe at gmail.com Thu Nov 17 13:54:50 2022 From: ryansmithhe at gmail.com (R.Smith) Date: Thu, 17 Nov 2022 14:54:50 +0200 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: On 2022/11/17 13:47, Aruna Hewapathirane via lazarus wrote: > On Thu, Nov 17, 2022 at 6:39 AM Michael Van Canneyt via lazarus > wrote: > > > > > Var > ? ?aCol : TListviewColumn; > > begin > ? ?aCol:=Listview1.Columns.Add; > ? ?aCol.Caption:='Country'; > ? ?aCol:=Listview1.Columns.Add; > ? ?aCol.Caption:='Region'; > end; > > > Ah.. I am now beginning to understand. So you get the column into a > variable then use the variable to access and > set any properties? ? Thank you so much for your time Michael. Not necessarily - it's not forcibly commanded to be done like that, it's just an easier, faster (to program) and more homogenous way of doing. This next version of the same code will also work just fine, but it requires you to keep track of numbering, which is mental load you do not need, and also makes it hard to insert/delete code rows, since you have to adjust all the column numbers above and below the affected row: begin ?? Listview1.Columns.Add; ?? Listview1.Columns[0].Caption:='Country'; ?? Listview1.Columns.Add; ?? Listview1.Columns[1].Caption:='Region'; end; So out of programming paradigm interest, yes this can work, but Michael's example is by far the more sensible preferred way of doing it. > > > I just want to say this has to be the fastest support I have ever > received and always with a response that > is a concrete solution effectively diminishing the barriers for entry > for newcomers. I am extremely grateful and humbled. That's appreciated - also note, in light of your next question, the TListView docs, available both in the online Wiki (https://wiki.freepascal.org/TListView - though it is quite lacking in useful examples currently), the online Docs with short but clear function descriptions (see here: https://lazarus-ccr.sourceforge.io/docs/lcl/comctrls/tlistview.html and here: https://lazarus-ccr.sourceforge.io/docs/lcl/comctrls/tlistitems.html) and bundled in the install (though there is a slight trick to make it work on Windows since it dropped automatic support for help files (.hlp? .chm? - I forget the extension on windows)) The Lazarus Forum is usually also a trove of examples (ex: https://forum.lazarus.freepascal.org/index.php?topic=11796.0) and a good place to ask questions. Welcome to FPC/Lazarus and good luck! -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascaldragon at googlemail.com Thu Nov 17 14:12:46 2022 From: pascaldragon at googlemail.com (Sven Barth) Date: Thu, 17 Nov 2022 14:12:46 +0100 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: Aruna Hewapathirane via lazarus schrieb am Do., 17. Nov. 2022, 12:31: > I managed to get the TListView to work after studying the example Sven > sent. You can see a screenshot here: > https://pasteboard.co/inCtdrOWwAvV.png > You sure you don't mean Werner instead of me? ;) Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthieugiroux at yahoo.fr Thu Nov 17 14:37:50 2022 From: matthieugiroux at yahoo.fr (Matthieu Giroux) Date: Thu, 17 Nov 2022 13:37:50 +0000 (UTC) Subject: [Lazarus] How to populate a TListView programatically In-Reply-To: References: <2093195475.221250.1668640812991@mail.yahoo.com> Message-ID: <1732464850.2402160.1668692270124@mail.yahoo.com> It is Extended suite :Download XML Frames BPM VRAD Lazarus from SourceForge.net | | | | Download XML Frames BPM VRAD Lazarus from SourceForge.net Your download will start shortly... | | | Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 RennesT?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr Le jeudi 17 novembre 2022 ? 02:29:24 UTC+1, Aruna Hewapathirane a ?crit : On Wed, Nov 16, 2022 at 6:20 PM Matthieu Giroux wrote: I have created a TDBLIstView which populates a TListView with data.But you car test it. Do you have a link to the code please? ? Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 RennesT?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via lazarus a ?crit : Hello Everyone, I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically? Does anyone have any example code that populates a Listview component through code please? Thank you, Aruna -- _______________________________________________ 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 aruna.hewapathirane at gmail.com Thu Nov 17 15:42:16 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 17 Nov 2022 09:42:16 -0500 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: On Thu, Nov 17, 2022 at 7:54 AM R.Smith via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > On 2022/11/17 13:47, Aruna Hewapathirane via lazarus wrote: > > On Thu, Nov 17, 2022 at 6:39 AM Michael Van Canneyt via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> >> >> >> Var >> aCol : TListviewColumn; >> >> begin >> aCol:=Listview1.Columns.Add; >> aCol.Caption:='Country'; >> aCol:=Listview1.Columns.Add; >> aCol.Caption:='Region'; >> end; >> > > Ah.. I am now beginning to understand. So you get the column into a > variable then use the variable to access and > set any properties? Thank you so much for your time Michael. > > Not necessarily - it's not forcibly commanded to be done like that, it's > just an easier, faster (to program) and more homogenous way of doing. This > next version of the same code will also work just fine, but it requires you > to keep track of numbering, which is mental load you do not need, and also > makes it hard to insert/delete code rows, since you have to adjust all the > column numbers above and below the affected row: > > begin > Listview1.Columns.Add; > Listview1.Columns[0].Caption:='Country'; > Listview1.Columns.Add; > Listview1.Columns[1].Caption:='Region'; > end; > So out of programming paradigm interest, yes this can work, but Michael's > example is by far the more sensible preferred way of doing it. > Thank you, I believe it is always good to know alternative ways to achieve the same end result. And you are right I will stick with Michael's example :-) > > >> > I just want to say this has to be the fastest support I have ever received > and always with a response that > is a concrete solution effectively diminishing the barriers for entry for > newcomers. I am extremely grateful and humbled. > > > That's appreciated > I meant what I said very sincerely and straight from the heart. If you have ever tried hacking the Linux kernel you will understand what I mean. That can be a very frustrating experience for a total newcomer and I am yet to ask a question in more than a decade now of dabbling with linux and receive a straight answer with a clear and concise example that I can study and learn from. I do not say this in a bad way but they usually ask " What problem are you trying to solve?" and am scratching my head thinking I am not trying to solve anything I am just trying to learn and understand why things are done in a certain way? Never will they give you what you ask for but happily give you rather cryptic hints that lead you down a very dark rabbit hole. The end result is most newcomers do not stick around long enough. Soo.. when I am suddenly exposed to a whole new level of immediate and sincere support that to me is an extremely welcome and empowering experience. Sadly does not happen a lot with Linux they can be a very toxic bunch. So this is very much appreciated and like I said totally unexpected and that is what humbled me. Do not get me wrong the Linux community also has very sincere people I will never forget how foolish I felt after sending out a noob question on the kernel newbies list and everyone was more or less giving me a hard time and just when I was about to call it quits Dan Carpenter emails me saying " We were all newbies at one point.." that is when I decided you lot are not going to make me stop loving Linux :-) Only someone who writes code will truly understand the pain when you have access to all possible documentation which is comprehensive to say the least with lazarus and fpc but sadly lacking examples demonstrating the components functionality which I will try to change slowly once I have become sufficiently comfortable with the IDE and FPC and learnt how things are done. Wish me luck :-) > - also note, in light of your next question, the TListView docs, available > both in the online Wiki (https://wiki.freepascal.org/TListView - though > it is quite lacking in useful examples currently), > Examples we can always build ? I am actually now thinking of doing exactly that :-) > the online Docs with short but clear function descriptions (see here: > https://lazarus-ccr.sourceforge.io/docs/lcl/comctrls/tlistview.html and > here: https://lazarus-ccr.sourceforge.io/docs/lcl/comctrls/tlistitems.html) > and bundled in the install (though there is a slight trick to make it work > on Windows since it dropped automatic support for help files (.hlp? .chm? - > I forget the extension on windows)) > I left Windows long years ago after they nuked my desktop multiple times ( Yes they actually did that ) and I got fed up of looking at blue screen of death after each re-install and given it was a pirated copy but I had no financial support back then I was between jobs laid off and dead broke and they go and fry my machine. So uh-uh never again I switched to Linux and immediately experienced the freedom I started with Ubuntu ( karmic ) and now use bleeding edge Debian it has never failed me so far. It does not get in my way and is robust, stable and simply works. Being able to customise anything I want is a very big plus :-) > The Lazarus Forum is usually also a trove of examples (ex: > https://forum.lazarus.freepascal.org/index.php?topic=11796.0) and a good > place to ask questions. > Yes I have started exploring the Lazarus Forum and it is full of goodies. Thank you. I have a small request if I may? Recently I was on the Lazarus IRC channel and it was a very long day for me and I had food on the stove and all I wanted was to know where I can find the Gstremer examples and someone ( Norayr I think was his/her handle on irc ) immediately reached out and helped me. Then Joanna signed in and we had a bit of back and forth and I must have said or done something that must have upset or annoyed her so I am now *banned* from the IRC which is sad and makes me unhappy. So with permission from all here I would like to publicly apologize to Joanna ( I belive she is the moderator for Lazarus IRC ) for whatever it is that I said or did to make her unhappy and respectfully request I be re-instated in the IRC channel. Yes I can use a vpn and get in, or turn off the wifi on my cell and get in but I really do not wish to do this. So I really am very sorry Joanna please re-consider your decision to ban me. ( Phew... ) > Welcome to FPC/Lazarus and good luck! > It feels like 'home' here if you know what I mean and thank you I will try to contribute meaningfully once I am up to that standard with the ide and fpc. I am sorry about all the irrelevant stuff but maybe all this will give some context that actually may help moving forward. Very sincerely and respectfully a sometimes grumpy 62 year old who has over the years grown a very thick skin :-) Thank you all, Aruna > > -- > _______________________________________________ > 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 aruna.hewapathirane at gmail.com Thu Nov 17 15:46:49 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 17 Nov 2022 09:46:49 -0500 Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: On Thu, Nov 17, 2022 at 8:13 AM Sven Barth via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Aruna Hewapathirane via lazarus schrieb > am Do., 17. Nov. 2022, 12:31: > >> I managed to get the TListView to work after studying the example Sven >> sent. You can see a screenshot here: >> https://pasteboard.co/inCtdrOWwAvV.png >> > > You sure you don't mean Werner instead of me? ;) > Oh dear your right it was Werner, my mistook :-) > Regards, > Sven > -- > _______________________________________________ > 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 michael at freepascal.org Thu Nov 17 16:35:48 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 17 Nov 2022 16:35:48 +0100 (CET) Subject: [Lazarus] TListView: Column Header Captions and Column Sorting In-Reply-To: References: Message-ID: On Thu, 17 Nov 2022, Aruna Hewapathirane wrote: > > > Hello again, > > I have column headers and sorting works on a button click . Thank you once > again Michael. > > I am trying to figure out how to sort when a user clicks a column header? > > Screenshot: https://pasteboard.co/QSf8hNafG0x5.png > > And I notice the column headers are sort of greyed out. Is it possible to > make them bold if we want? > And the column width am guessing we can set through code? In the IDE, set a OnColumnClick event handler. Define FLastColumnIndex and FLastSort as form fields, so your form will look like this: TForm1 = Class(TForm) ListView1 : TListView; procedure ListView1ColumnClick(Sender: TObject; Column: TListColumn); private FLastColumnIndex : Integer; FLastSort : TSortDirection; end; You can also set the event handler in code: ListView1.OnColumnClick:=@ListView1ColumnClick; In the OnColumnClick handler, do the following: procedure TForm1.ListView1ColumnClick(Sender: TObject; Column: TListColumn); var SD : TSortDirection; begin SD:=sdAscending; if Column.Index=FLastColumnIndex then if FLastSort=sdAscending then SD:=sdDescending; ListView1.SortColumn:=Column.Index; ListView1.SortDirection:=SD; ListView1.Sort; end; That should sort ascending if the user clicks on the column for the first time, and will toggle between ascending/descending if the user clicks on the same column. Michael. From aruna.hewapathirane at gmail.com Thu Nov 17 19:42:29 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 17 Nov 2022 13:42:29 -0500 Subject: [Lazarus] How to populate a TListView programatically In-Reply-To: <1732464850.2402160.1668692270124@mail.yahoo.com> References: <2093195475.221250.1668640812991@mail.yahoo.com> <1732464850.2402160.1668692270124@mail.yahoo.com> Message-ID: On Thu, Nov 17, 2022 at 8:37 AM Matthieu Giroux wrote: > It is Extended suite : > Download XML Frames BPM VRAD Lazarus from SourceForge.net > > > Download XML Frames BPM VRAD Lazarus from SourceForge.net > > Your download will start shortly... > > > > > Thank you Matthieu. > > Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 Rennes > T?l : 02 23 46 06 54 - 06 44 733 008 > http://www.liberlog.fr > > > Le jeudi 17 novembre 2022 ? 02:29:24 UTC+1, Aruna Hewapathirane < > aruna.hewapathirane at gmail.com> a ?crit : > > > On Wed, Nov 16, 2022 at 6:20 PM Matthieu Giroux > wrote: > > I have created a TDBLIstView which populates a TListView with data. > But you car test it. > > > Do you have a link to the code please? > > > > Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 Rennes > T?l : 02 23 46 06 54 - 06 44 733 008 > http://www.liberlog.fr > > > Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via > lazarus a ?crit : > > > Hello Everyone, > > I tried going through the fpc documentation and did some searching on > Google and found this video on youtube: > https://www.youtube.com/watch?v=ohfG7KISNq0 > > The video did help me to understand what to do in the Lazarus IDE but I am > unable to find any code that shows me how to populate a TListView > programmatically/dynamically? > > Does anyone have any example code that populates a Listview component > through code please? > > Thank you, > > Aruna > -- > _______________________________________________ > 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 flavio.etrusco at gmail.com Fri Nov 18 22:36:32 2022 From: flavio.etrusco at gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Etrusco?=) Date: Fri, 18 Nov 2022 18:36:32 -0300 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: Em sex., 11 de nov. de 2022 ?s 12:29, Bo Berglund via lazarus < lazarus at lists.lazarus-ide.org> escreveu: > > I am using a TListbox component on a form for displaying debug data arriving > over a serial line at 115200 baud. > The data are a set of MQTT telegram texts which arrive in packets of about 40 > lines each time (once per 10 seconds). > I add them to the listbox as follows: > > procedure THanSimulatorMain.OnRxData(Sender: TObject; const Data: TBytes); > var > len, oldlen: integer; > DataTxt: AnsiString; > begin > len := Length(Data); //Incoming packet > oldlen := Length(DataBuffer); > SetLength(DataBuffer, oldlen + len); > Move(Data[0], DataBuffer[oldlen], len); > SetLength(DataTxt, Length(DataBuffer)); > Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); > lbxRxData.Items.Text := DataTxt; //Add the text to the list > lbxRxData.ItemIndex := lbxRxData.Items.Count -1; //To make it visible > end; > > DataBuffer is a global TBytes container where the incoming data are stuffed as > they arrive (it grows during the session). > You see that the buffer contains the complete log history from the start... > > I have noticed that after a while the display becomes very sluggish when data > arrives and I think that is due to the way the component operates. > > Now I wonder if there is some way to do as I did when I worked in Delphi with > TListView objects, where I could use the BeginUpdate and EndUpdate calls to make > all screen updates wait until it was all put in place. > This was MUCH faster! > > But I can not find a BeginUpdate on the TListBox object, only BeginUpdateBounds, > which does not tell me much.... > > Any suggestions? > > > -- > Bo Berglund > Developer in Sweden Hi, What size is your data? The biggest problem regarding Windows' TListBox (and TMemo and others) was it used a contiguous buffer for its whole text and increased capacity by doubling the buffer or something, thus it got ugly easily; the parsing did seem to have some problems too. Microsoft alleviated this problem for TMemo at least at some point but I don`t know about TListBox. When you set/replace the whole text for a control (ex. using ListBox1.Items.Text) there`s (usually) no need to use Begin/EndUpdate; if you're appending a bunch of lines, though, you should use ListBox1.Items.BeginUpdate. Do you really need to keep 'DataBuffer' around for other reasons? Otherwise you could just: procedure TForm1.OnRxData(Sender: TObject; const Data: TBytes); var buf: TStringList; DataTxt: ansistring; begin SetLength(DataTxt, Length(Data)); Move(Data[0], DataTxt[1], Length(Data)); buf := TStringList.Create; buf.Text := DataTxt; SynEdit1.Lines.AddStrings(buf); buf.Free; SynEdit1.CaretY := SynEdit1.Lines.Count; end; Too bad TStrings don`t have a method to add text parsing the linebreaks... IMHO even a PChar overload with offsets would be deserved. Best regards, Fl?vio -------------- next part -------------- An HTML attachment was scrubbed... URL: From flavio.etrusco at gmail.com Fri Nov 18 22:40:57 2022 From: flavio.etrusco at gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Etrusco?=) Date: Fri, 18 Nov 2022 18:40:57 -0300 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> Message-ID: Em dom., 13 de nov. de 2022 ?s 18:36, Luca Olivetti via lazarus < lazarus at lists.lazarus-ide.org> escreveu: > El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit: > > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus > > wrote: > > > >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: > >> > >>> But how to jump to the end of the text on screen? > >>> > >> > >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 > >> > > > > Did not work, but this does work: > > Strange, I've been using it for many years (and still use it) to ensure > the last line is visible. > > (...) > -- > Luca Olivetti > Wetron Automation Technology http://www.wetron.es/ > Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 > It should work. Or even straight "TheSynEdit.TopLine:=TheSynEdit.Lines.Count;'. Best regards, Fl?vio -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sun Nov 20 08:23:02 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 20 Nov 2022 08:23:02 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> Message-ID: On Fri, 18 Nov 2022 18:40:57 -0300, Fl?vio Etrusco via lazarus wrote: >Em dom., 13 de nov. de 2022 ?s 18:36, Luca Olivetti via lazarus < >lazarus at lists.lazarus-ide.org> escreveu: > >> El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit: >> > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus >> > wrote: >> > >> >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: >> >> >> >>> But how to jump to the end of the text on screen? >> >>> >> >> >> >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 >> >> >> > >> > Did not work, but this does work: >> >> Strange, I've been using it for many years (and still use it) to ensure >> the last line is visible. >> >> (...) >> -- >> Luca Olivetti >> Wetron Automation Technology http://www.wetron.es/ >> Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 >> > > It should work. Or even straight >"TheSynEdit.TopLine:=TheSynEdit.Lines.Count;'. My current version of my logging tool application uses this to display incoming data on the serial port (where it ends up in the TBytes buffer DataBuffer[] before displaying): ... SetLength(DataTxt, Length(DataBuffer)); //Set string length Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); //Copy data to string {$ifdef USESYNEDIT} synRxData.Lines.Beginupdate; synRxData.Lines.Text := DataTxt; synRxData.CaretY := synRxData.Lines.Count; synRxData.Lines.Endupdate; stxLineCount.Caption := IntToStr(synRxData.Lines.Count); {$else} ... Right now it has been running since 2022-11-19 01:20:05 and contains 11936 log lines and whenever new data arrive it is almost instant on screen when it loads the new lines and displays the very bottom of the list... -- Bo Berglund Developer in Sweden From flavio.etrusco at gmail.com Sun Nov 20 22:21:56 2022 From: flavio.etrusco at gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Etrusco?=) Date: Sun, 20 Nov 2022 18:21:56 -0300 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> Message-ID: Em dom., 20 de nov. de 2022 04:23, Bo Berglund via lazarus < lazarus at lists.lazarus-ide.org> escreveu: > On Fri, 18 Nov 2022 18:40:57 -0300, Fl?vio Etrusco via lazarus > wrote: > > >Em dom., 13 de nov. de 2022 ?s 18:36, Luca Olivetti via lazarus < > >lazarus at lists.lazarus-ide.org> escreveu: > > > >> El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit: > >> > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus > >> > wrote: > >> > > >> >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: > >> >> > >> >>> But how to jump to the end of the text on screen? > >> >>> > >> >> > >> >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 > >> >> > >> > > >> > Did not work, but this does work: > >> > >> Strange, I've been using it for many years (and still use it) to ensure > >> the last line is visible. > >> > >> (...) > >> -- > >> Luca Olivetti > >> Wetron Automation Technology http://www.wetron.es/ > >> Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 > >> > > > > It should work. Or even straight > >"TheSynEdit.TopLine:=TheSynEdit.Lines.Count;'. > > My current version of my logging tool application uses this to display > incoming > data on the serial port (where it ends up in the TBytes buffer DataBuffer[] > before displaying): > > ... > SetLength(DataTxt, Length(DataBuffer)); //Set string length > Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); //Copy data to > string > {$ifdef USESYNEDIT} > synRxData.Lines.Beginupdate; > synRxData.Lines.Text := DataTxt; > synRxData.CaretY := synRxData.Lines.Count; > synRxData.Lines.Endupdate; > stxLineCount.Caption := IntToStr(synRxData.Lines.Count); > {$else} > ... > I see. My point is that you don't need to copy the whole DataBuffer and re-populate the whole SynEdit each time you receive new data. But this probably won't matter much unless you have hundreds of thousands of lines running on not so recent hardware. Best regards, Fl?vio > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sun Nov 20 22:59:02 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 20 Nov 2022 22:59:02 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? References: <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> Message-ID: On Sun, 20 Nov 2022 18:21:56 -0300, Fl?vio Etrusco via lazarus wrote: >I see. My point is that you don't need to copy the whole DataBuffer and >re-populate the whole SynEdit each time you receive new data. But this >probably won't matter much unless you have hundreds of thousands of lines >running on not so recent hardware. Well, I tried at first to add incoming data to the bottom of the window, but it turned out that when the transfer of data had been cut into parts by the serial buffer such that the OnRxdata() triggered several times during the transfer then the line at which the trigger happened was cut in two in the middle of the screen. Apparently the extra line break that was not part of the transfer was added by the control when the data was added to the end. Next data added to it was not adjacent to the last previous character but placed on the start of the next line... So the data in the synedit always ended with a linefeed even though there was not yet any such in the transfered data. Therefore I decided to use a dynamic TBytes array, which I could expand the size of whenever the data arrived to fit the new packet and put it at the end of the buffer. Then I just replaced the strings in the display control with the full buffer every time. This way lines are not visibly cut in half or worse.... But it would be better if I could have kept the data in the SynEdit itself and just expanded with new data as they arrived by putting them at the end... Not so much to transfer then. Just new arriving text. -- Bo Berglund Developer in Sweden From vojtech.cihak at atlas.cz Mon Nov 21 00:03:09 2022 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Mon, 21 Nov 2022 00:03:09 +0100 Subject: [Lazarus] =?utf-8?q?How_to_fix_slow_screen_refresh_of_TListbox?= =?utf-8?q?=3F?= In-Reply-To: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: <20221121000309.649D5A18@atlas.cz> It wouldn't be that hard to write custom component based on TGraphicControl + TBitmap with built-in bitmap font. Copying bitmap letters will be faster than rendering from ttf. ? V. ______________________________________________________________ > Od: "Bo Berglund via lazarus" > Komu: lazarus at lists.lazarus-ide.org > Datum: 11.11.2022 16:29 > P?edm?t: [Lazarus] How to fix slow screen refresh of TListbox? > Now I wonder if there is some way to do as I did when I worked in Delphi with TListView objects, where I could use the BeginUpdate and EndUpdate calls to make all screen updates wait until it was all put in place. This was MUCH faster! But I can not find a BeginUpdate on the TListBox object, only BeginUpdateBounds, which does not tell me much.... Any suggestions? -- Bo Berglund Developer in Sweden -- _______________________________________________ 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 jean.suzineau at wanadoo.fr Mon Nov 21 08:13:53 2022 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Mon, 21 Nov 2022 08:13:53 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: References: <723b9525-6e9c-3a63-878d-7c2b497b123f@wetron.es> <25047388-ff3a-22d3-f813-905bd362299f@wetron.es> Message-ID: <6fb0a241-1846-8794-8b83-141b05e8a906@wanadoo.fr> Maybe you could add a buffer in your flow of data, storing the incoming data ? When a line ending arrives, you can flush your buffer to Synedit up to the line ending, keeping in the buffer just the end of the data not yet terminated by a line ending. From coppolastudio at gmail.com Tue Nov 22 16:13:48 2022 From: coppolastudio at gmail.com (Salvatore Coppola) Date: Tue, 22 Nov 2022 16:13:48 +0100 Subject: [Lazarus] How to fix slow screen refresh of TListbox? In-Reply-To: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> References: <3npsmhlea4eu52b51rqt48010126d99m77@4ax.com> Message-ID: <76ea2f12-8df7-49e4-9c22-154c0df2852e@gmail.com> Back to the first question. You can append your data with lb.items.text. Just prepare your data in a string like this: strtmp:=data1+lineending+data2+lineending+..... And append lb.items.text:=lb.items.text+lineending+strtmp Yes it is a workaround but do the trick like beginupdate Ciao ?Ottieni BlueMail per Android ? Il giorno 11 Nov 2022, 16:29, alle ore 16:29, Bo Berglund via lazarus ha scritto: >I am using a TListbox component on a form for displaying debug data >arriving >over a serial line at 115200 baud. >The data are a set of MQTT telegram texts which arrive in packets of >about 40 >lines each time (once per 10 seconds). >I add them to the listbox as follows: > >procedure THanSimulatorMain.OnRxData(Sender: TObject; const Data: >TBytes); >var > len, oldlen: integer; > DataTxt: AnsiString; >begin > len := Length(Data); //Incoming packet > oldlen := Length(DataBuffer); > SetLength(DataBuffer, oldlen + len); > Move(Data[0], DataBuffer[oldlen], len); > SetLength(DataTxt, Length(DataBuffer)); > Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); > lbxRxData.Items.Text := DataTxt; //Add the text to the list > lbxRxData.ItemIndex := lbxRxData.Items.Count -1; //To make it visible >end; > >DataBuffer is a global TBytes container where the incoming data are >stuffed as >they arrive (it grows during the session). >You see that the buffer contains the complete log history from the >start... > >I have noticed that after a while the display becomes very sluggish >when data >arrives and I think that is due to the way the component operates. > >Now I wonder if there is some way to do as I did when I worked in >Delphi with >TListView objects, where I could use the BeginUpdate and EndUpdate >calls to make >all screen updates wait until it was all put in place. >This was MUCH faster! > >But I can not find a BeginUpdate on the TListBox object, only >BeginUpdateBounds, >which does not tell me much.... > >Any suggestions? > > >-- >Bo Berglund >Developer in Sweden > >-- >_______________________________________________ >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 aruna.hewapathirane at gmail.com Thu Nov 24 12:53:58 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 24 Nov 2022 06:53:58 -0500 Subject: [Lazarus] Lazarus IDE 'testall' program Message-ID: Hello Everyone, I recently came across this in the Free Pascal and Lazarus Wiki. "Try running the 'testall' program to see a menu of the available > components together with > small example test forms for most of them; then inspect the code to find > out how they work!" > The testall.lpi works fine under Windows but not so well under Linux. I got multiple errors in Linux (Debian). I asked for help on the Lazarus Forum and the conversation history is here . I wanted to make things work under Linux and thought let me clone the git repo and see what I may be able to do. I found one repository on Gitlab: https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/examples And another repository on Sourceforge: https://sourceforge.net/p/lazarus/laz.git/ci/main/tree/examples/ And now comes the interesting part, neither repository has a file called "testall" which was very confusing to me. So I checked and then double-checked under the examples folder in both repositories and found nothing again. Does anyone know why "testall" is not there in both Lazarus repositories? And where is the repo that contains "testall" please? And which repo do I use when I want to submit a patch or fix? Thanks - Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Thu Nov 24 13:16:18 2022 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 24 Nov 2022 13:16:18 +0100 Subject: [Lazarus] Lazarus IDE 'testall' program In-Reply-To: References: Message-ID: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> On 24/11/2022 12:53, Aruna Hewapathirane via lazarus wrote: > > I found one repository on Gitlab: > https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/examples > > > And another repository on Sourceforge: > https://sourceforge.net/p/lazarus/laz.git/ci/main/tree/examples/ > The correct repo is the one on Gitlab. The sourceforge is a mirror (run by the team). There also is a mirror on Github. > > And now comes the interesting part, neither repository has a file > called "testall" which was very confusing to me. > So I checked and then double-checked under the examples folder in both > repositories and found nothing again. > > Does anyone know why "testall" is not there in both Lazarus > repositories? And where is the repo that contains > "testall" please? And which repo do I use when I want to submit a > patch or fix? > The "testall" exists in the "fixes_2_2" branch. (Which is used for current releases). In the "main" branch the example folder was re-ordered. During this process the "testall" appears to have been removed. Not sure of the reasons... Maybe oversight, maybe because it did not work. If the latter, then likely a working version can be re-added. I did sent a query to the person behind the change, hopefully he can shine some light on this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aruna.hewapathirane at gmail.com Thu Nov 24 14:00:13 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 24 Nov 2022 08:00:13 -0500 Subject: [Lazarus] Lazarus IDE 'testall' program In-Reply-To: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> References: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> Message-ID: On Thu, Nov 24, 2022 at 7:16 AM Martin Frb via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On 24/11/2022 12:53, Aruna Hewapathirane via lazarus wrote: > > > I found one repository on Gitlab: > https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/examples > > And another repository on Sourceforge: > https://sourceforge.net/p/lazarus/laz.git/ci/main/tree/examples/ > > > The correct repo is the one on Gitlab. The sourceforge is a mirror (run by > the team). There also is a mirror on Github. > Ah... thank you for the clarification. So any fix'es I have to push to Gitlab then? > > > And now comes the interesting part, neither repository has a file called > "testall" which was very confusing to me. > So I checked and then double-checked under the examples folder in both > repositories and found nothing again. > > Does anyone know why "testall" is not there in both Lazarus repositories? > And where is the repo that contains > "testall" please? And which repo do I use when I want to submit a patch or > fix? > > > The "testall" exists in the "fixes_2_2" branch. (Which is used for current > releases). > Thank you again I just checked out fixes_2_2 branch and yes "testall" and other friends are all there :_) > > In the "main" branch the example folder was re-ordered. During this > process the "testall" appears to have been removed. Not sure of the > reasons... > Oh-kay that explains why I was unable to find it and am sure the reasons were all good and valid :-) Maybe oversight, maybe because it did not work. If the latter, then likely > a working version can be re-added. > Umm... well "testall" works on Windows I had zero issues but needs a few fixes when running under Linux. I have manged to get it to work on my Debian system now. > I did sent a query to the person behind the change, hopefully he can shine > some light on this. > Thank you for following up and I just want to say the 'documentation' is of a quality I have never seen anywhere before. Extremely thorough and to the point so if someone removed "testall" I am sure there were valid reasons. It just 'spooked' me when I simply could not find it in the repo. I never thought to look in other branches.... Much obliged for clearing this up Martin. Thank you! Aruna > > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Thu Nov 24 14:34:23 2022 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 24 Nov 2022 14:34:23 +0100 Subject: [Lazarus] Lazarus IDE 'testall' program In-Reply-To: References: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> Message-ID: On 24/11/2022 14:00, Aruna Hewapathirane wrote: > On Thu, Nov 24, 2022 at 7:16 AM Martin Frb via lazarus > wrote: > > On 24/11/2022 12:53, Aruna Hewapathirane via lazarus wrote: >> >> I found one repository on Gitlab: >> https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/examples >> >> >> And another repository on Sourceforge: >> https://sourceforge.net/p/lazarus/laz.git/ci/main/tree/examples/ >> > > The correct repo is the one on Gitlab. The sourceforge is a mirror > (run by the team). There also is a mirror on Github. > > > Ah...? thank you for the clarification. So any fix'es I have to push > to Gitlab then? - Ideally as a "merge request" on Gitlab. (Fork, push to your fork, create merge-request) - However Patches are accepted too. - And some developers may accept pull requests (in which case your fork can be on any public accessible git). ? "some developers" => That is, if you interactively deal with a member of the team, who told you they would be the one to accept your changes. Any change should ideally be against the "main" branch. So in this case, that would be reintroducing the files. If you plan any "larger" work, best to query (as actually - by coincidence - you do in this mail) if it would be accepted (or what implementation requirements their might be). Ideally you will get response from some developer, who confirms that they will accept and merge/apply your changes. > > In the "main" branch the example folder was re-ordered. During > this process the "testall" appears to have been removed. Not sure > of the reasons... > > Oh-kay that explains why I was unable to find it and am sure the > reasons were all good and valid :-) > > Maybe oversight, maybe because it did not work. If the latter, > then likely a working version can be re-added. > > > Umm... well "testall" works on Windows I had zero issues but needs a > few fixes when running under Linux. I have manged to get it to > work on my Debian system now. If you plan to work on it, I would suggest to wait a day or two, for further details on this to emerge. If it was removed because it did not work cross platform, then re-adding after fixing should be ok. Maybe there were other reasons. Maybe it would be better to break it into a small number of projects, each dealing with a subset of the components. A "all in one" might make it very hard to read and understand the code for a specific component. If you look at the examples (and the IDE menu Tools > "Example projects" (in Lazarus 2.3), then you will find that many components have there own examples already. Repeating them, may not make much sense (unless for example to have all buttons in one project, with settings/code explicitly showing their differences). Of course, depending on the course of action, the wiki may need updates (it still is correct for the current release, but it wont be for 2.4 / and it might easily be overlooked when the time comes) -------------- next part -------------- An HTML attachment was scrubbed... URL: From juha.manninen62 at gmail.com Thu Nov 24 18:53:28 2022 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 24 Nov 2022 19:53:28 +0200 Subject: [Lazarus] Lazarus IDE 'testall' program In-Reply-To: References: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> Message-ID: On Thu, Nov 24, 2022 at 3:00 PM Aruna Hewapathirane via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On Thu, Nov 24, 2022 at 7:16 AM Martin Frb via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> In the "main" branch the example folder was re-ordered. During this >> process the "testall" appears to have been removed. Not sure of the >> reasons... >> > > Oh-kay that explains why I was unable to find it and am sure the reasons > were all good and valid :-) > There may be a valid reason or there may be a mistake. Let's see. I committed to changes to example project management made by David Bannon. I did not notice the removal of "testall". I sent a message to David. We will figure it out. Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From aruna.hewapathirane at gmail.com Thu Nov 24 20:20:10 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 24 Nov 2022 14:20:10 -0500 Subject: [Lazarus] Lazarus IDE 'testall' program In-Reply-To: References: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> Message-ID: > Ah... thank you for the clarification. So any fix'es I have to push to > Gitlab then? > > > - Ideally as a "merge request" on Gitlab. (Fork, push to your fork, create > merge-request) > - However Patches are accepted too. > - And some developers may accept pull requests (in which case your fork > can be on any public accessible git). > "some developers" => That is, if you interactively deal with a member of > the team, who told you they would be the one to accept your changes. > Sounds good to me. > > Any change should ideally be against the "main" branch. > So in this case, that would be reintroducing the files. > Understood! > > If you plan any "larger" work, best to query (as actually - by coincidence > - you do in this mail) if it would be accepted (or what implementation > requirements their might be). > Ideally you will get response from some developer, who confirms that they > will accept and merge/apply your changes. > Let's just say every time I use the Lazarus IDE or FPC or whenever I go through the documentation the more humbled I become and I think about the amount of time+thought and work that has gone into this the more I start to feel the need to be part of this and contribute within my limited skill sets. So yes the plan is to first teach myself how things work then get myself comfortable with doing Voodoo magic like ASerge did in the Lazarus forum when I asked a noob question. This is worth having a look at actually: Voodoo Magic by ASerge look for Reply #1, please. Hopefully, someday I will actually understand what ASerge did. > > >> In the "main" branch the example folder was re-ordered. During this >> process the "testall" appears to have been removed. Not sure of the >> reasons... >> > > Oh-kay that explains why I was unable to find it and am sure the reasons > were all good and valid :-) > > Maybe oversight, maybe because it did not work. If the latter, then likely >> a working version can be re-added. >> > > Umm... well "testall" works on Windows I had zero issues but needs a few > fixes when running under Linux. I have manged to get it to > work on my Debian system now. > > If you plan to work on it, I would suggest to wait a day or two, for > further details on this to emerge. > If it was removed because it did not work cross platform, then re-adding > after fixing should be ok. > I just have to find a way to test in code if we are running on Windows or Linux then change the 'path' accordingly;y and we are good to go. That was one of the reasons "testall" did not work on Linux. > > Maybe there were other reasons. Maybe it would be better to break it into > a small number of projects, each dealing with a subset of the components. > A "all in one" might make it very hard to read and understand the code for > a specific component. > This is very true. I went through the "testall" code and it took me quite a while and a lot of asking around on the forum and irc and doing my own research to begin to start to understand what is going on :-) It is definitely not something a beginner/noob will understand or have fun trying to analyze why things are working when there is zilch in the Form. It's good for folks coming in with 'experience' and who have years of some type of coding background then they will appreciate the possibilities and freedom and the power of Lazarus+Free Pascal but to a total newbie, this is throwing him/her in the deep end of the pool with no life jacket :-) When one does not understand what has been done or why a piece of code works the way it does it can soon lead to frustration which in turn usually turns folks away and we lose good people who may have turned out to be very competent and capable programmers or analysts or simply people who could have contributed to the code and make things better? It would be a very different story if the source to "testall" was "heavily" commented at each line then life becomes easier. This is my personal opinion and thoughts and others may feel differently. When one is an experienced programmer sometimes we forget what is obvious to us in teh code may not necessarily be so to a newbie? That is why commenting the code helps. Again my thoughts alone. One of the primary reasons I love Lazarus and FPC is the community support. It is usually very fast/rapid and usually comes with a concrete-tested sample of code. I have never experienced this in other coding communities so this is a very welcome and long prayed-for and wished-for thing. It empowers you and makes you want to be part of the larger project in any small way. > > If you look at the examples (and the IDE menu Tools > "Example projects" > (in Lazarus 2.3), then you will find that many components have there own > examples already. > Repeating them, may not make much sense (unless for example to have all > buttons in one project, with settings/code explicitly showing their > differences). > I have actually started building my own set of demos. A side effect of trying to learn and teach myself Lazarus+FPC if anyone wants to have a look I would be happy to share. Who knows, some of them may actually be useful. > > Of course, depending on the course of action, the wiki may need updates > (it still is correct for the current release, but it wont be for 2.4 / and > it might easily be overlooked when the time comes) > Understood again and thank you very much for your time and help Martin. Talk again soon, Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From aruna.hewapathirane at gmail.com Thu Nov 24 20:27:56 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Thu, 24 Nov 2022 14:27:56 -0500 Subject: [Lazarus] Lazarus IDE 'testall' program In-Reply-To: References: <8431578d-70c1-7b56-229a-dd42797be915@mfriebe.de> Message-ID: On Thu, Nov 24, 2022 at 12:53 PM Juha Manninen via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On Thu, Nov 24, 2022 at 3:00 PM Aruna Hewapathirane via lazarus < > lazarus at lists.lazarus-ide.org> wrote: > >> On Thu, Nov 24, 2022 at 7:16 AM Martin Frb via lazarus < >> lazarus at lists.lazarus-ide.org> wrote: >> >>> In the "main" branch the example folder was re-ordered. During this >>> process the "testall" appears to have been removed. Not sure of the >>> reasons... >>> >> >> Oh-kay that explains why I was unable to find it and am sure the reasons >> were all good and valid :-) >> > > There may be a valid reason or there may be a mistake. Let's see. > Well sometimes these things happen for a reason. Gives people like me a chance to get involved :-) I committed to changes to example project management made by David Bannon. > I did not notice the removal of "testall". I sent a message to David. We > will figure it out. > Hi Juha, it is not just "testall" that was removed there are other files you may want to consider adding back. Here is a file-list of what was originally under the Examples folder. The files are at the bottom the folders at the top. > > Regards, > Juha > > -- > _______________________________________________ > 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 giuliano.colla at fastwebnet.it Fri Nov 25 19:29:15 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Fri, 25 Nov 2022 19:29:15 +0100 Subject: [Lazarus] Install of Qt5 widgetset fails on Mac Ventura Message-ID: I tried to install QT5 version 5.6.2 on my Mac, following the wiki instructions but installation fails. qmake executes properly and generates a Makefile, but make fails with this error message: ?ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Qt5Pas.framework/Qt5Pas] Error 1 Actally all the object files generated in the tmp directory are for arm64 and not x86_64-darwin as expected. Any hint? Thanks. Giuliano From zeljko at holobit.hr Fri Nov 25 21:58:48 2022 From: zeljko at holobit.hr (zeljko) Date: Fri, 25 Nov 2022 21:58:48 +0100 Subject: [Lazarus] Install of Qt5 widgetset fails on Mac Ventura In-Reply-To: References: Message-ID: On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote: > I tried to install QT5 version 5.6.2 on my Mac, following the wiki > instructions but installation fails. > > qmake executes properly and generates a Makefile, but make fails with > this error message: > > ?ld: symbol(s) not found for architecture arm64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > make: *** [Qt5Pas.framework/Qt5Pas] Error 1 > > Actally all the object files generated in the tmp directory are for > arm64 and not x86_64-darwin as expected. > > Any hint? Never tried build on arm64 (have intel macbook pro). Can you try with Qt6 ? z. From giuliano.colla at fastwebnet.it Fri Nov 25 23:01:27 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Fri, 25 Nov 2022 23:01:27 +0100 Subject: [Lazarus] Install of Qt5 widgetset fails on Mac Ventura In-Reply-To: References: Message-ID: <37b2761f-4782-0c9a-2ecb-5258d8f9622c@fastwebnet.it> Il 25/11/2022 21:58, zeljko ha scritto: > > > On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote: >> I tried to install QT5 version 5.6.2 on my Mac, following the wiki >> instructions but installation fails. >> >> qmake executes properly and generates a Makefile, but make fails with >> this error message: >> >> ??ld: symbol(s) not found for architecture arm64 >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> make: *** [Qt5Pas.framework/Qt5Pas] Error 1 >> >> Actally all the object files generated in the tmp directory are for >> arm64 and not x86_64-darwin as expected. >> >> Any hint? > > Never tried build on arm64 (have intel macbook pro). Can you try with > Qt6 ? > > z. I didn't find a place from where download open source Qt6. Do you have a reliable link? In the meantime I'll give a try with 5.6.11. However all Lazarus is compiled for x86_64 architecture, and runs in arm64 architecture via Rosetta. Intel version of Qt would be just fine, if qmake didn't decide to make for the arm64 architecture. Any idea of how to tell qmake the right architecture? Thanks, Giuliano -- Do not do to others as you would have them do to you.They might have different tastes. From zeljko at holobit.hr Sat Nov 26 09:20:12 2022 From: zeljko at holobit.hr (zeljko) Date: Sat, 26 Nov 2022 09:20:12 +0100 Subject: [Lazarus] ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura In-Reply-To: <37b2761f-4782-0c9a-2ecb-5258d8f9622c@fastwebnet.it> References: <37b2761f-4782-0c9a-2ecb-5258d8f9622c@fastwebnet.it> Message-ID: <191f9237-6a43-ea0b-e7ea-e53b12365f08@holobit.hr> On 25. 11. 2022. 23:01, Giuliano Colla wrote: > Il 25/11/2022 21:58, zeljko ha scritto: > >> >> >> On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote: >>> I tried to install QT5 version 5.6.2 on my Mac, following the wiki >>> instructions but installation fails. >>> >>> qmake executes properly and generates a Makefile, but make fails with >>> this error message: >>> >>> ??ld: symbol(s) not found for architecture arm64 >>> clang: error: linker command failed with exit code 1 (use -v to see >>> invocation) >>> make: *** [Qt5Pas.framework/Qt5Pas] Error 1 >>> >>> Actally all the object files generated in the tmp directory are for >>> arm64 and not x86_64-darwin as expected. >>> >>> Any hint? >> >> Never tried build on arm64 (have intel macbook pro). Can you try with >> Qt6 ? >> >> z. > I didn't find a place from where download open source Qt6. Do you have a > reliable link? https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg > > In the meantime I'll give a try with 5.6.11. > > However all Lazarus is compiled for x86_64 architecture, and runs in > arm64 architecture via Rosetta. Intel version of Qt would be just fine, > if qmake didn't decide to make for the arm64 architecture. Any idea of > how to tell qmake the right architecture? You have to read qmake manual: https://doc.qt.io/qt-6/qmake-manual.html zeljko From aruna.hewapathirane at gmail.com Sun Nov 27 02:24:09 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Sat, 26 Nov 2022 20:24:09 -0500 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] Message-ID: Hello Everyone, I am running Linux Debian and putting together a utility that displays my system information. I am trying to display data from a disk file in a TListView box and this part works. The data I am trying to display is the output from the lsblk command, I redirect the shell output to a disk file as shown below. lsblk > lsblk.txt ( in my case lsblk.ajh ) My problem is when the data from this file is displayed in the TListView there is a space/padding/margin between each displayed item which under normal circumstances would have been fine. But in this case, the output of the lsblk command has a tree on the very left and this is not contiguous which breaks the tree lines so I would like the displayed line/item to be sharing a common border so thereby touching and making the tree lines smooth and contiguous. As it is for my needs it is fine but if someday I decide to share the code then this has to be resolved. I realize a TListView may not be the correct or best component for this but I thought if there is a way to do this in a TListView why not? The displayed item height I am unable to change the through the object inspector or through code. Here is a screenshot which should be self-explanatory once you view the screenshot. The bottom left is a shell/terminal and the output is rendered the way I expected. The form on the top right you will notice has the tree lines separated by a space/padding/margin. Please look at the 'tree' lines then you will understand what my problem is. After asking for help on the Lazarus forum I twiddled with the font size and then it displayed the tree lines perfectly but I would like to know if there is a way to do this using a TListView without having to be stuck with a Monospace font and a specific font size? The forum question history is here. Thank you for reading all this and I look forward to any advice + guidance. Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From support at uvviewsoft.com Sun Nov 27 10:08:24 2022 From: support at uvviewsoft.com (Alexey Torgashin) Date: Sun, 27 Nov 2022 12:08:24 +0300 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] In-Reply-To: References: Message-ID: <18563079d3a1886dab3a2efeb5606247@uvviewsoft.com> This is a matter of a) chosen font in TMemo, b) interline spacing, which must be controlled but I don't know how to change it in TMemo (I know how to change it in ATSynEdit). Alex From support at uvviewsoft.com Sun Nov 27 10:20:18 2022 From: support at uvviewsoft.com (Alexey Torgashin) Date: Sun, 27 Nov 2022 12:20:18 +0300 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] In-Reply-To: References: Message-ID: <02df8fcbd52eb909199f222b22c1b0f4@uvviewsoft.com> Another answer. You use TListview, yes? It cannot change interline spacing! So avoid it. Change to TTreeView. It has a) prop DefaultItemHeight, b) Options item tvoAutoItemHeight (turn it off). Alex From wkitty42 at windstream.net Sun Nov 27 11:06:26 2022 From: wkitty42 at windstream.net (wkitty42 at windstream.net) Date: Sun, 27 Nov 2022 05:06:26 -0500 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] In-Reply-To: References: Message-ID: <19a44a09-bda2-962c-ddbc-ab9ba9d98ff0@windstream.net> On 11/26/22 8:24 PM, Aruna Hewapathirane via lazarus wrote: > After asking for help on the Lazarus forum? I twiddled with the font size and > then it displayed the tree lines perfectly but I would like to know if there is > a way to do this using a TListView without having to be stuck with a Monospace > font and a specific font size? no, there is not really any way to do this without using a monospace font... terminals are monospace by design... their resolutions are represented by the cols*rows of their characters... eg: 80*24, 80*43, 132*24, 132*43... each character is in a cell that has a fixed width and height... some common cell sizes are 9*12, 9*14, 9*16, 6*12... these are not pixels, though... pixels were not a thing when these were designed... they are basically dots in a raster cell... these cells are what are counted for terminal resolutions because each cell holds one character and terminals are character based, not pixel based... not only do you have the vertical spacing but also the horizontal... note in your image that your column spacing is off so that needs to be fixed, too... note how your proportional spacing image cannot properly align the columns of information... FSTYPE, FSVER, LABEL, UUID, FSAVAIL, FSUSE%, and MOUNTPOINT... if you are going to replicate the output of a terminal on a graphic canvas, monospace fonts are the best and easiest way... especially if you are going to easily deal with tabular output and column alignment... this because you don't have to do any extra work to get everything aligned properly... then there's the aesthetics... personally speaking, seeing, for example, the UUID column in proportional font would drive me bananananananananas... columnar/tabular data is meant to be displayed in a fixed width format... proportional fonts simply cannot properly do that... -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!* From aruna.hewapathirane at gmail.com Sun Nov 27 16:10:18 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Sun, 27 Nov 2022 10:10:18 -0500 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] In-Reply-To: <18563079d3a1886dab3a2efeb5606247@uvviewsoft.com> References: <18563079d3a1886dab3a2efeb5606247@uvviewsoft.com> Message-ID: On Sun, Nov 27, 2022 at 4:08 AM Alexey Torgashin via lazarus < lazarus at lists.lazarus-ide.org> wrote: > This is a matter of a) chosen font in TMemo, b) interline spacing, which > must be controlled but I don't know how to change it in TMemo (I know > how to change it in ATSynEdit). > Alex > -- > Thank you Alex. I have to read a lot more about TListView and friends. I also had no idea there is an interline spacing property many thanks for pointing that out. > _______________________________________________ > 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 aruna.hewapathirane at gmail.com Sun Nov 27 16:14:31 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Sun, 27 Nov 2022 10:14:31 -0500 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] In-Reply-To: <02df8fcbd52eb909199f222b22c1b0f4@uvviewsoft.com> References: <02df8fcbd52eb909199f222b22c1b0f4@uvviewsoft.com> Message-ID: On Sun, Nov 27, 2022 at 4:20 AM Alexey Torgashin via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Another answer. > You use TListview, yes? Yes I am using a TListView. > It cannot change interline spacing! So avoid it. > Alright understood and will comply. But it has two properties that we may be able to use to do what I am trying to do? lbOwnerDrawVariable and lbOwnerDrawFixed what do these mean? Anyone have any sample code please? > Change to TTreeView. It has a) prop DefaultItemHeight, b) Options item > tvoAutoItemHeight (turn it off). > I will look at TTreeView it is just that I like to keep things *simple* as I possibly can.. This is the reason I went with a TListView. Thank you Alex. Aruna -------------- next part -------------- An HTML attachment was scrubbed... URL: From aruna.hewapathirane at gmail.com Sun Nov 27 16:21:56 2022 From: aruna.hewapathirane at gmail.com (Aruna Hewapathirane) Date: Sun, 27 Nov 2022 10:21:56 -0500 Subject: [Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian] In-Reply-To: <19a44a09-bda2-962c-ddbc-ab9ba9d98ff0@windstream.net> References: <19a44a09-bda2-962c-ddbc-ab9ba9d98ff0@windstream.net> Message-ID: On Sun, Nov 27, 2022 at 5:06 AM wkitty42--- via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On 11/26/22 8:24 PM, Aruna Hewapathirane via lazarus wrote: > > After asking for help on the Lazarus forum I twiddled with the font > size and > > then it displayed the tree lines perfectly but I would like to know if > there is > > a way to do this using a TListView without having to be stuck with a > Monospace > > font and a specific font size? > > no, there is not really any way to do this without using a monospace > font... > terminals are monospace by design... their resolutions are represented by > the > cols*rows of their characters... eg: 80*24, 80*43, 132*24, 132*43... > Oh I miss those days... DOS and Clipper 5.3 and VGA monitors that had a maximum resolution of 640 x 480 px and tape drives. > > each character is in a cell that has a fixed width and height... some > common > cell sizes are 9*12, 9*14, 9*16, 6*12... these are not pixels, though... > pixels > were not a thing when these were designed... they are basically dots in a > raster > cell... these cells are what are counted for terminal resolutions because > each > cell holds one character and terminals are character based, not pixel > based... > You know I was just thinking with support like this you just cannot go wrong :-) > > not only do you have the vertical spacing but also the horizontal... note > in > your image that your column spacing is off so that needs to be fixed, > too... > note how your proportional spacing image cannot properly align the columns > of > information... FSTYPE, FSVER, LABEL, UUID, FSAVAIL, FSUSE%, and > MOUNTPOINT... > Yes, that was actually fixed when I started using the Monospace font. > > if you are going to replicate the output of a terminal on a graphic > canvas, > monospace fonts are the best and easiest way... especially if you are > going to > easily deal with tabular output and column alignment... this because you > don't > have to do any extra work to get everything aligned properly... > Very true and thank you I had to find this out the hard way :-) > > then there's the aesthetics... personally speaking, seeing, for example, > the > UUID column in proportional font would drive me bananananananananas... > columnar/tabular data is meant to be displayed in a fixed width format... > proportional fonts simply cannot properly do that... > Yes, very true and agreed. Thank you wkitty42. Aruna > > -- > 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 giuliano.colla at fastwebnet.it Sun Nov 27 23:47:25 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Sun, 27 Nov 2022 23:47:25 +0100 Subject: [Lazarus] ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura In-Reply-To: <191f9237-6a43-ea0b-e7ea-e53b12365f08@holobit.hr> References: <37b2761f-4782-0c9a-2ecb-5258d8f9622c@fastwebnet.it> <191f9237-6a43-ea0b-e7ea-e53b12365f08@holobit.hr> Message-ID: Il 26/11/22 09:20, zeljko ha scritto: > > > On 25. 11. 2022. 23:01, Giuliano Colla wrote: >> Il 25/11/2022 21:58, zeljko ha scritto: >> >>> >>> >>> On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote: >>>> I tried to install QT5 version 5.6.2 on my Mac, following the wiki >>>> instructions but installation fails. >>>> >>>> qmake executes properly and generates a Makefile, but make fails >>>> with this error message: >>>> >>>> ??ld: symbol(s) not found for architecture arm64 >>>> clang: error: linker command failed with exit code 1 (use -v to see >>>> invocation) >>>> make: *** [Qt5Pas.framework/Qt5Pas] Error 1 >>>> >>>> Actally all the object files generated in the tmp directory are for >>>> arm64 and not x86_64-darwin as expected. >>>> >>>> Any hint? >>> >>> Never tried build on arm64 (have intel macbook pro). Can you try >>> with Qt6 ? >>> >>> z. >> I didn't find a place from where download open source Qt6. Do you >> have a reliable link? > > https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg > > >> >> In the meantime I'll give a try with 5.6.11. >> >> However all Lazarus is compiled for x86_64 architecture, and runs in >> arm64 architecture via Rosetta. Intel version of Qt would be just >> fine, if qmake didn't decide to make for the arm64 architecture. Any >> idea of how to tell qmake the right architecture? > > You have to read qmake manual: > https://doc.qt.io/qt-6/qmake-manual.html > > zeljko Two issues: First issue is that it appears that you can't call qmake from command line. Either there's a bug somewhere on the Mac Ventura, or I'm missing some detail. I tried to build the Qt5Pas library by submitting Qt5Pas.pro to Qt Designer. It generated correct x86_64 objects, and the generated framework contains a: Qt5Pas: Mach-O 64-bit dynamically linked shared library x86_64 Just to understand what was going on, I then tried again with the command line options, passing qmake exactly the same parameters which Qt Designer used, and the result was the same error as before, with the tmp folder populated with arm64 object files. It would appear that qmake ignores the x86_64 switch when called from command line. If this is confirmed it would be good to update the wiki page. Second issue. Lazarus does not build with Qt. I have set the appropriate symlink in the /Library/Frameworks folder, but build of Lazarus fails with the error message: ld: framework not found Qt5Pas I have added /Library/Frameworks to the compiler paths (-FI/Library/Frameworks). Should I tell something to the linker too? Thanks for any hint. Giuliano From zeljko at holobit.hr Mon Nov 28 08:18:03 2022 From: zeljko at holobit.hr (zeljko) Date: Mon, 28 Nov 2022 08:18:03 +0100 Subject: [Lazarus] ***SPAM*** Re: ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura In-Reply-To: References: <37b2761f-4782-0c9a-2ecb-5258d8f9622c@fastwebnet.it> <191f9237-6a43-ea0b-e7ea-e53b12365f08@holobit.hr> Message-ID: <21e265f9-e833-b31d-97bd-fe130149833c@holobit.hr> On 27. 11. 2022. 23:47, Giuliano Colla wrote: > Il 26/11/22 09:20, zeljko ha scritto: > >> >> >> On 25. 11. 2022. 23:01, Giuliano Colla wrote: >>> Il 25/11/2022 21:58, zeljko ha scritto: >>> >>>> >>>> >>>> On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote: >>>>> I tried to install QT5 version 5.6.2 on my Mac, following the wiki >>>>> instructions but installation fails. >>>>> >>>>> qmake executes properly and generates a Makefile, but make fails >>>>> with this error message: >>>>> >>>>> ??ld: symbol(s) not found for architecture arm64 >>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>> invocation) >>>>> make: *** [Qt5Pas.framework/Qt5Pas] Error 1 >>>>> >>>>> Actally all the object files generated in the tmp directory are for >>>>> arm64 and not x86_64-darwin as expected. >>>>> >>>>> Any hint? >>>> >>>> Never tried build on arm64 (have intel macbook pro). Can you try >>>> with Qt6 ? >>>> >>>> z. >>> I didn't find a place from where download open source Qt6. Do you >>> have a reliable link? >> >> https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg >> >>> >>> In the meantime I'll give a try with 5.6.11. >>> >>> However all Lazarus is compiled for x86_64 architecture, and runs in >>> arm64 architecture via Rosetta. Intel version of Qt would be just >>> fine, if qmake didn't decide to make for the arm64 architecture. Any >>> idea of how to tell qmake the right architecture? >> >> You have to read qmake manual: >> https://doc.qt.io/qt-6/qmake-manual.html >> >> zeljko > > Two issues: > > First issue is that it appears that you can't call qmake from command line. > > Either there's a bug somewhere on the Mac Ventura, or I'm missing some > detail. I tried to build the Qt5Pas library by submitting Qt5Pas.pro to > Qt Designer. It generated correct x86_64 objects, and the generated > framework contains a: > > Qt5Pas: Mach-O 64-bit dynamically linked shared library x86_64 > > Just to understand what was going on, I then tried again with the > command line options, passing qmake exactly the same parameters which Qt > Designer used, and the result was the same error as before, with the tmp > folder populated with arm64 object files. It would appear that qmake > ignores the x86_64 switch when called from command line. If this is > confirmed it would be good to update the wiki page. > > Second issue. > > Lazarus does not build with Qt. I have set the appropriate symlink in > the /Library/Frameworks folder, but build of Lazarus fails with the > error message: > > ld: framework not found Qt5Pas > > I have added /Library/Frameworks to the compiler paths > (-FI/Library/Frameworks). Should I tell something to the linker too? 1. I had problem on intel mac when installed qt6.2 (qt5.15 was already installed) , but make clean and removing .qmake_stash and .qcmake_xx files manually from cbindings directory helped me a lot. So maybe you should remove such files and then start qmake-6 again (for arm). 2.On newer macs Library/Frameworks is not in path by default, I've found that symlinking Qt5Pas to Library/Frameworks and /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks fixed problem for make bigide. 3.You should add "-k -F/Library/Frameworks" to the configure "Build Lazarus" dialog if you want to rebuild lazarus for Qt5, or for your projects in Project Options check "Pass options with linker with "k" ...." -F/Library/Frameworks and then it should work zeljko From bo.berglund at gmail.com Mon Nov 28 11:31:30 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 28 Nov 2022 11:31:30 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? Message-ID: I haved a debugging tool program created on Windows and I am orting it to Linux Ubuntu. It seems to build just fine except for a combobox fill function which uses the Windows way of populating the selectoer box with the serial ports available on the system. This is the code I use on Windows: function THanSimulatorMain.ListSerialPorts(LS: TStrings): integer; var I:integer; {$ifdef MSWINDOWS} Reg:tregistry; {$endif} begin {$ifdef MSWINDOWS} //List available serial ports on Windows: Reg := TRegistry.Create; try Reg.RootKey := HKEY_LOCAL_MACHINE; if Reg.OpenKeyReadOnly('HARDWARE\DEVICEMAP\SERIALCOMM') then begin LS.Clear; Reg.GetValueNames(LS); for I := 0 to LS.Count - 1 do LS[i] := Reg.ReadString(LS[i]); end; Result := LS.Count; finally Reg.Free; end; {$endif} {$ifdef UNIX} //List available serial ports on Linux: //What do I put here? {$endif} end; I have looked at /dev/tty* but it lists a large number of items which makes it impossible for me. I do not belive all of?them are real serial ports... What can I do to get a selector for real serial ports on Ubuntu. -- Bo Berglund Developer in Sweden From christo.crause at gmail.com Mon Nov 28 11:50:55 2022 From: christo.crause at gmail.com (Christo Crause) Date: Mon, 28 Nov 2022 12:50:55 +0200 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: On Mon, Nov 28, 2022 at 12:31 PM Bo Berglund via lazarus < lazarus at lists.lazarus-ide.org> wrote: > > I have looked at /dev/tty* but it lists a large number of items which > makes it > impossible for me. I do not belive all of?them are real serial ports... > > What can I do to get a selector for real serial ports on Ubuntu. > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus Here is an example for POSIX type OSs: https://github.com/ccrause/LazScope/blob/master/gui/serialobject.pas#L299 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robin.listas at telefonica.net Mon Nov 28 12:00:17 2022 From: robin.listas at telefonica.net (Carlos E. R.) Date: Mon, 28 Nov 2022 12:00:17 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: <347a559b-9f94-c9d9-a1de-3c3371b2f869@telefonica.net> On 2022-11-28 11:31, Bo Berglund via lazarus wrote: > I haved a debugging tool program created on Windows and I am orting it to Linux > Ubuntu. > It seems to build just fine except for a combobox fill function which uses the > Windows way of populating the selectoer box with the serial ports available on > the system. ... > > I have looked at /dev/tty* but it lists a large number of items which makes it > impossible for me. I do not belive all of?them are real serial ports... I think they are /dev/ttyS*, but also /dev/ttyUSB* or /dev/ttyACM*, which is not all /dev/tty* :-D > > What can I do to get a selector for real serial ports on Ubuntu. Maybe (googled for "name of serial port in linux"): https://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/ What it says does not work in my machine (which has a true serial port) dmesg | grep tty because the log buffer has rotated out the boot section. But: Telcontar:~ # zgrep -i 'ttyS' /var/log/messages-20221126.xz <0.6> 2022-11-17T18:18:26.555284+01:00 Telcontar kernel - - - [ 1.072472] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A <0.6> 2022-11-19T11:58:45.529903+01:00 Telcontar kernel - - - [ 1.082125] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A Telcontar:~ # But that is too complicated for your code, it is rather for a user to do manually. This other method works: Telcontar:~ # setserial -g /dev/ttyS[0123] /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 Telcontar:~ # But it doesn't find *any* serial port. Not USB based ones unless you tell it to check those. Maybe you better ask the user to name the port, and you test to find out if it is true. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar) -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 203 bytes Desc: OpenPGP digital signature URL: From giuliano.colla at fastwebnet.it Mon Nov 28 13:31:12 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Mon, 28 Nov 2022 13:31:12 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: Il 28/11/22 11:31, Bo Berglund via lazarus ha scritto: > I haved a debugging tool program created on Windows and I am orting it to Linux > Ubuntu. > It seems to build just fine except for a combobox fill function which uses the > Windows way of populating the selectoer box with the serial ports available on > the system. > This is the code I use on Windows: > > function THanSimulatorMain.ListSerialPorts(LS: TStrings): integer; > var > I:integer; > {$ifdef MSWINDOWS} > Reg:tregistry; > {$endif} > begin > {$ifdef MSWINDOWS} > //List available serial ports on Windows: > Reg := TRegistry.Create; > try > Reg.RootKey := HKEY_LOCAL_MACHINE; > if Reg.OpenKeyReadOnly('HARDWARE\DEVICEMAP\SERIALCOMM') then > begin > LS.Clear; > Reg.GetValueNames(LS); > for I := 0 to LS.Count - 1 do > LS[i] := Reg.ReadString(LS[i]); > end; > Result := LS.Count; > finally > Reg.Free; > end; > {$endif} > {$ifdef UNIX} > //List available serial ports on Linux: > //What do I put here? > {$endif} > end; > > I have looked at /dev/tty* but it lists a large number of items which makes it > impossible for me. I do not belive all of?them are real serial ports... > > What can I do to get a selector for real serial ports on Ubuntu. > > My solution has been to scan all possible port names, such as /dev/ttyS*, dev/ttyUSB*, /dev/ttyXR*, etc. and then attempt to open each one by using SerOpen (in Serial.pp from fpcsrc- add "Serial"? the Uses clause) If successful the port exists, and I add it to my list, if not, it doesn't exist. Sample code which displays the first valid serial port found and puts all the others in a drop-down list for the user to select: {$IFDEF MSWINDOWS} ? for PortNr := 1 to 9 do begin ??? PortName := 'COM' + IntToStr(PortNr); ??? PortHandle := SerOpen('\\.\'+PortName); ??? if PortHandle > 0 then begin ????? cbSelPort.Items.Add(PortName); ????? SerClose(PortHandle); ????? if cbSelPort.Text = '' then begin ??????? cbSelPort.Text:=PortName; ??????? PortSel.Caption:= PortName; ??????? end; ????? end; ??? end; {$ELSE} ? for PortNr := 0 to 9 do begin ??? PortName := '/dev/ttyS' + IntToStr(PortNr); ??? writeln('Trying ',PortName); ??? //PortHandle:= FpOpen(PortName, O_RDWR {or O_NOCTTY} or O_NDELAY); ??? PortHandle := SerOpen(PortName); ??? if PortHandle > 0 then begin ????? if cbSelPort.Text = '' then begin ??????? cbSelPort.Text:=PortName; ??????? PortSel.Caption:= PortName; ??????? end; ????? cbSelPort.Items.Add(PortName); ????? SerClose(PortHandle); ????? end; ??? end; ? for PortNr := 0 to 9 do begin ??? PortName := '/dev/ttyUSB' + IntToStr(PortNr); ??? //writeln('Trying ',PortName); ??? PortHandle := SerOpen(PortName); ??? if PortHandle > 0 then begin ????? if cbSelPort.Text = '' then begin ??????? cbSelPort.Text:=PortName; ??????? PortSel.Caption:= PortName; ??????? end; ????? cbSelPort.Items.Add(PortName); ????? SerClose(PortHandle); ????? end; ??? end; ? for PortNr := 0 to 9 do begin ??? PortName := '/dev/ttyXR' + IntToStr(PortNr); ??? //writeln('Trying ',PortName); ??? PortHandle := SerOpen(PortName); ??? if PortHandle > 0 then begin ????? if cbSelPort.Text = '' then begin ??????? cbSelPort.Text:=PortName; ??????? PortSel.Caption:= PortName; ??????? end; ????? cbSelPort.Items.Add(PortName); ????? SerClose(PortHandle); ????? end; ??? end; ? for PortNr := 0 to 9 do begin ??? PortName := '/dev/ttyACM' + IntToStr(PortNr); ??? //writeln('Trying ',PortName); ??? PortHandle := SerOpen(PortName); ??? if PortHandle > 0 then begin ????? if cbSelPort.Text = '' then begin ??????? cbSelPort.Text:=PortName; ??????? PortSel.Caption:= PortName; ??????? end; ????? cbSelPort.Items.Add(PortName); ????? SerClose(PortHandle); ????? end; ??? end; ? {$ifdef cpuarm} //Raspberry ? for PortNr := 0 to 9 do begin ??? PortName := '/dev/ttyAMA' + IntToStr(PortNr); ??? PortHandle := SerOpen(PortName); ??? if PortHandle > 0 then begin ????? if cbSelPort.Text = '' then begin ??????? cbSelPort.Text:=PortName; ??????? PortSel.Caption:= PortName; ??????? end; ????? cbSelPort.Items.Add(PortName); ????? SerClose(PortHandle); ????? end; ??? end; ? {$endif} {$ENDIF} Hope that it helps, Giuliano -- Do not do to others as you would have them do to you.They might have different tastes. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Mon Nov 28 14:08:46 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 28 Nov 2022 14:08:46 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? References: Message-ID: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> On Mon, 28 Nov 2022 13:31:12 +0100, Giuliano Colla via lazarus wrote: >Hope that it helps, Thanks, it does. I had thought of this but it looked like an overly complicated way given that the list of tty* ports using ls -l /dev/tty* on my system comprises no less than 98 hits.... So I am now limiting the program to use USB connected serial adapters USB0..USB3 and on start I populate the list of ports by checking that /dev/USBx eists where x is 0..3. After all this is the most common use nowadays with USB serial devices in connection with developing IoT devices. -- Bo Berglund Developer in Sweden From robin.listas at telefonica.net Mon Nov 28 14:44:27 2022 From: robin.listas at telefonica.net (Carlos E. R.) Date: Mon, 28 Nov 2022 14:44:27 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> References: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> Message-ID: On 2022-11-28 14:08, Bo Berglund via lazarus wrote: > On Mon, 28 Nov 2022 13:31:12 +0100, Giuliano Colla via lazarus > wrote: > >> Hope that it helps, > > Thanks, it does. > > I had thought of this but it looked like an overly complicated way given that > the list of tty* ports using ls -l /dev/tty* on my system comprises no less than > 98 hits.... Please see my post. It is not tty* -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar) -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 203 bytes Desc: OpenPGP digital signature URL: From giuliano.colla at fastwebnet.it Mon Nov 28 14:48:20 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Mon, 28 Nov 2022 14:48:20 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> References: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> Message-ID: Il 28/11/22 14:08, Bo Berglund via lazarus ha scritto: > On Mon, 28 Nov 2022 13:31:12 +0100, Giuliano Colla via lazarus > wrote: > >> Hope that it helps, > Thanks, it does. > > I had thought of this but it looked like an overly complicated way given that > the list of tty* ports using ls -l /dev/tty* on my system comprises no less than > 98 hits.... > > So I am now limiting the program to use USB connected serial adapters USB0..USB3 > and on start I populate the list of ports by checking that /dev/USBx eists where > x is 0..3. > > After all this is the most common use nowadays with USB serial devices in > connection with developing IoT devices. > > /dev/tty* is pretty much useless. It's there for historical reasons. /dev/ttyS* is the one for actual serial adapters, and, unless you override with a command line parameter on boot, it is limited to 0..3 in modern kernels. Giuliano -- Do not do to others as you would have them do to you.They might have different tastes. From bo.berglund at gmail.com Mon Nov 28 16:56:19 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 28 Nov 2022 16:56:19 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? References: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> Message-ID: On Mon, 28 Nov 2022 14:44:27 +0100, "Carlos E. R. via lazarus" wrote: >> I had thought of this but it looked like an overly complicated way given that >> the list of tty* ports using ls -l /dev/tty* on my system comprises no less than >> 98 hits.... > >Please see my post. It is not tty* OK, doing /dev/ttyS* reduces the hits to 32... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Mon Nov 28 16:58:11 2022 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 28 Nov 2022 16:58:11 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? References: <9bc9ohd1a8l8f9105051144ivkve18d7o3@4ax.com> Message-ID: On Mon, 28 Nov 2022 14:48:20 +0100, Giuliano Colla via lazarus wrote: >/dev/tty* is pretty much useless. It's there for historical reasons. >/dev/ttyS* is the one for actual serial adapters, and, unless you >override with a command line parameter on boot, it is limited to 0..3 in >modern kernels. > Here is what I get on Ubuntu 20.04.5 LTS: $ ll /dev/ttyS* crw-rw---- 1 root dialout 4, 64 2022-11-26 08:47 /dev/ttyS0 crw-rw---- 1 root dialout 4, 65 2022-11-26 08:47 /dev/ttyS1 crw-rw---- 1 root dialout 4, 74 2022-11-26 08:47 /dev/ttyS10 crw-rw---- 1 root dialout 4, 75 2022-11-26 08:47 /dev/ttyS11 crw-rw---- 1 root dialout 4, 76 2022-11-26 08:47 /dev/ttyS12 crw-rw---- 1 root dialout 4, 77 2022-11-26 08:47 /dev/ttyS13 crw-rw---- 1 root dialout 4, 78 2022-11-26 08:47 /dev/ttyS14 crw-rw---- 1 root dialout 4, 79 2022-11-26 08:47 /dev/ttyS15 crw-rw---- 1 root dialout 4, 80 2022-11-26 08:47 /dev/ttyS16 crw-rw---- 1 root dialout 4, 81 2022-11-26 08:47 /dev/ttyS17 crw-rw---- 1 root dialout 4, 82 2022-11-26 08:47 /dev/ttyS18 crw-rw---- 1 root dialout 4, 83 2022-11-26 08:47 /dev/ttyS19 crw-rw---- 1 root dialout 4, 66 2022-11-26 08:47 /dev/ttyS2 crw-rw---- 1 root dialout 4, 84 2022-11-26 08:47 /dev/ttyS20 crw-rw---- 1 root dialout 4, 85 2022-11-26 08:47 /dev/ttyS21 crw-rw---- 1 root dialout 4, 86 2022-11-26 08:47 /dev/ttyS22 crw-rw---- 1 root dialout 4, 87 2022-11-26 08:47 /dev/ttyS23 crw-rw---- 1 root dialout 4, 88 2022-11-26 08:47 /dev/ttyS24 crw-rw---- 1 root dialout 4, 89 2022-11-26 08:47 /dev/ttyS25 crw-rw---- 1 root dialout 4, 90 2022-11-26 08:47 /dev/ttyS26 crw-rw---- 1 root dialout 4, 91 2022-11-26 08:47 /dev/ttyS27 crw-rw---- 1 root dialout 4, 92 2022-11-26 08:47 /dev/ttyS28 crw-rw---- 1 root dialout 4, 93 2022-11-26 08:47 /dev/ttyS29 crw-rw---- 1 root dialout 4, 67 2022-11-26 08:47 /dev/ttyS3 crw-rw---- 1 root dialout 4, 94 2022-11-26 08:47 /dev/ttyS30 crw-rw---- 1 root dialout 4, 95 2022-11-26 08:47 /dev/ttyS31 crw-rw---- 1 root dialout 4, 68 2022-11-26 08:47 /dev/ttyS4 crw-rw---- 1 root dialout 4, 69 2022-11-26 08:47 /dev/ttyS5 crw-rw---- 1 root dialout 4, 70 2022-11-26 08:47 /dev/ttyS6 crw-rw---- 1 root dialout 4, 71 2022-11-26 08:47 /dev/ttyS7 crw-rw---- 1 root dialout 4, 72 2022-11-26 08:47 /dev/ttyS8 crw-rw---- 1 root dialout 4, 73 2022-11-26 08:47 /dev/ttyS9 32 in all... -- Bo Berglund Developer in Sweden From giuliano.colla at fastwebnet.it Mon Nov 28 17:29:00 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Mon, 28 Nov 2022 17:29:00 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: Inviato da iPhone > Il giorno 28 nov 2022, alle ore 17:00, Bo Berglund via lazarus ha scritto: > > ?On Mon, 28 Nov 2022 14:48:20 +0100, Giuliano Colla via lazarus > wrote: > >> /dev/tty* is pretty much useless. It's there for historical reasons. >> /dev/ttyS* is the one for actual serial adapters, and, unless you >> override with a command line parameter on boot, it is limited to 0..3 in >> modern kernels. >> > Here is what I get on Ubuntu 20.04.5 LTS: > > $ ll /dev/ttyS* > crw-rw---- 1 root dialout 4, 64 2022-11-26 08:47 /dev/ttyS0 > crw-rw---- 1 root dialout 4, 65 2022-11-26 08:47 /dev/ttyS1 > crw-rw---- 1 root dialout 4, 74 2022-11-26 08:47 /dev/ttyS10 > crw-rw---- 1 root dialout 4, 75 2022-11-26 08:47 /dev/ttyS11 > crw-rw---- 1 root dialout 4, 76 2022-11-26 08:47 /dev/ttyS12 > crw-rw---- 1 root dialout 4, 77 2022-11-26 08:47 /dev/ttyS13 > crw-rw---- 1 root dialout 4, 78 2022-11-26 08:47 /dev/ttyS14 > crw-rw---- 1 root dialout 4, 79 2022-11-26 08:47 /dev/ttyS15 > crw-rw---- 1 root dialout 4, 80 2022-11-26 08:47 /dev/ttyS16 > crw-rw---- 1 root dialout 4, 81 2022-11-26 08:47 /dev/ttyS17 > crw-rw---- 1 root dialout 4, 82 2022-11-26 08:47 /dev/ttyS18 > crw-rw---- 1 root dialout 4, 83 2022-11-26 08:47 /dev/ttyS19 > crw-rw---- 1 root dialout 4, 66 2022-11-26 08:47 /dev/ttyS2 > crw-rw---- 1 root dialout 4, 84 2022-11-26 08:47 /dev/ttyS20 > crw-rw---- 1 root dialout 4, 85 2022-11-26 08:47 /dev/ttyS21 > crw-rw---- 1 root dialout 4, 86 2022-11-26 08:47 /dev/ttyS22 > crw-rw---- 1 root dialout 4, 87 2022-11-26 08:47 /dev/ttyS23 > crw-rw---- 1 root dialout 4, 88 2022-11-26 08:47 /dev/ttyS24 > crw-rw---- 1 root dialout 4, 89 2022-11-26 08:47 /dev/ttyS25 > crw-rw---- 1 root dialout 4, 90 2022-11-26 08:47 /dev/ttyS26 > crw-rw---- 1 root dialout 4, 91 2022-11-26 08:47 /dev/ttyS27 > crw-rw---- 1 root dialout 4, 92 2022-11-26 08:47 /dev/ttyS28 > crw-rw---- 1 root dialout 4, 93 2022-11-26 08:47 /dev/ttyS29 > crw-rw---- 1 root dialout 4, 67 2022-11-26 08:47 /dev/ttyS3 > crw-rw---- 1 root dialout 4, 94 2022-11-26 08:47 /dev/ttyS30 > crw-rw---- 1 root dialout 4, 95 2022-11-26 08:47 /dev/ttyS31 > crw-rw---- 1 root dialout 4, 68 2022-11-26 08:47 /dev/ttyS4 > crw-rw---- 1 root dialout 4, 69 2022-11-26 08:47 /dev/ttyS5 > crw-rw---- 1 root dialout 4, 70 2022-11-26 08:47 /dev/ttyS6 > crw-rw---- 1 root dialout 4, 71 2022-11-26 08:47 /dev/ttyS7 > crw-rw---- 1 root dialout 4, 72 2022-11-26 08:47 /dev/ttyS8 > crw-rw---- 1 root dialout 4, 73 2022-11-26 08:47 /dev/ttyS9 > > 32 in all... > > -- > Bo Berglund > Developer in Sweden > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus Yes they?re there but they?re not enabled. If you search for ttyS* in the boot log you?ll see how many are probed for. Typically from ttyS0 to ttyS3. Maybe less, it depends on which ones are enabled in BIOS. I know because I had in a project an extra PCI board with four more ports, and I had to modify the boot parameters to have them properly initialized. Otherways they were completely non existing. Just a dummy entry in the /dev folder. From wsherman at gmail.com Mon Nov 28 18:20:44 2022 From: wsherman at gmail.com (Wayne Sherman) Date: Mon, 28 Nov 2022 09:20:44 -0800 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: > My solution has been to scan all possible port names, such > as /dev/ttyS*, dev/ttyUSB*, /dev/ttyXR*, etc. and then attempt > to open each one by using SerOpen (in Serial.pp from fpcsrc- add > "Serial" the Uses clause) If successful the port exists, and I add > it to my list, if not, it doesn't exist. If the port is in use (already open in another process), you will get a SerOpen error and incorrectly exclude that port. Some other ways to find Linux serial ports are discussed here: https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them From wkitty42 at windstream.net Tue Nov 29 11:52:04 2022 From: wkitty42 at windstream.net (wkitty42 at windstream.net) Date: Tue, 29 Nov 2022 05:52:04 -0500 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: On 11/28/22 5:31 AM, Bo Berglund via lazarus wrote: > I haved a debugging tool program created on Windows and I am orting it to Linux > Ubuntu. > It seems to build just fine except for a combobox fill function which uses the > Windows way of populating the selectoer box with the serial ports available on > the system. > This is the code I use on Windows: [...] > I have looked at /dev/tty* but it lists a large number of items which makes it > impossible for me. I do not belive all of?them are real serial ports... > > What can I do to get a selector for real serial ports on Ubuntu. would you believe you asked almost this very same question back in 2015, 2018, 2020, and here again in 2022 :) in Sep 2018, giuliano colla posted this procedure to you: procedure TForm1.btnScanPortClick(Sender: TObject); var PortNr: Integer; PortName: String; PortHandle: TSerialHandle; begin cbSelPort.Items.Clear; cbSelPort.Text:= ''; {$IFDEF MSWINDOWS} for PortNr := 1 to 9 do begin PortName := 'COM' + IntToStr(PortNr); PortHandle := SerOpen('\\.\'+PortName); if PortHandle > 0 then begin cbSelPort.Items.Add(PortName); SerClose(PortHandle); if cbSelPort.Text = '' then begin cbSelPort.Text:=PortName; PortSel.Caption:= PortName; end; end; end; {$ELSE} for PortNr := 0 to 9 do begin PortName := '/dev/ttyS' + IntToStr(PortNr); PortHandle := SerOpen(PortName); if PortHandle > 0 then begin if cbSelPort.Text = '' then begin cbSelPort.Text:=PortName; PortSel.Caption:= PortName; end; cbSelPort.Items.Add(PortName); SerClose(PortHandle); end; end; for PortNr := 0 to 9 do begin PortName := '/dev/ttyUSB' + IntToStr(PortNr); PortHandle := SerOpen(PortName); if PortHandle > 0 then begin if cbSelPort.Text = '' then begin cbSelPort.Text:=PortName; PortSel.Caption:= PortName; end; cbSelPort.Items.Add(PortName); SerClose(PortHandle); end; end; {$ENDIF} end; and in that same thread in Sep 2018, mark morgan lloyd posted this function to you: (* If there are no serial ports on the system then return NIL, otherwise a *) (* TStringList. *) (* *) (* This returns an object, it is the caller's (eventual) responsibility to free *) (* this. *) // FUNCTION EnumeratePorts: TStringList; (* On a Linux system with udev or similar the /dev directory will only contain *) (* devices which have been detected as being present. On an older system it *) (* will probably contain all possible devices so we need to restrict the list *) (* to what's reasonable; the user should still be able to enter a device name *) (* manually if necessary, e.g. where a machine with 2x standard ports plus a *) (* 2-port card insists that it's got ttyS0, ttyS1, ttyS45 and ttyS46. *) CONST countTtyS= 12; (* Main board plus an 8-port card *) countTtyUSB= 8; (* Four dual-port adapters *) countTtyI= 4; (* A single 4-port ISDN card. *) VAR searchRec: TSearchRec; counter: INTEGER; BEGIN RESULT:= TStringList.Create; RESULT.Sorted:= TRUE; counter:= countTtyS; IF FindFirst('/dev/ttyS*', faSysFile, searchRec) = 0 THEN REPEAT RESULT.Append('/dev/' + searchRec.Name); DEC(counter) UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0); FindClose(searchRec); counter:= countTtyUSB; IF FindFirst('/dev/ttyUSB*', faSysFile, searchRec) = 0 THEN REPEAT RESULT.Append('/dev/' + searchRec.Name); DEC(counter) UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0); FindClose(searchRec); counter:= countTtyI; IF FindFirst('/dev/ttyI*', faSysFile, searchRec) = 0 THEN REPEAT RESULT.Append('/dev/' + searchRec.Name); DEC(counter) UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0); FindClose(searchRec); IF Result.Count = 0 THEN FreeAndNil(RESULT) END { EnumeratePorts } ; in another thread back in Oct 2020, corpsman at web.de posted this function to you: Function GetSerialPortNames(): String; Var sl: TStringlist; Var Info: TSearchRec; hdl: THandle; b: Boolean; Begin sl := TStringlist.create; If FindFirst('/dev/tty*', faSysFile, Info) = 0 Then Begin Repeat b := true; Try hdl := FileOpen('/dev/' + info.Name, fmOpenReadWrite); If hdl = -1 Then Begin b := false; End; Except b := false; End; If hdl >= 0 Then Begin FileClose(hdl); End; If b Then Begin sl.Add('/dev/' + info.Name); End; Until FindNext(info) <> 0; End; FindClose(Info); result := sl.CommaText; sl.free; End; i love having mailing list history in my email reader! :) :) :) -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!* From giuliano.colla at fastwebnet.it Tue Nov 29 20:16:59 2022 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Tue, 29 Nov 2022 20:16:59 +0100 Subject: [Lazarus] How to list available serial orts on Ubuuntu? In-Reply-To: References: Message-ID: <385093c8-36d5-483e-1780-22803df0fd75@fastwebnet.it> Il 29/11/2022 11:52, wkitty42--- via lazarus ha scritto: > would you believe you asked almost this very same question back in > 2015, 2018, 2020, and here again in 2022 :) :-):-):-) -- Do not do to others as you would have them do to you.They might have different tastes. From michael at freepascal.org Wed Nov 30 14:35:24 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 30 Nov 2022 14:35:24 +0100 (CET) Subject: [Lazarus] Makefile issues Message-ID: Hello, The lazarus makefile has some dependency issues. make ide: > make ide make -C ide ide make[1]: Entering directory '/home/michael/projects/lazarus-tst/ide' /bin/mkdir -p ../units/x86_64-linux/gtk2 make -C ../tools svn2revisioninc OS_TARGET=linux CPU_TARGET=x86_64 OPT='' make[2]: Entering directory '/home/michael/projects/lazarus-tst/tools' Makefile:2956: warning: overriding recipe for target '.' Makefile:2954: warning: ignoring old recipe for target '.' /usr/local/bin/ppcx64 -gl -Fu. -Fu../components/lazutils/lib/x86_64-linux -Fu../lcl/units/x86_64-linux -Fu../lcl/units/x86_64-linux/nogui -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -FE. -FU. -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -dx86_64 svn2revisioninc.pas svn2revisioninc.pas(64,3) Fatal: Can't find unit FileUtil used by Svn2RevisionInc Fatal: Compilation aborted make[2]: *** [Makefile:2967: svn2revisioninc] Error 1 make[2]: Leaving directory '/home/michael/projects/lazarus-tst/tools' make[1]: *** [Makefile:5387: revisioninc] Error 2 make[1]: Leaving directory '/home/michael/projects/lazarus-tst/ide' make: *** [Makefile:3788: ide] Error 2 Based on the output of "make help", in an attempt to create svn2revisioninc I did: > make tools make -C tools make[1]: Entering directory '/home/michael/projects/lazarus-tst/tools' Makefile:2956: warning: overriding recipe for target '.' Makefile:2954: warning: ignoring old recipe for target '.' make --assume-new=lazres.pp lazres make[2]: Entering directory '/home/michael/projects/lazarus-tst/tools' Makefile:2956: warning: overriding recipe for target '.' Makefile:2954: warning: ignoring old recipe for target '.' /usr/local/bin/ppcx64 -gl -Fu. -Fu../components/lazutils/lib/x86_64-linux -Fu../lcl/units/x86_64-linux -Fu../lcl/units/x86_64-linux/nogui -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -FE. -FU. -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -dx86_64 lazres.pp lazres.pp(43,22) Fatal: Can't find unit LazLogger used by LazRes Fatal: Compilation aborted make[2]: *** [Makefile:2964: lazres] Error 1 make[2]: Leaving directory '/home/michael/projects/lazarus-tst/tools' make[1]: *** [Makefile:3394: all] Error 2 make[1]: Leaving directory '/home/michael/projects/lazarus-tst/tools' make: *** [Makefile:3784: tools] Error 2 Similar, > make basecomponents make -C components/buildintf make[1]: Entering directory '/home/michael/projects/lazarus-tst/components/buildintf' /bin/rm -f units/x86_64-linux/buildintf.ppu /bin/mkdir -p units/x86_64-linux /usr/local/bin/ppcx64 -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Fu../../packager/units/x86_64-linux -Fu../lazutils/lib/x86_64-linux -Fu. -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -FE. -FUunits/x86_64-linux -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -dx86_64 buildintf.pas Hint: (11030) Start of reading config file /home/michael/.fpc.cfg Hint: (11031) End of reading config file /home/michael/.fpc.cfg Free Pascal Compiler version 3.3.1 [2022/11/05] for x86_64 Copyright (c) 1993-2022 by Florian Klaempfl and others (1002) Target OS: Linux for x86-64 (3104) Compiling buildintf.pas (3104) Compiling baseideintf.pas /home/michael/projects/lazarus-tst/components/buildintf/baseideintf.pas(21,3) Fatal: (10022) Can't find unit LazUTF8 used by BaseIDEIntf fatal: (1018) Compilation aborted After some more failed attempts trying to compile "sub-targets", I gave up. Am I correct in my understanding that in fact only the "main" targets all, bigide, useride are supposed to work out of the box when you start from a fresh checkout ? Michael. From ganmax at narod.ru Wed Nov 30 15:09:43 2022 From: ganmax at narod.ru (Maxim Ganetsky) Date: Wed, 30 Nov 2022 17:09:43 +0300 Subject: [Lazarus] Makefile issues In-Reply-To: References: Message-ID: 30.11.2022 16:35, Michael Van Canneyt via lazarus ?????: > > Hello, > > The lazarus makefile has some dependency issues. I would recommend to run `make lazbuild` first and then try to proceed again with your commands. > make ide: > >> make ide > make -C ide ide > make[1]: Entering directory '/home/michael/projects/lazarus-tst/ide' > /bin/mkdir -p ../units/x86_64-linux/gtk2 > make -C ../tools svn2revisioninc OS_TARGET=linux CPU_TARGET=x86_64 OPT='' > make[2]: Entering directory '/home/michael/projects/lazarus-tst/tools' > Makefile:2956: warning: overriding recipe for target '.' > Makefile:2954: warning: ignoring old recipe for target '.' > /usr/local/bin/ppcx64 -gl -Fu. > -Fu../components/lazutils/lib/x86_64-linux -Fu../lcl/units/x86_64-linux > -Fu../lcl/units/x86_64-linux/nogui > -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -FE. -FU. -Cg > -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -Flinclude > -Fl/etc/ld.so.conf.d/*.conf -dx86_64 svn2revisioninc.pas > svn2revisioninc.pas(64,3) Fatal: Can't find unit FileUtil used by > Svn2RevisionInc > Fatal: Compilation aborted > make[2]: *** [Makefile:2967: svn2revisioninc] Error 1 > make[2]: Leaving directory '/home/michael/projects/lazarus-tst/tools' > make[1]: *** [Makefile:5387: revisioninc] Error 2 > make[1]: Leaving directory '/home/michael/projects/lazarus-tst/ide' > make: *** [Makefile:3788: ide] Error 2 > > Based on the output of "make help", in an attempt to create > svn2revisioninc I did: > >> make tools > make -C tools > make[1]: Entering directory '/home/michael/projects/lazarus-tst/tools' > Makefile:2956: warning: overriding recipe for target '.' > Makefile:2954: warning: ignoring old recipe for target '.' > make --assume-new=lazres.pp lazres > make[2]: Entering directory '/home/michael/projects/lazarus-tst/tools' > Makefile:2956: warning: overriding recipe for target '.' > Makefile:2954: warning: ignoring old recipe for target '.' > /usr/local/bin/ppcx64 -gl -Fu. > -Fu../components/lazutils/lib/x86_64-linux -Fu../lcl/units/x86_64-linux > -Fu../lcl/units/x86_64-linux/nogui > -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -FE. -FU. -Cg > -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -Flinclude > -Fl/etc/ld.so.conf.d/*.conf -dx86_64 lazres.pp > lazres.pp(43,22) Fatal: Can't find unit LazLogger used by LazRes > Fatal: Compilation aborted > make[2]: *** [Makefile:2964: lazres] Error 1 > make[2]: Leaving directory '/home/michael/projects/lazarus-tst/tools' > make[1]: *** [Makefile:3394: all] Error 2 > make[1]: Leaving directory '/home/michael/projects/lazarus-tst/tools' > make: *** [Makefile:3784: tools] Error 2 > > Similar, > >> make basecomponents > make -C components/buildintf > make[1]: Entering directory > '/home/michael/projects/lazarus-tst/components/buildintf' > /bin/rm -f units/x86_64-linux/buildintf.ppu > /bin/mkdir -p units/x86_64-linux > /usr/local/bin/ppcx64 -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq > -Fu../../packager/units/x86_64-linux -Fu../lazutils/lib/x86_64-linux > -Fu. -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -FE. > -FUunits/x86_64-linux -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -dx86_64 > buildintf.pas > Hint: (11030) Start of reading config file /home/michael/.fpc.cfg > Hint: (11031) End of reading config file /home/michael/.fpc.cfg > Free Pascal Compiler version 3.3.1 [2022/11/05] for x86_64 > Copyright (c) 1993-2022 by Florian Klaempfl and others > (1002) Target OS: Linux for x86-64 > (3104) Compiling buildintf.pas > (3104) Compiling baseideintf.pas > /home/michael/projects/lazarus-tst/components/buildintf/baseideintf.pas(21,3) Fatal: (10022) Can't find unit LazUTF8 used by BaseIDEIntf > fatal: (1018) Compilation aborted > > After some more failed attempts trying to compile "sub-targets", I gave up. > > Am I correct in my understanding that in fact only the "main" targets > all, bigide, useride > are supposed to work out of the box when you start from a fresh checkout ? > > Michael. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From michael at freepascal.org Wed Nov 30 15:43:17 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 30 Nov 2022 15:43:17 +0100 (CET) Subject: [Lazarus] Makefile issues In-Reply-To: References: Message-ID: On Wed, 30 Nov 2022, Maxim Ganetsky via lazarus wrote: > 30.11.2022 16:35, Michael Van Canneyt via lazarus ?????: >> >> Hello, >> >> The lazarus makefile has some dependency issues. > > I would recommend to run `make lazbuild` first and then try to proceed > again with your commands. Well, the whole idea of a makefile is that you can give any target and it will first build the dependencies for that target, to free the user of the burden to know or guess the dependencies. If target 'ide' depends on target 'lazbuild', it should say so in the dependencies of 'ide'. That said, I followed your suggestion, and then the error is: (1002) Target OS: Linux for x86-64 (3104) Compiling lazarus.pp /home/michael/projects/lazarus-tst/ide/lazarus.pp(57,3) Fatal: (10022) Can't find unit Interfaces used by Lazarus most likely, the LCL needs to be built first as well. In each case, for the moment I simply produced a full build using the 'make bigide' target. I then try to install the result. This installs the IDE. But I also (in fact, only) need the LCL units. So I did make -C lcl install But the 'make install' in the lcl dir also fails: /bin/install -c -m 644 units/x86_64-linux/alllclunits.ppu units/x86_64-linux/actnlist.ppu units/x86_64-linux/arrow.ppu units/x86_64-linux/avglvltree.ppu units/x86_64-linux/buttons.ppu units/x86_64-linux/calendar.ppu units/x86_64-linux/chart.ppu units/x86_64-linux/checklst.ppu units/x86_64-linux/clipbrd.ppu units/x86_64-linux/clistbox.ppu units/x86_64-linux/comctrls.ppu units/x86_64-linux/controls.ppu units/x86_64-linux/dbactns.ppu units/x86_64-linux/dbctrls.ppu units/x86_64-linux/dbgrids.ppu units/x86_64-linux/dialogs.ppu units/x86_64-linux/dynamicarray.ppu units/x86_64-linux/dynhasharray.ppu units/x86_64-linux/editbtn.ppu units/x86_64-linux/extctrls.ppu units/x86_64-linux/extdlgs.ppu units/x86_64-linux/extendedstrings.ppu units/x86_64-linux/extgraphics.ppu units/x86_64-linux/filectrl.ppu units/x86_64-linux/forms.ppu units/x86_64-linux/fpcadds.ppu units/x86_64-linux/graphics.ppu units/x86_64-linux/graphtype.ppu units/x86_64-linux/grids.ppu units/x86_64-linux/imglist.ppu units/x86_64- linux/inipropstorage.ppu units/x86_64-linux/interfacebase.ppu units/x86_64-linux/lazlinkedlist.ppu units/x86_64-linux/lclintf.ppu units/x86_64-linux/lclmemmanager.ppu units/x86_64-linux/lclproc.ppu units/x86_64-linux/lclrescache.ppu units/x86_64-linux/lclstrconsts.ppu units/x86_64-linux/lcltype.ppu units/x86_64-linux/lclunicodedata.ppu units/x86_64-linux/lconvencoding.ppu units/x86_64-linux/lmessages.ppu units/x86_64-linux/lresources.ppu units/x86_64-linux/maskedit.ppu units/x86_64-linux/menus.ppu units/x86_64-linux/pairsplitter.ppu units/x86_64-linux/popupnotifier.ppu units/x86_64-linux/postscriptprinter.ppu units/x86_64-linux/printers.ppu units/x86_64-linux/propertystorage.ppu units/x86_64-linux/spin.ppu units/x86_64-linux/stdactns.ppu units/x86_64-linux/stdctrls.ppu units/x86_64-linux/stringhashlist.ppu units/x86_64-linux/textstrings.ppu units/x86_64-linux/toolwin.ppu units/x86_64-linux/utrace.ppu units/x86_64-linux/xmlpropstorage.ppu /tmp/me/lib/lcl/units/x86_64-linux /bin/install: cannot stat 'units/x86_64-linux/avglvltree.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/chart.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/clistbox.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/dynamicarray.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/dynhasharray.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/extendedstrings.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/fpcadds.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/graphtype.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/lazlinkedlist.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/lconvencoding.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/stringhashlist.ppu': No such file or directory /bin/install: cannot stat 'units/x86_64-linux/textstrings.ppu': No such file or directory No wonder, these units are not in the lcl, but have been moved to components. I removed them from the implicit units listed in Makefile.fpc in the LCL dir and regenerated the makefile. Running make install then proceeds further: make -C interfaces install make[1]: Entering directory '/home/michael/projects/lazarus-tst/lcl/interfaces' make -C gtk2 all make[2]: Entering directory '/home/michael/projects/lazarus-tst/lcl/interfaces/gtk2' /bin/rm -f ../../units/x86_64-linux/gtk2/lcl.ppu \ ../../units/x86_64-linux/gtk2/lcl.o /usr/local/bin/ppcx64 -gl -dgtk2 -Sci -Fu../../units/x86_64-linux -Fu../../../packager/units/x86_64-linux -Fu../../../components/lazutils/lib/x86_64-linux -Fu.. -Fu. -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -Fi. -FE. -FU../../units/x86_64-linux/gtk2 -Cg -dx86_64 ../lcl.pas /bin/cp -f Makefile.compiled ../../units/x86_64-linux/gtk2/LCL.compiled make[2]: Leaving directory '/home/michael/projects/lazarus-tst/lcl/interfaces/gtk2' make -C gtk2 install make[2]: Entering directory '/home/michael/projects/lazarus-tst/lcl/interfaces/gtk2' /bin/rm -f ../../units/x86_64-linux/gtk2/lcl.ppu \ ../../units/x86_64-linux/gtk2/lcl.o /usr/local/bin/ppcx64 -gl -dgtk2 -Sci -Fu../../units/x86_64-linux -Fu../../../packager/units/x86_64-linux -Fu../../../components/lazutils/lib/x86_64-linux -Fu.. -Fu. -Fu/usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl -Fi. -FE. -FU../../units/x86_64-linux/gtk2 -Cg -dx86_64 ../lcl.pas /bin/cp -f Makefile.compiled ../../units/x86_64-linux/gtk2/LCL.compiled /bin/install -m 755 -d /tmp/me/lib/lazarus/lcl/units/x86_64-linux /bin/install -c -m 644 ../../units/x86_64-linux/gtk2/lcl.pas.ppu /tmp/me/lib/lazarus/lcl/units/x86_64-linux /bin/install: cannot stat '../../units/x86_64-linux/gtk2/lcl.pas.ppu': No such file or directory Trying to install something which has been explicitly removed 4 commands prior to the install command : no surprise this fails... :-) After that I have given up and did a find -name '*.ppu' -exec cp {} /tmp/me/lib/lazarus/lcl/units/x86_64-linux \; find -name '*.o' -exec cp {} /tmp/me/lib/lazarus/lcl/units/x86_64-linux \; In short: the makefiles are in dire need of some care :-) ( before anyone recommends it: using lazbuild to build our software is not an option, since the sources are not installed on the machines where builds must be done. ) Michael.