From tony at stonemail.us Fri Nov 1 01:15:01 2024 From: tony at stonemail.us (Tony Stone) Date: Thu, 31 Oct 2024 20:15:01 -0400 Subject: [Lazarus] lazarus Digest, Vol 201, Issue 10 In-Reply-To: References: Message-ID: Not sure if i am using this mailing list properly but I want to share my modified mouseandkeyinput package with the user who was having issues.? It can be found here and I did make some "improvements" and maybe it will be helpful to you. https://github.com/TonyStone31/lmakiproject1 I have been using it in my password manager to automate fillign out forms and it works pretty good so far on windows and linux.? I am unable to work on any MacOS system. On 10/27/24 6:33 PM, lazarus-request at lists.lazarus-ide.org wrote: > Send lazarus mailing list submissions to > lazarus at lists.lazarus-ide.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.lazarus-ide.org/listinfo/lazarus > or, via email, send a message with subject or body 'help' to > lazarus-request at lists.lazarus-ide.org > > You can reach the person managing the list at > lazarus-owner at lists.lazarus-ide.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of lazarus digest..." > > > Today's Topics: > > 1. Using PasLibVLC to play video files - how to update duration? > (Bo Berglund) > 2. Re: Using PasLibVLC to play video files - how to update > duration? (Bo Berglund) > 3. automated testing code (duilio foschi) > 4. Re: Lazarus Release Candidate 1 of 4.0 (n7800) > 5. Re: automated testing code (Mattias Gaertner) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 27 Oct 2024 14:51:04 +0100 > From: Bo Berglund > To: lazarus at lists.lazarus-ide.org > Subject: [Lazarus] Using PasLibVLC to play video files - how to update > duration? > Message-ID: > Content-Type: text/plain; charset=us-ascii > > So several years ago I wrote a Video player/editor usng Lazarus/FPC with the > PasLibVLC library. ( https://prog.olsztyn.pl/paslibvlc/ ) > > The last build was done in end of 2023 with the then current > FPC/Lazarus/PasLibVLC (3.0.7). It was a cleanup to remove some un-needed fluff > on screen not related to the video handling. > > The utility has worked just fine for the video editing tasks it was created for. > > It works by playing a downloaded mp4 video file on screen where I can accurately > set cut points for section removals. Then it creates the call to a split-combine > command line utility I also wrote with Lazarus and built for both Windows and > Linux. > This utility uses ffmpeg in a command that results in a new video file where the > marked sections are removed. > > I usually work on files located on a Linux server but occationally I also run > the splitcombine on Windows. > > Recently I have found that if I want to use the editor just as a player it does > not work with mp4 to view files still being downloaded, so I tested by changing > my download script to produce a ts file rather than mp4. > > This file type can be opened and played while the download is still being done, > so the file is being written at the end and played somewhere inside. > > So far OK, but I have problems when doing jumps since the current version of my > editor reads the full length of the video at the time the video file is opened > and that stays put. This means that some positioning operations are not possible > if they target a time beyond the file length at the time the playback started. > > > Question: > --------- > How should I proceed to update the video length while playing it in the player? > > It affects both the length displayed on screen as well as the progress bar > showing where the current playback position is located. > > Should I set up a timer and use that to constantly read the video length (if it > is being updated by the library) and set the limits and visuals accordingly? > > Or is there some means of handling it using some internal callback, event or > similar? > > Unfortunately it was a while since I worked on the code so I will need some > start time to get re-familiarized.... > > From larrydalton71 at gmail.com Fri Nov 1 02:27:21 2024 From: larrydalton71 at gmail.com (Larry Dalton) Date: Thu, 31 Oct 2024 21:27:21 -0400 Subject: [Lazarus] Sqlite3 on Android In-Reply-To: <5d19a5c5-e9bb-4674-8784-cd308007c8b9@wanadoo.fr> References: <5d19a5c5-e9bb-4674-8784-cd308007c8b9@wanadoo.fr> Message-ID: I will let you know On Thu, Oct 31, 2024 at 17:59 Jean SUZINEAU via lazarus < lazarus at lists.lazarus-ide.org> wrote: > If you use LAMW, I think you can find the documents directory this way > (assuming var jF: jForm; ): > > DocumentsDirectory:= jF.GetEnvironmentDirectoryPath( dirDocuments); > > I would be curious if you can open the database this way. > > For my programs, due to to the various securities of Android, I needed > to use the java APIs of Android to acces my SQLite databases, i.e. the > jSqliteCursor and jSqliteDataAccess components of LAMW. > > > -- > _______________________________________________ > 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 alexander.hofmann at new-h.de Fri Nov 1 02:51:19 2024 From: alexander.hofmann at new-h.de (Alexander Hofmann) Date: Fri, 1 Nov 2024 10:51:19 +0900 Subject: [Lazarus] automated testing code In-Reply-To: References: <07d985d2-2519-4837-997d-39f2e880241f@netcologne.de> Message-ID: <660336e6-9b08-4275-97db-e47039324026@new-h.de> Hi, my two cents: Am 28.10.24 um 15:40 schrieb duilio foschi via lazarus: > In the instance, the weird text > /-5 07:36 28/10/2024507:36 28/10/2024 > is written. Inserting current date and time is a long-lasting feature of notepad (unchanged since at least Windows 2 :-)) - triggered by [F5] key (or the combination [Alt]-[E]-[D]). Maybe, for some reason, the wrong scancodes are sent to the Application or some modifiers are active? You may try things like https://www.nirsoft.net/utils/keyboard_state_view.html to find out.. Best regards, Alex From octopushole at gmail.com Fri Nov 1 17:43:10 2024 From: octopushole at gmail.com (duilio foschi) Date: Fri, 1 Nov 2024 17:43:10 +0100 Subject: [Lazarus] automated testing code In-Reply-To: <660336e6-9b08-4275-97db-e47039324026@new-h.de> References: <07d985d2-2519-4837-997d-39f2e880241f@netcologne.de> <660336e6-9b08-4275-97db-e47039324026@new-h.de> Message-ID: Hi Alex, I found a different code online that works ok. The tool you suggested is very interesting. Thank you Peppe On Fri, Nov 1, 2024 at 2:51?AM Alexander Hofmann via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Hi, > > my two cents: > > Am 28.10.24 um 15:40 schrieb duilio foschi via lazarus: > > In the instance, the weird text > > /-5 07:36 28/10/2024507:36 28/10/2024 > > is written. > > Inserting current date and time is a long-lasting feature of notepad > (unchanged since at least Windows 2 :-)) - triggered by [F5] key (or the > combination [Alt]-[E]-[D]). > > Maybe, for some reason, the wrong scancodes are sent to the Application > or some modifiers are active? > > You may try things like > https://www.nirsoft.net/utils/keyboard_state_view.html to find out.. > > > Best regards, > > Alex > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sat Nov 9 16:51:32 2024 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 09 Nov 2024 16:51:32 +0100 Subject: [Lazarus] Using PasLibVLC to play video files - how to update duration? References: <94tshjtkklkrtdtfql73fctjd937q51j0e@4ax.com> Message-ID: On Sun, 27 Oct 2024 18:18:20 +0100, Bo Berglund via lazarus wrote: >On Sun, 27 Oct 2024 14:51:04 +0100, Bo Berglund via lazarus > wrote: > >>Question: >>--------- >>How should I proceed to update the video length while playing it in the player? >> >>It affects both the length displayed on screen as well as the progress bar >>showing where the current playback position is located. >> >>Should I set up a timer and use that to constantly read the video length (if it >>is being updated by the library) and set the limits and visuals accordingly? >> >>Or is there some means of handling it using some internal callback, event or >>similar? >> >>Unfortunately it was a while since I worked on the code so I will need some >>start time to get re-familiarized.... >> > >UPDATE: >------- > >I tested with the VLC Video player (on which video handling functions PasLibVLC >relies) by opening a running download target file in ts format while it was >still being written. > >The VLC Video player read the video length upon starting and once it reached >playing to that time it just exited! >That is when the file at that time held a lot more content but past the original >ending timestamp... > >So I guess (before testing actual coding) that the VLC library will not supply >such a functionality as dynamically updating a ts file length... > So I got no reply on ths question... Can someone please suggest a better location for asking? Will the Lazarus Forum be better or else where can I get feedbacxk from trhose "in the know"? Meanwhile I have been trying to use KODI as a playback channel for the video being downloaded and that would in fact continue plaing across the video length at the start of playing. But it will not function correctly when doing skips back or forth whan you have played across the start length position... As I stated above the VLC Video Player does not handle a ts file which is growing in size when it plays it. When it reaches the initial length of the video it just quits even if the video at that time is much longer... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Nov 9 17:59:36 2024 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 09 Nov 2024 17:59:36 +0100 Subject: [Lazarus] How to see which Lazarus/Fpc version was used? Message-ID: I have a lot of FPC/Lazarus projects and it is getting confusing when I need to look at an older project for a bugfix or update because I am not sure which Lazarus/Fpc version was used the last time I worked on it... I don't want to try to port it onto a newer vertsion just for a bit of maintenance.... Is there some file in the project file hierarchy (or elsewhere) that can supply that information? The source dir is available and it is also in Subversion. -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Sat Nov 9 19:53:17 2024 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sat, 9 Nov 2024 19:53:17 +0100 Subject: [Lazarus] How to see which Lazarus/Fpc version was used? In-Reply-To: References: Message-ID: <61e79ea4-8c69-4a44-b1d9-c8c59f0fbcf4@netcologne.de> On 11/9/24 17:59, Bo Berglund via lazarus wrote: > I have a lot of FPC/Lazarus projects and it is getting confusing when I need to > look at an older project for a bugfix or update because I am not sure which > Lazarus/Fpc version was used the last time I worked on it... > I don't want to try to port it onto a newer vertsion just for a bit of > maintenance.... > > Is there some file in the project file hierarchy (or elsewhere) that can supply > that information? > > The source dir is available and it is also in Subversion. This could help find out the fpc version: The .compiled file contains the path of the compiler executable and its modification date. For example: Mattias From bo.berglund at gmail.com Sat Nov 9 21:28:50 2024 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 09 Nov 2024 21:28:50 +0100 Subject: [Lazarus] How to see which Lazarus/Fpc version was used? References: <61e79ea4-8c69-4a44-b1d9-c8c59f0fbcf4@netcologne.de> Message-ID: On Sat, 9 Nov 2024 19:53:17 +0100, Mattias Gaertner via lazarus wrote: > > >On 11/9/24 17:59, Bo Berglund via lazarus wrote: >> I have a lot of FPC/Lazarus projects and it is getting confusing when I need to >> look at an older project for a bugfix or update because I am not sure which >> Lazarus/Fpc version was used the last time I worked on it... >> I don't want to try to port it onto a newer vertsion just for a bit of >> maintenance.... >> >> Is there some file in the project file hierarchy (or elsewhere) that can supply >> that information? >> >> The source dir is available and it is also in Subversion. > >This could help find out the fpc version: > >The .compiled file contains the path of the compiler >executable and its modification date. >For example: > > >Mattias Thanks so very much! :) This is what I found: So now I know I need to fire up my 2.0.12 Lazarus! Hoefully I can deduce the location of the property I need to change. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Mon Nov 11 09:08:24 2024 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 11 Nov 2024 09:08:24 +0100 Subject: [Lazarus] Can LazVlc update the length of a file while playing? Message-ID: I have created a video player/editor based on PasLibVlc some 5-6 years ago and it works for the original purposes. This is on Windows 10. It was created to handle mp4 files, but it can open other video file formats as well, thanks to the VLC back-end. Now I have a new use which it cannot perform properly: In order to be able to view an Internet video stream when it is being downloaded using ffmpeg I could not use mp4 format since such a file is not playable until it has been closed by ffmpeg. At close ffmpeg writes crucial information to the file which allows playback. So I tested to set the ffmpeg output format to be a ts (transport stream) file which I want to view before the download ends. This type of file should be playable at all times. But if I open the file for viewing the PasLibVlc library reads the current length at that time into some internal property, which never changes... I.e. the length of the playing video is not increasing as the donwnload progresses. This means that only that part which was present at the time of opening the file for viewing will be available since the player exits when it reaches the percieved "end". I have tried adding a refresh function to my player but it does not work. And it does not even help to close and re-open the video file, somehow the information has been cached somewhere and the old length data reappears. The only way I have found to actually get a new length is to open a completely different video file and then re-open the original file, then the length updates... So it seems like there is some caching being done by VLC, which affects playing of the same file and giving the erroneous file length.... QUESTION: --------- So my question is if I would try to use the LazVlc package instead of PasLibVlc, is there a command to clear any cached VLC data so a re-opening of a file during recording will get the correct current length of it? Notice that the VLC Player itself behaves in the same way, open the ts file at some time and note the length, then close it, wait a bit and then re-open the file and the OLD length is again shown! So I cannot use that player either, I need to build my own viwer if the existing player/editor cannot be made to work for this scenario... -- Bo Berglund Developer in Sweden From marc at dommelstein.nl Tue Nov 12 20:58:02 2024 From: marc at dommelstein.nl (Marc Weustink) Date: Tue, 12 Nov 2024 20:58:02 +0100 Subject: [Lazarus] Can LazVlc update the length of a file while playing? In-Reply-To: References: Message-ID: <995DA3BB-3571-4F81-B761-2B9AFC09FC21@dommelstein.nl> Hi, Why using a file as intermediate transport and not some network stream. Vlc can play a rtsp or raw ts stream without problem. And what is the purpose of ffmpeg (iow can't it be done by vlc itself) Marc On November 11, 2024 9:08:24 AM GMT+01:00, Bo Berglund via lazarus wrote: >I have created a video player/editor based on PasLibVlc some 5-6 years ago and >it works for the original purposes. This is on Windows 10. It was created to >handle mp4 files, but it can open other video file formats as well, thanks to >the VLC back-end. > >Now I have a new use which it cannot perform properly: > >In order to be able to view an Internet video stream when it is being downloaded >using ffmpeg I could not use mp4 format since such a file is not playable until >it has been closed by ffmpeg. At close ffmpeg writes crucial information to the >file which allows playback. > >So I tested to set the ffmpeg output format to be a ts (transport stream) file >which I want to view before the download ends. This type of file should be >playable at all times. > >But if I open the file for viewing the PasLibVlc library reads the current >length at that time into some internal property, which never changes... > >I.e. the length of the playing video is not increasing as the donwnload >progresses. > >This means that only that part which was present at the time of opening the file >for viewing will be available since the player exits when it reaches the >percieved "end". > >I have tried adding a refresh function to my player but it does not work. > >And it does not even help to close and re-open the video file, somehow the >information has been cached somewhere and the old length data reappears. > >The only way I have found to actually get a new length is to open a completely >different video file and then re-open the original file, then the length >updates... > >So it seems like there is some caching being done by VLC, which affects playing >of the same file and giving the erroneous file length.... > >QUESTION: >--------- >So my question is if I would try to use the LazVlc package instead of PasLibVlc, >is there a command to clear any cached VLC data so a re-opening of a file during >recording will get the correct current length of it? > > >Notice that the VLC Player itself behaves in the same way, open the ts file at >some time and note the length, then close it, wait a bit and then re-open the >file and the OLD length is again shown! > >So I cannot use that player either, I need to build my own viwer if the existing >player/editor cannot be made to work for this scenario... > > From luca at wetron.es Wed Nov 13 08:47:48 2024 From: luca at wetron.es (Luca Olivetti) Date: Wed, 13 Nov 2024 08:47:48 +0100 Subject: [Lazarus] design forms bigger (or as big as) the screen? Message-ID: Hello, is there some trick to design a form that is bigger (or as big as) than the screen where I'm designing it? In the past I designed the form, say, 70% smaller than the desired size, then at runtime I resized it with ScaleBy, however - some components (or their fonts or the associated picture) aren't scaled correctly - now I have a form already designed at 1:1 scale for an 800x600 screen that I have to adapt to 1920x1080 (in this screen I have to use the added real estate, I cannot simply blow it up to the bigger size). I tried using a scrollbox but the scrollbars only work at runtime, not at design time. Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Wed Nov 13 08:49:07 2024 From: luca at wetron.es (Luca Olivetti) Date: Wed, 13 Nov 2024 08:49:07 +0100 Subject: [Lazarus] design forms bigger (or as big as) the screen? In-Reply-To: References: Message-ID: El 13/11/24 a les 8:47, Luca Olivetti via lazarus ha escrit: > Hello, > > is there some trick to design a form that is bigger (or as big as) than > the screen where I'm designing it? > > In the past I designed the form, say, 70% smaller than the desired size, I meant "70% of the desired size" > then at runtime I resized it with ScaleBy, however > > - some components (or their fonts or the associated picture) aren't > scaled correctly > - now I have a form already designed at 1:1 scale for an 800x600 screen > that I have to adapt to 1920x1080 > > (in this screen I have to use the added real estate, I cannot simply > blow it up to the bigger size). > > I tried using a scrollbox but the scrollbars only work at runtime, not > at design time. > > Bye -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From n7800 at inbox.ru Fri Nov 15 21:31:56 2024 From: n7800 at inbox.ru (=?UTF-8?B?bjc4MDA=?=) Date: Fri, 15 Nov 2024 23:31:56 +0300 Subject: [Lazarus] =?utf-8?q?design_forms_bigger_=28or_as_big_as=29_the_s?= =?utf-8?q?creen=3F?= In-Reply-To: References: Message-ID: <1731702716.198912236@f303.i.mail.ru> You can use a docked form editor - install the "DockedFormEditor" package accordingly. It allows you to scroll the form in the editor window. ? ? ? ? ? >?????, 13 ?????? 2024, 12:47 +05:00 ?? Luca Olivetti via lazarus : >? >Hello, > >is there some trick to design a form that is bigger (or as big as) than >the screen where I'm designing it? > >In the past I designed the form, say, 70% smaller than the desired size, >then at runtime I resized it with ScaleBy, however > >- some components (or their fonts or the associated picture) aren't >scaled correctly >- now I have a form already designed at 1:1 scale for an 800x600 screen >that I have to adapt to 1920x1080 > >(in this screen I have to use the added real estate, I cannot simply >blow it up to the bigger size). > >I tried using a scrollbox but the scrollbars only work at runtime, not >at design time. > >Bye >-- >Luca Olivetti >Wetron Automation Technology https://wetron.es/ >Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 > >-- >_______________________________________________ >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 luca at wetron.es Fri Nov 15 22:10:11 2024 From: luca at wetron.es (Luca Olivetti) Date: Fri, 15 Nov 2024 22:10:11 +0100 Subject: [Lazarus] design forms bigger (or as big as) the screen? In-Reply-To: <1731702716.198912236@f303.i.mail.ru> References: <1731702716.198912236@f303.i.mail.ru> Message-ID: <231976b3-797c-4599-8566-336cb889db28@wetron.es> El 15/11/24 a les 21:31, n7800 via lazarus ha escrit: > You can use a docked form editor - install the "DockedFormEditor" Thank you, I'll take a look, for the time being I'm using a different approach: I use (almost) the full width of the screen but not the full height, then at runtime I just resize the form, filling the extra space using the anchors of some components that can be resized vertically. Bye > package accordingly. It allows you to scroll the form in the editor window. > > ?????, 13 ?????? 2024, 12:47 +05:00 ?? Luca Olivetti via lazarus > : > Hello, > > is there some trick to design a form that is bigger (or as big as) than > the screen where I'm designing it? > > In the past I designed the form, say, 70% smaller than the desired size, > then at runtime I resized it with ScaleBy, however > > - some components (or their fonts or the associated picture) aren't > scaled correctly > - now I have a form already designed at 1:1 scale for an 800x600 screen > that I have to adapt to 1920x1080 > > (in this screen I have to use the added real estate, I cannot simply > blow it up to the bigger size). > > I tried using a scrollbox but the scrollbars only work at runtime, not > at design time. > > Bye > -- > Luca Olivetti > Wetron Automation Technology https://wetron.es/ > Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org To=lazarus at lists.lazarus%2dide.org> > https://lists.lazarus-ide.org/listinfo/lazarus lists.lazarus-ide.org/listinfo/lazarus> > > -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Sun Nov 17 18:54:36 2024 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 17 Nov 2024 18:54:36 +0100 (CET) Subject: [Lazarus] Docked IDE editor issue Message-ID: <36ad42b-8227-f1f-4aab-5afb6051cc47@freepascal.org> Hi, When designing a frame in the docked IDE (designer not docked), the right-click to get the context menu does not work. Linux mint, last week's Lazarus. Is this a known issue, or should I file an issue ? Michael. From the.tail.kinker at gmail.com Tue Nov 19 12:56:51 2024 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Tue, 19 Nov 2024 06:56:51 -0500 Subject: [Lazarus] Find exact cursor position in TMemo Message-ID: <6229dc1a-1f65-4b3e-99a5-c97dfcdc08f4@gmail.com> I'm using a TMemo as the base of a text editor, and the editor has to do some text replacement.? How do I get the exact insert position of the insertion point?? I used SelStart, but when the insertion point is too close to the end of the document, this becomes unreliable.? Here's my code. procedure TfrmEditor.txtEditorKeyPress(Sender: TObject; var Key: char); var ? CursorPos: Integer; ? TextLen : integer; ? TextBeforeCursor: string; begin ? TextLen := length (txtEditor.Text); ? if Key = '-' then ? begin ??? // Get the current cursor position ??? CursorPos := txtEditor.SelStart; ??? // Ensure there is enough text to analyze ??? if CursorPos >= 2 then ??? begin ????? // Get the last two characters before the dash ????? TextBeforeCursor := Copy(txtEditor.Text, CursorPos - 2, 2); ????? // Check if the last two characters are also dashes ????? if TextBeforeCursor = '--' then ????? begin ??????? // Remove the three dashes ??????? txtEditor.SelStart := CursorPos - 2; ??????? txtEditor.SelLength := 2; ??????? txtEditor.SelText := '\[em]'; ??????? // Cancel the current dash keypress ??????? Key := #0; ????? end; ??? end; ? end; end; TextLen is there only for debugging purposes. From jean.suzineau at wanadoo.fr Tue Nov 19 20:44:11 2024 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Tue, 19 Nov 2024 20:44:11 +0100 Subject: [Lazarus] Find exact cursor position in TMemo In-Reply-To: <6229dc1a-1f65-4b3e-99a5-c97dfcdc08f4@gmail.com> References: <6229dc1a-1f65-4b3e-99a5-c97dfcdc08f4@gmail.com> Message-ID: <9d0b0710-8d95-45d9-88fc-39f2f5a0eb1d@wanadoo.fr> I'm not sure, but I guess it would be easier with SynEdit , TSynEdit( and maybe TSynAutoComplete ?) : https://wiki.freepascal.org/SynEdit From the.tail.kinker at gmail.com Tue Nov 19 20:44:53 2024 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Tue, 19 Nov 2024 14:44:53 -0500 Subject: [Lazarus] Find exact cursor position in TMemo In-Reply-To: <9d0b0710-8d95-45d9-88fc-39f2f5a0eb1d@wanadoo.fr> References: <6229dc1a-1f65-4b3e-99a5-c97dfcdc08f4@gmail.com> <9d0b0710-8d95-45d9-88fc-39f2f5a0eb1d@wanadoo.fr> Message-ID: Perhaps, but SynEdit doesn't have soft wrap. On 2024-11-19 14:44, Jean SUZINEAU via lazarus wrote: > I'm not sure, but I guess it would be easier with SynEdit , TSynEdit( > and maybe TSynAutoComplete ?) : > > https://wiki.freepascal.org/SynEdit > From octopushole at gmail.com Tue Nov 19 21:25:20 2024 From: octopushole at gmail.com (duilio foschi) Date: Tue, 19 Nov 2024 21:25:20 +0100 Subject: [Lazarus] help with NNTP posting Message-ID: I cannot understand how I can post a message into a newsgroup using INet components. I can connect, authenticate, join a group and issue several commands like ARTICLE BODY HEAD XOVER However, when I try to post a message, my code always returns 500 (unknown command or wrong syntax). Any help? This is what I do (after connecting and authenticating): uses ...lNet, lclnet, lnetcomponents, LConvEncoding; var aStream:TMemoryStream; // correctly initialized elsewhere aclient:TLTCPComponent; // correctly initialized elsewhere procedure LineToStream(Buf : String); begin Buf := Buf + #13#10; aStream.WriteBuffer(Buf[1], Length(Buf)); end; procedure TfrmUReader.btnSendPostClick(Sender: TObject); var a:integer; begin aStream.Clear; LineToStream('POST'); LineToStream('"peppepolpo" '); LineToStream('Newsgroups: it.hobby.fai-da-te'); LineToStream('Subject: test 201937'); LineToStream('Organization: None'); LineToStream('X-Newsreader: DIY component '); { End of header is a blank line } LineToStream(''); { Write the message body } LineToStream(''); LineToStream('test 201937'); aStream.Seek(0, soFromBeginning ); a:=aclient.Send(aStream, aStream.Size); // a=500 here end; -------------- next part -------------- An HTML attachment was scrubbed... URL: From alb42 at web.de Wed Nov 20 08:34:53 2024 From: alb42 at web.de (Marcus Sackrow) Date: Wed, 20 Nov 2024 08:34:53 +0100 Subject: [Lazarus] help with NNTP posting In-Reply-To: References: Message-ID: Hi, Am 19.11.2024 um 21:25 schrieb duilio foschi via lazarus: > I cannot understand how I can post a message into a newsgroup using INet > components. I am not 100% sure but as far as I remember you need to send a single "POST" command first check the return code if you are even allowed to post and then sent the Header and Content > uses > ...lNet, lclnet, lnetcomponents, LConvEncoding; > > var > ? ?aStream:TMemoryStream; ? ? ?// correctly initialized elsewhere > ? ?aclient:TLTCPComponent; ? ? // correctly initialized elsewhere > > procedure LineToStream(Buf : String); > begin > ? ?Buf := Buf + #13#10; > ? ?aStream.WriteBuffer(Buf[1], Length(Buf)); > end; > > procedure TfrmUReader.btnSendPostClick(Sender: TObject); > var > ? ?a:integer; > begin > ? ?aStream.Clear; > ? ?LineToStream('POST'); ???? aStream.Position := 0; ??? a:=aclient.Send(aStream, aStream.Size); ??? if a = 340 then ??? begin ?????? aStream.Clear; > ? ?LineToStream('"peppepolpo" '); > ? ?LineToStream('Newsgroups: it.hobby.fai-da-te'); > ? ?LineToStream('Subject: test 201937'); > ? ?LineToStream('Organization: None'); > ? ?LineToStream('X-Newsreader: DIY component '); > > ? ?{ End of header is a blank line } > ? ?LineToStream(''); > > ? ?{ Write the message body } > ? ?LineToStream(''); > ? ?LineToStream('test 201937'); ? ?? LineToStream('.'); // End the message with a single point > > > ? ?aStream.Seek(0, soFromBeginning ); > > ? ?a:=aclient.Send(aStream, aStream.Size); > > ? ?// a=500 here > end; -------------- next part -------------- An HTML attachment was scrubbed... URL: From alb42 at web.de Wed Nov 20 08:37:45 2024 From: alb42 at web.de (Marcus Sackrow) Date: Wed, 20 Nov 2024 08:37:45 +0100 Subject: [Lazarus] help with NNTP posting In-Reply-To: References: Message-ID: <45db7326-2353-4339-a172-67e754ac2e14@web.de> Am 20.11.2024 um 08:34 schrieb Marcus Sackrow via lazarus: >> ? ?LineToStream('"peppepolpo" '); >> just noticed here is also the 'From:' missing! LineToStream('From: "peppepolpo" '); From octopushole at gmail.com Wed Nov 20 21:18:28 2024 From: octopushole at gmail.com (duilio foschi) Date: Wed, 20 Nov 2024 21:18:28 +0100 Subject: [Lazarus] help with NNTP posting In-Reply-To: <45db7326-2353-4339-a172-67e754ac2e14@web.de> References: <45db7326-2353-4339-a172-67e754ac2e14@web.de> Message-ID: solved. from https://www.w3.org/Protocols/rfc977/rfc977.html 3.10. The POST command ... The text forming the header and body of the message to be posted should be sent by the client using the conventions for text received from the news server: A single period (".") on a line indicates the end of the text, with lines starting with a period in the original text having that period doubled during transmission. This code works ok: var alist:TStringlist // initialized elsewhere alist.Clear; aList.Add('POST'); aList.Add('From: "peppepolpo" '); aList.Add('Newsgroups: it.hobby.fai-da-te'); aList.Add('Subject: test 201937'); aList.Add('Organization: None'); aList.Add('X-Newsreader: DIY component '); { End of header is a blank line } aList.Add(''); { Write the message body } aList.Add(''); aList.Add('test 201937'); aList.Add('.'); // <<<<<<<<<<<<<<<<<<<<<<<<<<< this was missing! a:=aclient.SendMessage(alist.Text); On Wed, Nov 20, 2024 at 8:37?AM Marcus Sackrow via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Am 20.11.2024 um 08:34 schrieb Marcus Sackrow via lazarus: > >> LineToStream('"peppepolpo" '); > >> > > just noticed here is also the 'From:' missing! > > LineToStream('From: "peppepolpo" '); > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.tail.kinker at gmail.com Fri Nov 22 19:12:59 2024 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Fri, 22 Nov 2024 13:12:59 -0500 Subject: [Lazarus] Play sound in Lazarus 3.4? Message-ID: I cannot find an acceptable answer to this anywhere online.? I've been looking for an hour. How do I play back a wav file? Preferably, how do I store a bunch of them, play them back as needed when called? From badsector at runtimeterror.com Fri Nov 22 20:56:31 2024 From: badsector at runtimeterror.com (Kostas Michalopoulos) Date: Fri, 22 Nov 2024 21:56:31 +0200 Subject: [Lazarus] Play sound in Lazarus 3.4? In-Reply-To: References: Message-ID: On 11/22/24 8:12 PM, Timothy Groves via lazarus wrote: > I cannot find an acceptable answer to this anywhere online.? I've been > looking for an hour. > > How do I play back a wav file? > > Preferably, how do I store a bunch of them, play them back as needed > when called? > On Windows you could use PlaySound. There is no cross-platform high level audio support in FPC or Lazarus (fcl-sound could be a candidate but all it provides right now is reading WAV files, there is no support for audio playback). You can use OpenAL as a cross-platform audio library. The OpenAL bindings for Free Pascal have an example of loading and playing WAV files directly in packages/examples/wavopenal.pas. From the.tail.kinker at gmail.com Fri Nov 22 21:07:49 2024 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Fri, 22 Nov 2024 15:07:49 -0500 Subject: [Lazarus] Play sound in Lazarus 3.4? In-Reply-To: References: Message-ID: <5e71bdf6-8224-4516-89fe-f0ef32926474@gmail.com> Found an SDL solution.? Only problem is that I have to manually copy the SDL units into my project directory for any project that uses it... On 2024-11-22 14:56, Kostas Michalopoulos via lazarus wrote: > On 11/22/24 8:12 PM, Timothy Groves via lazarus wrote: >> I cannot find an acceptable answer to this anywhere online.? I've >> been looking for an hour. >> >> How do I play back a wav file? >> >> Preferably, how do I store a bunch of them, play them back as needed >> when called? >> > > On Windows you could use PlaySound. There is no cross-platform high > level audio support in FPC or Lazarus (fcl-sound could be a candidate > but all it provides right now is reading WAV files, there is no > support for audio playback). > > You can use OpenAL as a cross-platform audio library. The OpenAL > bindings for Free Pascal have an example of loading and playing WAV > files directly in packages/examples/wavopenal.pas. > > From luca at wetron.es Sat Nov 23 11:26:49 2024 From: luca at wetron.es (Luca Olivetti) Date: Sat, 23 Nov 2024 11:26:49 +0100 Subject: [Lazarus] Play sound in Lazarus 3.4? In-Reply-To: <5e71bdf6-8224-4516-89fe-f0ef32926474@gmail.com> References: <5e71bdf6-8224-4516-89fe-f0ef32926474@gmail.com> Message-ID: El 22/11/24 a les 21:07, Timothy Groves via lazarus ha escrit: > Found an SDL solution.? Only problem is that I have to manually copy the > SDL units into my project directory for any project that uses it... Make a package https://wiki.freepascal.org/Lazarus_Packages -- Luca Olivetti Wetron Automation Technology https://wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From tobiasgiesen at gmail.com Sun Nov 24 13:50:21 2024 From: tobiasgiesen at gmail.com (Tobias Giesen) Date: Sun, 24 Nov 2024 13:50:21 +0100 Subject: [Lazarus] V4 RC1 on MacOS ARM64 Message-ID: <20241124135020.3BD0.7A733E13@gmail.com> Hello, I would like to test this new release, but after unpacking the zip file, macOS says that lazarus.app is broken and should be moved to the trash. I can open the pure binary file lazarus, but then I get a UI without a menu bar and other problems. I tested this on Sonoma. What can be done? Cheers, Tobias From nc-gaertnma at netcologne.de Sun Nov 24 14:45:19 2024 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 24 Nov 2024 14:45:19 +0100 Subject: [Lazarus] V4 RC1 on MacOS ARM64 In-Reply-To: <20241124135020.3BD0.7A733E13@gmail.com> References: <20241124135020.3BD0.7A733E13@gmail.com> Message-ID: <046ac26b-4e2c-4ef7-9fa0-2d8af9201011@netcologne.de> On 11/24/24 13:50, Tobias Giesen via lazarus wrote: > Hello, > > I would like to test this new release, but after unpacking the zip file, > macOS says that lazarus.app is broken and should be moved to the trash. > > I can open the pure binary file lazarus, but then I get a UI without a menu > bar and other problems. > > I tested this on Sonoma. What can be done? Download the zip, then remove the flag: xattr -cr lazarus-darwin-*.zip Then unpack. Mattias From octopushole at gmail.com Wed Nov 27 20:55:53 2024 From: octopushole at gmail.com (duilio foschi) Date: Wed, 27 Nov 2024 20:55:53 +0100 Subject: [Lazarus] TDBDatePicker problem Message-ID: when the underlying field is NULL, the control shows text NULL as a standard. I would like to see a blank box instead. I spotted property TextForNullDate and set it to blank. Now the control shows 00/00/0000. This is unexpected. I expect to see a blank box. Is there a way to get a blank box when the underlying field is NULL? Thank you Peppe -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.tail.kinker at gmail.com Thu Nov 28 05:42:51 2024 From: the.tail.kinker at gmail.com (Timothy Groves) Date: Wed, 27 Nov 2024 23:42:51 -0500 Subject: [Lazarus] Keystrokes going awry Message-ID: <7112a526-1549-4a44-8f97-f8c2dd7f0202@gmail.com> So I wrote a piano program in Lazarus.? It uses keyboard keys to play notes.? Specifically, it uses the Q row for white keys, out to the \ key (because that's the last one on my keyboard), and the number row for black keys, out to the backspace.? FormKeyDown and FormKeyUp are used to trap the keystrokes.? KeyPreview := TRUE. Problem is, some keystrokes are getting trapped earlier, their 7th bit set.? [ comes through as #219, ] comes through as #221. Worse, = comes through as #187. Now, I've corrected for all this in my code, but the question is:? What's causing this? Running Lazarus 3.4 with fpc 3.2.2 on Debian 12.6, openbox and xfpanel, but not xfwm.