From fjf.vanleeuwen at quicknet.nl Tue Aug 4 09:36:17 2020 From: fjf.vanleeuwen at quicknet.nl (frans) Date: Tue, 4 Aug 2020 09:36:17 +0200 Subject: [Lazarus] TCheckLisBox and SelCount Message-ID: <55a876d5-7dff-c800-061b-38b47a198e6a@quicknet.nl> Hi, The inherited SelCount function of a TCheckListBox counts the selected items, not the checked items which are the whole purpose of this component. And there is no other function available. Is this overlooked or judged as not necessary? -- mvg Frans van Leeuwen M 06-51695390 -- Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com From aaa5500 at ya.ru Tue Aug 4 11:03:00 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Tue, 4 Aug 2020 12:03:00 +0300 Subject: [Lazarus] TCheckLisBox and SelCount In-Reply-To: <55a876d5-7dff-c800-061b-38b47a198e6a@quicknet.nl> References: <55a876d5-7dff-c800-061b-38b47a198e6a@quicknet.nl> Message-ID: <69a8ac24-2417-410e-6b3b-5b7d9dd21345@ya.ru> http://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.CheckLst.TCheckListBox_Properties It is Delphi compatable? From pascaldragon at googlemail.com Tue Aug 4 11:08:36 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Tue, 4 Aug 2020 11:08:36 +0200 Subject: [Lazarus] TCheckLisBox and SelCount In-Reply-To: <55a876d5-7dff-c800-061b-38b47a198e6a@quicknet.nl> References: <55a876d5-7dff-c800-061b-38b47a198e6a@quicknet.nl> Message-ID: frans via lazarus schrieb am Di., 4. Aug. 2020, 09:36: > Hi, > > The inherited SelCount function of a TCheckListBox counts the selected > items, not the checked items which are the whole purpose of this > component. And there is no other function available. Is this overlooked > or judged as not necessary? > Items can still be selected independent of their checked state (e.g. If the user want to (de)check multiple items at once). There currently is no CheckedCount or something like that, you need to manually count the elements for which Checked returns True. (Or create a helper to simplify this) Though you could also file a feature request for such a property to be added. Regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu Aug 6 09:58:21 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 06 Aug 2020 09:58:21 +0200 Subject: [Lazarus] Build Lazarus without symbols included? Message-ID: I am never ever going to debug Lazarus itself since I am just a user, so it makes no sense to inflate the size of the Lazarus executable with the symbols... Every time I rebuild Lazarus symbols are added to the binary and I have to remember to close lazarus and issue the strip -s command to reduce its size (by a lot). Same happens when I install Lazarus/Fpc on a new RaspberryPi (I always do this from svn sources). So also here I would like to skip the strip step if possible. But I use a script to do the install and it contains the strip command so in this case it is not as important... Question: Is there a setting somewhere in Lazarus that will build lazarus itself without the symbols, but still create symbols in projects built using Lazarus? -- Bo Berglund Developer in Sweden From leledumbo_cool at yahoo.co.id Thu Aug 6 11:10:22 2020 From: leledumbo_cool at yahoo.co.id (leledumbo) Date: Thu, 6 Aug 2020 02:10:22 -0700 (MST) Subject: [Lazarus] Build Lazarus without symbols included? In-Reply-To: References: Message-ID: <1596705022645-0.post@n3.nabble.com> > Is there a setting somewhere in Lazarus that will build lazarus itself > without the symbols, but still create symbols in projects built using > Lazarus? Tools->Configure build Lazarus->Options: -g- -CX -XXs -- Sent from: http://free-pascal-lazarus.989080.n3.nabble.com/ From aaa5500 at ya.ru Sat Aug 8 14:58:07 2020 From: aaa5500 at ya.ru (AlexeyT) Date: Sat, 8 Aug 2020 15:58:07 +0300 Subject: [Lazarus] GTK2 app starts faster Message-ID: <072d12e7-e017-71b4-bb05-b50abf8d5d90@ya.ru> With last changes (may-june-july 2020) in Laz, CudaText gtk2 starts faster- before with small window: 220ms, with big window: 330ms (BoundsRect change was SLOW) now with small window: 220ms, with big window: 260ms -- Regards, Alexey From larrydalton71 at gmail.com Sun Aug 9 03:01:06 2020 From: larrydalton71 at gmail.com (Larry Dalton) Date: Sat, 8 Aug 2020 21:01:06 -0400 Subject: [Lazarus] lazarus apps on android Message-ID: I want to write apps to be run on android devices. I have downloaded Laz4android2.0 on my Windows 10 computer, and have successfully created a test application. The app will run on the windows computer. How do I install it on my phone, so I can test it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From JuuS at mailbox.org Sun Aug 9 09:17:14 2020 From: JuuS at mailbox.org (Julius) Date: Sun, 9 Aug 2020 09:17:14 +0200 Subject: [Lazarus] SIGEGV crash when a hint displays under certain circumstances, qt5 Message-ID: <719733cf-18f0-c46d-286f-118b6d5604d2@mailbox.org> Hi, I've run into a problem and I can't find any references by google or mantis. Basically, depending on the path you take, displaying a hint in a qt5 build causes program crash with SIGEGV. The problem is easy to reproduce and to "fix". I'm running Laz 2.0.6, Kubuntu 20.04, it is a qt5 project. When built "generically" (ie, no qt5 widgetset specified) it works with no problems. I also tested Laz 2.0.10. Maybe someone has insights? If someone could confirm it so that I know it is not just my computer/code, I will file a bug report. To Reproduce: ============== A Main form and 2 sub-forms. The subforms are not autocreated. A checkbox on all 3 forms that toggles the form's showhint property, initially all have showhint := false; Two buttons on the main form, each has a hint. First button does a "with TmyForm1.Create(self)", in a try/finally block, and only uses the command ShowModal. Likewise the second button does exactly the same for the second sub form. Each subform has some control as you like, each with a hint. Run the application. Open the first subform and toggle its hints on, then mouse over the control to show the hint. Then, open the second subform and toggle its hints on. When the mouse is moved over the control you get the SIGEGV. TO "FIX" =========== Using the same application, run it again. This time, on the main form, be sure to toggle its Showhint to on, mouse over one of the buttons (the hint MUST be shown, toggling ShowHInt alone causes the same error), and then Hint behaviour is normal. Laz 2.0.6: I can get it to give me a location sometimes and it points to line 7929 in qt5/qtwidgets.pas: function TQtMainWindow.IsMdiChild: Boolean; begin Result := (LCLObject <> nil) and not IsFrameWindow and not 7929 ==> (csDesigning in LCLObject.ComponentState) and (TCustomForm(LCLObject).FormStyle = fsMDIChild) and not IsFormDesign(LCLObject); end; Laz 2.0.10: Stops at Line 308 in qt5/qtwscontrols.pp class procedure TQtWSWinControl.SetText(const AWinControl: TWinControl; const AText: string); begin if not WSCheckHandleAllocated(AWincontrol, 'SetText') then Exit; ==> 308 TQtWidget(AWinControl.Handle).BeginUpdate; TQtWidget(AWinControl.Handle).setText(GetUtf8String(AText)); TQtWidget(AWinControl.Handle).EndUpdate; end; -- Julius From juha.manninen62 at gmail.com Sun Aug 9 11:45:06 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sun, 9 Aug 2020 12:45:06 +0300 Subject: [Lazarus] SIGEGV crash when a hint displays under certain circumstances, qt5 In-Reply-To: <719733cf-18f0-c46d-286f-118b6d5604d2@mailbox.org> References: <719733cf-18f0-c46d-286f-118b6d5604d2@mailbox.org> Message-ID: On Sun, Aug 9, 2020 at 10:17 AM Julius via lazarus wrote: > I'm running Laz 2.0.6, Kubuntu 20.04, it is a qt5 project. When built > "generically" (ie, no qt5 widgetset specified) it works with no > problems. I also tested Laz 2.0.10. > > Maybe someone has insights? If someone could confirm it so that I know > it is not just my computer/code, I will file a bug report. Building "generically" means the widgetset is GTK2. Can you please test also with Lazarus trunk. QT5 has got fixes and improvements there. If you can still reproduce, please file a bug report. Regards, Juha From juha.manninen62 at gmail.com Sun Aug 9 11:53:47 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sun, 9 Aug 2020 12:53:47 +0300 Subject: [Lazarus] GTK2 app starts faster In-Reply-To: <072d12e7-e017-71b4-bb05-b50abf8d5d90@ya.ru> References: <072d12e7-e017-71b4-bb05-b50abf8d5d90@ya.ru> Message-ID: On Sat, Aug 8, 2020 at 3:58 PM AlexeyT via lazarus wrote: > > With last changes (may-june-july 2020) in Laz, CudaText gtk2 starts faster- > > before with small window: 220ms, with big window: 330ms (BoundsRect > change was SLOW) > > now with small window: 220ms, with big window: 260ms I applied some patches about BoundsRect in GTK2, but I didn't realize they made such a big speed difference. Which revision exactly made it? Note, LCL component registration (TLCLComponent.NewInstance) was also optimized recently. It affects all widgetsets and apparently was not the reason for your faster startup. Regards, Juha From JuuS at mailbox.org Sun Aug 9 12:59:32 2020 From: JuuS at mailbox.org (Julius) Date: Sun, 9 Aug 2020 12:59:32 +0200 Subject: [Lazarus] SIGEGV crash when a hint displays under certain circumstances, qt5 In-Reply-To: References: <719733cf-18f0-c46d-286f-118b6d5604d2@mailbox.org> Message-ID: <13c9f41d-faf3-65f5-aee5-bd96bb7a3377@mailbox.org> Ok, I will look into that. Have a great Sunday. On 09.08.20 11:45, Juha Manninen via lazarus wrote: > On Sun, Aug 9, 2020 at 10:17 AM Julius via lazarus > wrote: >> I'm running Laz 2.0.6, Kubuntu 20.04, it is a qt5 project. When built >> "generically" (ie, no qt5 widgetset specified) it works with no >> problems. I also tested Laz 2.0.10. >> >> Maybe someone has insights? If someone could confirm it so that I know >> it is not just my computer/code, I will file a bug report. > > Building "generically" means the widgetset is GTK2. > Can you please test also with Lazarus trunk. QT5 has got fixes and > improvements there. > If you can still reproduce, please file a bug report. > > Regards, > Juha > -- Julius From JuuS at mailbox.org Mon Aug 10 11:21:18 2020 From: JuuS at mailbox.org (Julius) Date: Mon, 10 Aug 2020 11:21:18 +0200 Subject: [Lazarus] SIGEGV crash when a hint displays under certain circumstances, qt5 In-Reply-To: <13c9f41d-faf3-65f5-aee5-bd96bb7a3377@mailbox.org> References: <719733cf-18f0-c46d-286f-118b6d5604d2@mailbox.org> <13c9f41d-faf3-65f5-aee5-bd96bb7a3377@mailbox.org> Message-ID: Hi, for anyone following this thread: it is fixed in Trunk. On 09.08.20 12:59, Julius via lazarus wrote: > Ok, I will look into that. Have a great Sunday. > > On 09.08.20 11:45, Juha Manninen via lazarus wrote: >> On Sun, Aug 9, 2020 at 10:17 AM Julius via lazarus >> wrote: >>> I'm running Laz 2.0.6, Kubuntu 20.04, it is a qt5 project. When built >>> "generically" (ie, no qt5 widgetset specified) it works with no >>> problems. I also tested Laz 2.0.10. >>> >>> Maybe someone has insights? If someone could confirm it so that I know >>> it is not just my computer/code, I will file a bug report. >> >> Building "generically" means the widgetset is GTK2. >> Can you please test also with Lazarus trunk. QT5 has got fixes and >> improvements there. >> If you can still reproduce, please file a bug report. >> >> Regards, >> Juha >> > -- Julius From juha.manninen62 at gmail.com Tue Aug 11 11:43:57 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Tue, 11 Aug 2020 12:43:57 +0300 Subject: [Lazarus] SIGEGV crash when a hint displays under certain circumstances, qt5 In-Reply-To: References: <719733cf-18f0-c46d-286f-118b6d5604d2@mailbox.org> <13c9f41d-faf3-65f5-aee5-bd96bb7a3377@mailbox.org> Message-ID: On Mon, Aug 10, 2020 at 12:21 PM Julius via lazarus wrote: > Hi, for anyone following this thread: it is fixed in Trunk. Good :) Juha From pascaldragon at googlemail.com Wed Aug 12 21:16:50 2020 From: pascaldragon at googlemail.com (Sven Barth) Date: Wed, 12 Aug 2020 21:16:50 +0200 Subject: [Lazarus] fpcres now supports compilation of RC files Message-ID: <4c760fc9-11c0-d2f7-e374-eb7d4344bd5b@googlemail.com> Hello together! Thanks to the work of Martok the fpcres utility is now able to compile RC files into RES files. To compile an RC file to a RES file you need to pass the "-of res" argument as otherwise the RC reader won't be used (it's a "catch all" TResourceReader descendant and thus not registered by default). You can specify include paths for the preprocessor using "--include " and defines can be declared using "-D sym" (including defines with values using "-D sym=val"). The Free Pascal compiler is capable of using fpcres for resource compilation as well, but due to bootstrapping issues that currently needs to be enabled using a new option "-FF". Once a FPC release with a fpcres supporting RC files is released we'll make that option the default and deprecate windres/gorc (I currently plan to merge this into 3.2.1, thus 3.2.2 would support this and future 3.3.1 (and thus 3.4) would then use fpcres by default). Please test this with your applications and report your problems as this is the biggest change regarding resource compilation since their introduction. Compatibility note: due to build dependencies the FileInfo unit was moved from fcl-base to fcl-extra, so please keep a look out for stale PPU files. Regards, Sven From juha.manninen62 at gmail.com Thu Aug 13 14:10:24 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 15:10:24 +0300 Subject: [Lazarus] TextHint in TComboBox Message-ID: Regarding issue : https://bugs.freepascal.org/view.php?id=30682 I added TextHint to TComboBox in r63731. QT5 now works with native TextHint, GTK2 with emulated one. Native support for Win32 is not implemented yet. Somebody please implement it. Other widgetsets that natively support this feature for TComboBox, should also be updated. I have a question about TextHint support of TEdit in Win32. The widgetset binding code tests EmulatedTextHintShowing and calls CreateEmulatedTextHintFont from generic LCL code. Does it mean it actually emulates the feature inside the binding code instead of using a native feature? It should not be needed as the emulated TextHint works purely in LCL code level. Same thing with QT4 binding code. It also uses emulated TextHint specific stuff. Is it needed? TextHint in TMemo works only with widgetset's native support. It works with QT5 but not with GTK2. The emulation for TMemo turned out to be tricky. It may never be implemented, unless somebody provides a patch of course. Regards, Juha From lazarus at kluug.net Thu Aug 13 14:23:31 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Thu, 13 Aug 2020 14:23:31 +0200 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: References: Message-ID: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> On 13.08.2020 14:10, Juha Manninen via lazarus wrote: > TextHint in TMemo works only with widgetset's native support. It works > with QT5 but not with GTK2. > The emulation for TMemo turned out to be tricky. It may never be > implemented, unless somebody provides a patch of course. If I am not mistaken, TEdit has TextHint-emulation for WidgetSets without native support. There is no reason why the same emulation shouldn't work with TMemo. Ondrej From juha.manninen62 at gmail.com Thu Aug 13 15:15:23 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 16:15:23 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> Message-ID: On Thu, Aug 13, 2020 at 3:23 PM Ondrej Pokorny via lazarus wrote: > If I am not mistaken, TEdit has TextHint-emulation for WidgetSets > without native support. There is no reason why the same emulation > shouldn't work with TMemo. It does not. Actually it never worked. Nobody has tested it maybe because TMemo.TextHint was not published. The native support eg. with LCL-QT5 does work. What happened so far: The emulated TEdit.TextHint was not updated always. I fixed it : https://bugs.freepascal.org/view.php?id=37506 Then I simplified the code in r63725 which broke TMemo's behavior : https://bugs.freepascal.org/view.php?id=37553 Then I realized that emulated TMemo.TextHint never worked and disabled it completely in r63726. You can test by reverting it. I believe it can be fixed somehow. I will be happy if you take a look at it. ------ r63726 ------ function TCustomMemo.CanShowEmulatedTextHint: Boolean; begin - Result := - Assigned(Lines) // CM_EXIT is sent in destroy -> this function is called in destructor when Lines are already destroyed - and (Lines.Count = 0) - and inherited CanShowEmulatedTextHint; + // CM_EXIT is sent in destroy -> this is called in destructor when Lines are already destroyed + //Result := Assigned(Lines) and inherited CanShowEmulatedTextHint; + // ToDo: Make this work. The line above does not work with GTK2 at least. + Result := False; end; Juha From lazarus at kluug.net Thu Aug 13 17:40:37 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Thu, 13 Aug 2020 17:40:37 +0200 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> Message-ID: <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> On 13.08.2020 15:15, Juha Manninen via lazarus wrote: > On Thu, Aug 13, 2020 at 3:23 PM Ondrej Pokorny via lazarus > wrote: >> If I am not mistaken, TEdit has TextHint-emulation for WidgetSets >> without native support. There is no reason why the same emulation >> shouldn't work with TMemo. > It does not. Actually it never worked. Nobody has tested it maybe > because TMemo.TextHint was not published. Emulated TMemo.TextHint (r63708) works perfectly on Win32 (Windows 10). I haven't checked your more recent changes. WinAPI doesn't support TMemo.TextHint natively. Ondrej From juha.manninen62 at gmail.com Thu Aug 13 17:50:41 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 18:50:41 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> Message-ID: On Thu, Aug 13, 2020 at 6:40 PM Ondrej Pokorny via lazarus wrote: > Emulated TMemo.TextHint (r63708) works perfectly on Win32 (Windows 10). > I haven't checked your more recent changes. WinAPI doesn't support > TMemo.TextHint natively. AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability flag lcTextHint. There is a related bug report : https://bugs.freepascal.org/view.php?id=35967 I tested the emulation only with GTK2. I should have mentioned the problem comes only when adding lines to a Memo by code when the Memo has no focus. It is demonstrated by the example project in issue #37553. I don't have Windows now at all. I was hoping not to install it again as I don't need it for anything. Maybe I must have it for Lazarus testing anyway. Juha From vojtech.cihak at atlas.cz Thu Aug 13 17:56:39 2020 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Thu, 13 Aug 2020 17:56:39 +0200 Subject: [Lazarus] =?utf-8?q?TextHint_in_TComboBox?= In-Reply-To: References: Message-ID: <20200813175639.0691811F@atlas.cz> Hi,   something went wrong. When I open IDE Options or Project Options and I click on any item of TreeView, everything disappear. Content of the filter become "(filter)". When I change it (i.e. non-empty string), content is back. And many of the content is italic.   Lazarus 2.1.0 r63731M FPC 3.3.1 x86_64-linux-qt   Vojtěch a.k.a. Blaazen ______________________________________________________________ > Od: "Juha Manninen via lazarus" > Komu: "Lazarus mailing list" > Datum: 13.08.2020 14:10 > Předmět: [Lazarus] TextHint in TComboBox > Regarding issue : https://bugs.freepascal.org/view.php?id=30682 I added TextHint to TComboBox in r63731. QT5 now works with native TextHint, GTK2 with emulated one. Native support for Win32 is not implemented yet. Somebody please implement it. Other widgetsets that natively support this feature for TComboBox, should also be updated. I have a question about TextHint support of TEdit in Win32. The widgetset binding code tests EmulatedTextHintShowing and calls CreateEmulatedTextHintFont from generic LCL code. Does it mean it actually emulates the feature inside the binding code instead of using a native feature? It should not be needed as the emulated TextHint works purely in LCL code level. Same thing with QT4 binding code. It also uses emulated TextHint specific stuff. Is it needed? TextHint in TMemo works only with widgetset's native support. It works with QT5 but not with GTK2. The emulation for TMemo turned out to be tricky. It may never be implemented, unless somebody provides a patch of course. 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 juha.manninen62 at gmail.com Thu Aug 13 17:58:19 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 18:58:19 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> Message-ID: On Thu, Aug 13, 2020 at 6:50 PM Juha Manninen wrote: > AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability > flag lcTextHint. Actually it is emulated for older Windows versions. function TWin32WidgetSet.GetLCLCapability has : ... lcTextHint: begin if (ComCtlVersion >= ComCtlVersionIE6) then Result := LCL_CAPABILITY_YES else Result := LCL_CAPABILITY_NO; end; For Windows 10 it should report LCL_CAPABILITY_YES. Juha From juha.manninen62 at gmail.com Thu Aug 13 18:08:52 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 19:08:52 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: <20200813175639.0691811F@atlas.cz> References: <20200813175639.0691811F@atlas.cz> Message-ID: On Thu, Aug 13, 2020 at 6:56 PM Vojtěch Čihák via lazarus wrote: > something went wrong. When I open IDE Options or Project Options and I click on any item of TreeView, everything disappear. Content of the filter become "(filter)". When I change it (i.e. non-empty string), content is back. > > And many of the content is italic. > > Lazarus 2.1.0 r63731M FPC 3.3.1 x86_64-linux-qt Yours is QT4 I guess. Damn right, I can reproduce with GTK2 IDE. I mostly tested individual applications only. I try to figure out what is going on... Juha From juha.manninen62 at gmail.com Thu Aug 13 19:36:14 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 20:36:14 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: References: <20200813175639.0691811F@atlas.cz> Message-ID: Please test with r63734. The 3-state type TEmulatedTextHintStatus and its thsChanging was needed after all. Should have tested still more. :( At least here it works now. Juha From vojtech.cihak at atlas.cz Thu Aug 13 20:20:54 2020 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Thu, 13 Aug 2020 20:20:54 +0200 Subject: [Lazarus] =?utf-8?q?TextHint_in_TComboBox?= In-Reply-To: References: , <20200813175639.0691811F@atlas.cz>, Message-ID: <20200813202054.5F56D9D1@atlas.cz> Yes, it looks fine now.   Thanks! ______________________________________________________________ > Od: "Juha Manninen via lazarus" > Komu: "Lazarus mailing list" > Datum: 13.08.2020 19:36 > Předmět: Re: [Lazarus] TextHint in TComboBox > Please test with r63734. The 3-state type TEmulatedTextHintStatus and its thsChanging was needed after all. Should have tested still more. :( At least here it works now. 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 lazarus at kluug.net Thu Aug 13 20:54:22 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Thu, 13 Aug 2020 20:54:22 +0200 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> Message-ID: <27f77193-686f-1d21-e1b8-4d456523001f@kluug.net> On 13.08.2020 17:58, Juha Manninen via lazarus wrote: > On Thu, Aug 13, 2020 at 6:50 PM Juha Manninen wrote: >> AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability >> flag lcTextHint. > Actually it is emulated for older Windows versions. > function TWin32WidgetSet.GetLCLCapability has : > ... > lcTextHint: > begin > if (ComCtlVersion >= ComCtlVersionIE6) then > Result := LCL_CAPABILITY_YES > else > Result := LCL_CAPABILITY_NO; > end; > > For Windows 10 it should report LCL_CAPABILITY_YES. Funnily I tested with themes off, so I got LCL_CAPABILITY_NO :) But yes, you are correct. That is not optimal. We need to split lcTextHint into lcTextHintEdit and lcTextHintMemo. Because as I wrote before WinAPI doesn't support TextHint for multi-line text boxes (TMemo): https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-edit_setcuebannertext So for TMemo we need the emulated code, which works now with a minor bug (the TextHint is not visible when the form is shown the first time). Strangely the bug is present only in a themed application, not in an unthemed one. Ondrej From juha.manninen62 at gmail.com Thu Aug 13 21:33:22 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Thu, 13 Aug 2020 22:33:22 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: <27f77193-686f-1d21-e1b8-4d456523001f@kluug.net> References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> <27f77193-686f-1d21-e1b8-4d456523001f@kluug.net> Message-ID: On Thu, Aug 13, 2020 at 9:54 PM Ondrej Pokorny via lazarus wrote: > So for TMemo we need the emulated code, which works now with a minor bug > (the TextHint is not visible when the form is shown the first time). > Strangely the bug is present only in a themed application, not in an > unthemed one. Please test with the demo by Lagunov Aleksey in https://bugs.freepascal.org/view.php?id=37553 adding the line Memo1.TextHint:='My own TextHint'; as seen in my note. Also remember to change function TCustomMemo.CanShowEmulatedTextHint. It now returns False always. The emulation does not work with GTK2. Juha From lazarus at kluug.net Fri Aug 14 08:32:36 2020 From: lazarus at kluug.net (Ondrej Pokorny) Date: Fri, 14 Aug 2020 08:32:36 +0200 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> <27f77193-686f-1d21-e1b8-4d456523001f@kluug.net> Message-ID: <0a471064-aeca-6f4d-8499-070095530371@kluug.net> On 13.08.2020 21:33, Juha Manninen via lazarus wrote: > On Thu, Aug 13, 2020 at 9:54 PM Ondrej Pokorny via lazarus > wrote: >> So for TMemo we need the emulated code, which works now with a minor bug >> (the TextHint is not visible when the form is shown the first time). >> Strangely the bug is present only in a themed application, not in an >> unthemed one. > Please test with the demo by Lagunov Aleksey in > https://bugs.freepascal.org/view.php?id=37553 > adding the line > Memo1.TextHint:='My own TextHint'; > as seen in my note. > Also remember to change function TCustomMemo.CanShowEmulatedTextHint. > It now returns False always. > The emulation does not work with GTK2. Why have you removed the (FTextHint <> '') check in CanShowEmulatedTextHint? Why should the emulated text hint be shown if there is none? Ondrej From juha.manninen62 at gmail.com Fri Aug 14 10:01:27 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Fri, 14 Aug 2020 11:01:27 +0300 Subject: [Lazarus] TextHint in TComboBox In-Reply-To: <0a471064-aeca-6f4d-8499-070095530371@kluug.net> References: <55b7c918-50e5-e71e-eb7b-5d76f8e14c48@kluug.net> <4d1564ed-4aab-ee23-b076-f18c16daa6f6@kluug.net> <27f77193-686f-1d21-e1b8-4d456523001f@kluug.net> <0a471064-aeca-6f4d-8499-070095530371@kluug.net> Message-ID: On Fri, Aug 14, 2020 at 9:32 AM Ondrej Pokorny via lazarus wrote: > Why have you removed the (FTextHint <> '') check in CanShowEmulatedTextHint? > Why should the emulated text hint be shown if there is none? It was restored later as I noticed the same error. First I planned to make it generic code for both TEdit and TCombobox. Then I just copied it. The latest revision is 63734. Juha From l at c-m-w.me.uk Sun Aug 16 13:45:24 2020 From: l at c-m-w.me.uk (Colin Western) Date: Sun, 16 Aug 2020 12:45:24 +0100 (BST) Subject: [Lazarus] Lazarus IDE text display Message-ID: <1607756637.1088200.1597578324062@email.ionos.co.uk> Working on High Sierra Lazarus compiled for Cocoa shows odd character spacing for program text - each character looks about twice the width it should be. If I compile Lazarus for carbon it looks fine, and text spacing in my apps looks OK, so I suspect a SynEdit related issue. I though I had seen some earlier comments with a similar issues but I can't now find these. Any suggestons? Colin From lazarus at mfriebe.de Sun Aug 16 13:57:51 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 16 Aug 2020 13:57:51 +0200 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: <1607756637.1088200.1597578324062@email.ionos.co.uk> References: <1607756637.1088200.1597578324062@email.ionos.co.uk> Message-ID: On 16/08/2020 13:45, Colin Western via lazarus wrote: > Working on High Sierra Lazarus compiled for Cocoa shows odd character spacing for program text - each character looks about twice the width it should be. If I compile Lazarus for carbon it looks fine, and text spacing in my apps looks OK, so I suspect a SynEdit related issue. I though I had seen some earlier comments with a similar issues but I can't now find these. Any suggestons? This usually happens, if your font is not monospaced. SynEdit will force the chars into the grid (that would be for monospaced). To do so, SynEdit looks for the widest char in the font (by looking at specific samples, like XMW@): "@" is often the widest. You can use a negative "extra char spacing" (tools > options) to compensate. But then the wider chars will overlap. If the font is monospaced, then something is probably wrong with the LCL measuring.... From aaa5500 at ya.ru Sun Aug 16 14:07:01 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sun, 16 Aug 2020 15:07:01 +0300 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: References: <1607756637.1088200.1597578324062@email.ionos.co.uk> Message-ID: On 16.08.2020 14:57, Martin Frb via lazarus wrote: > To do so, SynEdit looks for the widest char in the font (by looking at > specific samples, like XMW@): "@" is often the widest. ATSynEdit takes with of 'grid' as widht of 'N' (before it was 'M', it gave too big size for non monospaced fonts, 'N' is better). -- Regards, Alexey From l at c-m-w.me.uk Sun Aug 16 14:38:15 2020 From: l at c-m-w.me.uk (Colin Western) Date: Sun, 16 Aug 2020 13:38:15 +0100 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: References: <1607756637.1088200.1597578324062@email.ionos.co.uk> Message-ID: On 16 August 2020 13:07:01 BST, "Alexey Tor. via lazarus" wrote: >On 16.08.2020 14:57, Martin Frb via lazarus wrote: >> To do so, SynEdit looks for the widest char in the font (by looking >at >> specific samples, like XMW@): "@" is often the widest. > >ATSynEdit takes with of 'grid' as widht of 'N' (before it was 'M', it >gave too big size for non monospaced fonts, 'N' is better I have the font set as "default", which had always worked fine before. I will try some different fonts. Colin From lazarus at mfriebe.de Sun Aug 16 18:24:55 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 16 Aug 2020 18:24:55 +0200 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: References: <1607756637.1088200.1597578324062@email.ionos.co.uk> Message-ID: On 16/08/2020 14:07, Alexey Tor. via lazarus wrote: > On 16.08.2020 14:57, Martin Frb via lazarus wrote: >> To do so, SynEdit looks for the widest char in the font (by looking >> at specific samples, like XMW@): "@" is often the widest. > > ATSynEdit takes with of 'grid' as widht of 'N' (before it was 'M', it > gave too big size for non monospaced fonts, 'N' is better). > And how does a this text look? MMM@@@WWW From aaa5500 at ya.ru Sun Aug 16 19:27:45 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sun, 16 Aug 2020 20:27:45 +0300 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: References: <1607756637.1088200.1597578324062@email.ionos.co.uk> Message-ID: On 16.08.2020 19:24, Martin Frb via lazarus wrote: > And how does a this text look? > MMM@@@WWW In Pascal syntax, it is 3 tokens; all 3 tokens are clipped on right side (with non monospaced font). -- Regards, Alexey From l at c-m-w.me.uk Sun Aug 16 20:20:31 2020 From: l at c-m-w.me.uk (C Western) Date: Sun, 16 Aug 2020 19:20:31 +0100 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: References: <1607756637.1088200.1597578324062@email.ionos.co.uk> Message-ID: On 16/08/2020 18:27, Alexey Tor. via lazarus wrote: > On 16.08.2020 19:24, Martin Frb via lazarus wrote: >> And how does a this text look? >> MMM@@@WWW > > In Pascal syntax, it is 3 tokens; all 3 tokens are clipped on right > side (with non monospaced font). > Doing some more tests (with Cocoa) with different fonts: with "default" as the font - the result looks odd. I thought this was supposed to work for all platforms, but looking at my Linux (gtk2) setup this also looks odd if "default" is used. Testing with MMM@@@WWW this seems to be an issue with the specific font chosen. with "Menlo" as the font it looks fine with "Monaco" as the font the spacing is OK, but bold face is lost. Ideally "default" for the IDE font would give a sensible monospace font for each platform, but this may be more trouble than is is worth. Colin From aaa5500 at ya.ru Sun Aug 16 23:19:52 2020 From: aaa5500 at ya.ru (Alexey) Date: Mon, 17 Aug 2020 00:19:52 +0300 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: References: Message-ID: <85F4E864-21DF-4E42-8738-E119958E2080@ya.ru> > Ideally "default" for the IDE font would give a sensible monospace font for each platform No, “default” is def variable width font. But yes, we need new alias for default mono font, eg “def_mono”. And I will use it, and IDE should use it. Courier isn’t installed on all OS. Courier New too. For new alias, LCL must detect it... Maybe there isn’t such api in main OSes? Alexey From lazarus at mfriebe.de Mon Aug 17 00:14:07 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 17 Aug 2020 00:14:07 +0200 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: <85F4E864-21DF-4E42-8738-E119958E2080@ya.ru> References: <85F4E864-21DF-4E42-8738-E119958E2080@ya.ru> Message-ID: <91d2a034-4604-4144-1548-181c59d11c79@mfriebe.de> On 16/08/2020 23:19, Alexey via lazarus wrote: > > Ideally "default" for the IDE font would give a sensible monospace font for each platform > > No, “default” is def variable width font. > But yes, we need new alias for default mono font, eg “def_mono”. And I will use it, and IDE should use it. > > Courier isn’t installed on all OS. Courier New too. For new alias, LCL must detect it... Maybe there isn’t such api in main OSes? > I dont know if this is still used (from unit synedit) But it does not have cocoa procedure InitSynDefaultFont; begin   if SynDefaultFontName <> '' then exit;   Screen.Fonts;   {$UNDEF SynDefaultFont}   {$IFDEF LCLgtk}     SynDefaultFontName   := '-adobe-courier-medium-r-normal-*-*-140-*-*-*-*-iso10646-1';     SynDefaultFontHeight := 14;     {$DEFINE SynDefaultFont}   {$ENDIF}   {$IFDEF LCLcarbon}     SynDefaultFontName   := 'Monaco'; // Note: carbon is case sensitive     SynDefaultFontHeight := 12;     {$DEFINE SynDefaultFont}   {$ENDIF}   // LCLgtk2 and LCLQt use default settings   {$IFnDEF SynDefaultFont}     SynDefaultFontName   := 'Courier New';     SynDefaultFontHeight := -13;   {$ENDIF}   if Screen.Fonts.IndexOf(SynDefaultFontName) >= 0 then     exit;   if Screen.Fonts.IndexOf('DejaVu Sans Mono') >= 0 then begin     SynDefaultFontName   := 'DejaVu Sans Mono';     SynDefaultFontHeight := 13;   end; end; From nc-gaertnma at netcologne.de Mon Aug 17 08:59:29 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Mon, 17 Aug 2020 08:59:29 +0200 Subject: [Lazarus] Lazarus IDE text display In-Reply-To: <91d2a034-4604-4144-1548-181c59d11c79@mfriebe.de> References: <85F4E864-21DF-4E42-8738-E119958E2080@ya.ru> <91d2a034-4604-4144-1548-181c59d11c79@mfriebe.de> Message-ID: <20200817085929.2df35cf7@limapholos.matflo.wg> On Mon, 17 Aug 2020 00:14:07 +0200 Martin Frb via lazarus wrote: > On 16/08/2020 23:19, Alexey via lazarus wrote: > > > Ideally "default" for the IDE font would give a sensible > > > monospace font for each platform > > > > No, “default” is def variable width font. > > But yes, we need new alias for default mono font, eg “def_mono”. > > And I will use it, and IDE should use it. > > > > Courier isn’t installed on all OS. Courier New too. For new alias, > > LCL must detect it... Maybe there isn’t such api in main OSes? > > I dont know if this is still used (from unit synedit) > But it does not have cocoa Cocoa works with Courier New. I personally use Andale Mono under Cocoa. Mattias > procedure InitSynDefaultFont; > begin >   if SynDefaultFontName <> '' then exit; >   Screen.Fonts; >   {$UNDEF SynDefaultFont} >   {$IFDEF LCLgtk} >     SynDefaultFontName   := > '-adobe-courier-medium-r-normal-*-*-140-*-*-*-*-iso10646-1'; >     SynDefaultFontHeight := 14; >     {$DEFINE SynDefaultFont} >   {$ENDIF} >   {$IFDEF LCLcarbon} >     SynDefaultFontName   := 'Monaco'; // Note: carbon is case > sensitive SynDefaultFontHeight := 12; >     {$DEFINE SynDefaultFont} >   {$ENDIF} >   // LCLgtk2 and LCLQt use default settings >   {$IFnDEF SynDefaultFont} >     SynDefaultFontName   := 'Courier New'; >     SynDefaultFontHeight := -13; >   {$ENDIF} >   if Screen.Fonts.IndexOf(SynDefaultFontName) >= 0 then >     exit; >   if Screen.Fonts.IndexOf('DejaVu Sans Mono') >= 0 then begin >     SynDefaultFontName   := 'DejaVu Sans Mono'; >     SynDefaultFontHeight := 13; >   end; > end; > From lazarus at mfriebe.de Wed Aug 19 00:24:12 2020 From: lazarus at mfriebe.de (Martin Frb) Date: Wed, 19 Aug 2020 00:24:12 +0200 Subject: [Lazarus] Tab/Shift tab and block indentation In-Reply-To: <83a32c63-2b68-36e4-f436-3a5beec04a76@freepascal.org> References: <8aa10d65-e280-0e8a-494d-bf7f633319c5@freepascal.org> <5c2d8bb8-6207-edc3-19c9-42d0ffd369ff@mfriebe.de> <83a32c63-2b68-36e4-f436-3a5beec04a76@freepascal.org> Message-ID: <6a456aff-8be6-00f9-656c-ea513bc98074@mfriebe.de> On 20/04/2020 21:59, Florian Klämpfl via lazarus wrote: > >> >> But instead of using tab to (un-)indent selected lines, you can use >> the multi-caret feature. >> Go to the left most column, on the first line. Then shift-alt-down >> until you have a caret in front of each line you wish to change. Now >> either delete spaces, or insert spaces. > > Problem is, that backspace behaves really uncontrollable in this case: > lines get one char removes others more, I think it does some unindent > operation as well instead of just removing chars. > Sounds strange. Maybe you have some tabs/#9 chars? Then "del" removes the entire #9. But, multicaret  would eat into the text if you deleted from this.     Foo(); // comment at x=0     Bar(); So, yes 2nd option would be good... Btw, when indenting for alinment, I use an editor-macro (assigned to a key) for aligning tokens  in the middle of a line. For example bring all // to the same x pos It only goes for the first occurrence of the token, but it can be adjusted. You can in a similar way write a macro to do your indent. The macro is actually the example on https://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript function IsIdent(c: Char): Boolean; begin   Result := ((c >= 'a') and (c <= 'z')) or             ((c >= 'A') and (c <= 'Z')) or             ((c >= '0') and (c <= '9')) or             (c = '_'); end; var   p1, p2: TPoint;   s1, s2: string;   i, j, k: Integer; begin   if not Caller.SelAvail then exit;   p1 := Caller.BlockBegin;   p2 := Caller.BlockEnd;   if (p1.y > p2.y) or ((p1.y = p2.y) and (p1.x > p2.x)) then begin     p1 := Caller.BlockEnd;     p2 := Caller.BlockBegin;   end;   s1 := Caller.Lines[p1.y - 1];   s2 := '';   i := p1.x   while (i <= length(s1)) and (s1[i] in [#9, ' ']) do inc(i);   j := i;   if i <= length(s1) then begin     if IsIdent(s1[i]) then // pascal identifier       while (i <= length(s1)) and IsIdent(s1[i]) do inc(i)     else       while (i <= length(s1)) and not(IsIdent(s1[i]) or (s1[i] in [#9, ' '])) do inc(i);   end;   if i > j then s2 := copy(s1, j, i-j);   if not InputQuery( 'Align', 'Token', s2) then exit;   j := 0;   for i := p1.y to p2.y do begin     s1 := Caller.Lines[i - 1];     k := pos(s2, s1);     if (k > j) then j := k;   end;   if j < 1 then exit;   for i := p1.y to p2.y do begin     s1 := Caller.Lines[i - 1];     k := pos(s2, s1);     if (k > 0) and (k < j) then begin       Caller.LogicalCaretXY := Point(k, i);       while k < j do begin         ecChar(' ');         inc(k);       end;     end;   end; end. From octopushole at gmail.com Fri Aug 21 17:46:53 2020 From: octopushole at gmail.com (duilio foschi) Date: Fri, 21 Aug 2020 17:46:53 +0200 Subject: [Lazarus] weird error message In-Reply-To: References: Message-ID: 1. when the compiler reaches this line,,, qryMain.AfterOpen:=TB_DPTAfterOpen; it throws the error: unit1.pas(190,23) Error: Wrong number of parameters specified for call to "TB_DPTAfterOpen" 2. TB_DPTAfterOpen is declared as: TFrame1=class(TFrame) protected procedure TB_DPTAfterOpen(DataSet: TDataSet); ... 3. qryMain is declared as: qryMain: TSQLQuery; 4. AfterOpen is a TDataSetNotifyEvent AfterOpen: TDataSetNotifyEvent 5. TDataSetNotifyEvent is declared as TDataSetNotifyEvent = procedure(DataSet: TDataSet) of object; Ev seems ok to me. So where is the error? Thank you Peppe Polpo From l at c-m-w.me.uk Fri Aug 21 18:00:07 2020 From: l at c-m-w.me.uk (Colin Western) Date: Fri, 21 Aug 2020 17:00:07 +0100 (BST) Subject: [Lazarus] weird error message In-Reply-To: References: Message-ID: <672852994.1434930.1598025607765@email.ionos.co.uk> qryMain.AfterOpen:=@TB_DPTAfterOpen ? Colin From octopushole at gmail.com Fri Aug 21 18:14:30 2020 From: octopushole at gmail.com (duilio foschi) Date: Fri, 21 Aug 2020 18:14:30 +0200 Subject: [Lazarus] weird error message In-Reply-To: <672852994.1434930.1598025607765@email.ionos.co.uk> References: <672852994.1434930.1598025607765@email.ionos.co.uk> Message-ID: thanks Colin, it worked. In Delphi you write qryMain.AfterOpen:=TB_DPTAfterOpen; but whatever works is ok to me :) On Fri, Aug 21, 2020 at 6:00 PM Colin Western via lazarus wrote: > > qryMain.AfterOpen:=@TB_DPTAfterOpen ? > > Colin > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From juha.manninen62 at gmail.com Fri Aug 21 18:22:35 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Fri, 21 Aug 2020 19:22:35 +0300 Subject: [Lazarus] weird error message In-Reply-To: References: <672852994.1434930.1598025607765@email.ionos.co.uk> Message-ID: On Fri, Aug 21, 2020 at 7:14 PM duilio foschi via lazarus wrote: > In Delphi you write > qryMain.AfterOpen:=TB_DPTAfterOpen; > > but whatever works is ok to me :) It works also with FPC when using {$mode delphi} Juha From octopushole at gmail.com Fri Aug 21 18:48:31 2020 From: octopushole at gmail.com (duilio foschi) Date: Fri, 21 Aug 2020 18:48:31 +0200 Subject: [Lazarus] weird error message In-Reply-To: References: <672852994.1434930.1598025607765@email.ionos.co.uk> Message-ID: Yes, it works. Good to know. Thank you On Fri, Aug 21, 2020 at 6:22 PM Juha Manninen wrote: > > On Fri, Aug 21, 2020 at 7:14 PM duilio foschi via lazarus > wrote: > > In Delphi you write > > qryMain.AfterOpen:=TB_DPTAfterOpen; > > > > but whatever works is ok to me :) > > It works also with FPC when using {$mode delphi} > > Juha From jszcmpr at netspace.net.au Sat Aug 22 13:04:36 2020 From: jszcmpr at netspace.net.au (John) Date: Sat, 22 Aug 2020 21:04:36 +1000 Subject: [Lazarus] Lazarus on Raspberry Pi Message-ID: <20200822210436.52dfbaa4@apus-f32.em.ld> Hi All, I haven't been active on this list for a long time, but I have been still been using FPC/Lazarus - many thanks to all who who have been making all the improvements. I recently dipped my toe into Raspberry Pi, and successfully built FPC (3.0.4) / Laz (2.0.8) using the instructions here: https://wiki.lazarus.freepascal.org/Build_current_FPC_and_Lazarus_for_Raspbian I have just upgraded my installation using the previously built FPC (3.0.4) to build FPC 3.2.0 / Laz 2.0.10 (rather than go through the process of getting the bootstrap compiler again as per the instructions) I presume this is legitimate - it certainly worked - and if so, would it be worth my writing this up on the wiki ? I was all set to do so, but I noticed a note at the end of the process suggesting one should repeat the entire process each time. cheers, John Sunderland From noreply at z505.com Mon Aug 24 20:09:17 2020 From: noreply at z505.com (noreply at z505.com) Date: Mon, 24 Aug 2020 13:09:17 -0500 Subject: [Lazarus] Lazarus on Raspberry Pi In-Reply-To: <20200822210436.52dfbaa4@apus-f32.em.ld> References: <20200822210436.52dfbaa4@apus-f32.em.ld> Message-ID: On 2020-08-22 06:04, John via lazarus wrote: > Hi All, > > I haven't been active on this list for a long time, but I have been > still been using FPC/Lazarus - many thanks to all who who have been > making all the improvements. > > I recently dipped my toe into Raspberry Pi, and successfully built > FPC (3.0.4) / Laz (2.0.8) using the instructions here: > > https://wiki.lazarus.freepascal.org/Build_current_FPC_and_Lazarus_for_Raspbian > > I have just upgraded my installation using the previously built FPC > (3.0.4) to build FPC 3.2.0 / Laz 2.0.10 (rather than go through the > process of getting the bootstrap compiler again as per the > instructions) > I presume this is legitimate - it certainly worked - and if so, would > it > be worth my writing this up on the wiki ? Yes, any titles like "For version such and such" on the wiki with instructions would be useful, as I have been meaning to install these on my Pi's recently and haven't found much a few months back. Thanks From noreply at z505.com Mon Aug 24 20:49:54 2020 From: noreply at z505.com (noreply at z505.com) Date: Mon, 24 Aug 2020 13:49:54 -0500 Subject: [Lazarus] Do I understand how OnIdle works? In-Reply-To: References: Message-ID: On 2020-07-27 05:05, frans via lazarus wrote: > Hi, > > I wonder about the use of OnIdle procedure and the Done variable. I > thougth that this routine keeps running over and over again in idle > state as long as Done=False. But the value of Done doesn't make a > difference, the OnIdle procedure  keeps repeating itself even when > Done=True. > Can anyone explain this to me? Good question, hopefully someone else will answer as I don't know. There might be some sample code that tells you with SimpleIPC somewhere out there as that help documentation in the IDE might be using it.. in the lazarus code itself if you can find it. BTW what are you using OnIdle for if you want to tell me? I'm trying to find more uses for it. Maybe search the related lazarus code for OnIdle to see if it's using it. From bo.berglund at gmail.com Thu Aug 27 08:15:44 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 27 Aug 2020 08:15:44 +0200 Subject: [Lazarus] Lazarus on Raspberry Pi References: <20200822210436.52dfbaa4@apus-f32.em.ld> Message-ID: On Sat, 22 Aug 2020 21:04:36 +1000, John via lazarus wrote: >I recently dipped my toe into Raspberry Pi, and successfully built >FPC (3.0.4) / Laz (2.0.8) using the instructions here: > >https://wiki.lazarus.freepascal.org/Build_current_FPC_and_Lazarus_for_Raspbian That is NOT an instruction on how to install Fpc/Lazarus on a Raspberry Pi! Rather it is an instruction on how to build an installation package for the same platform. Used in order to *distribute* Fpc/Lazarus to other users mainly. Big difference and much more work than needed.... If you want to install Fpc/Lazarus in order to use it yourself and update them going forward then the much simpler way to go is to: - Check out sources from svn (also done in the instructions) - Install the build essentials and dependencies via apt - Get the seed compiler (needed only once on any given system) - Use the make command in the source dirs to build - Use the make command in the source dirs to install in your system - Create the desktop entry for starting Lazarus All of this can be done in a fairly small script which gives you an upgradable installation based on svn updates. -- Bo Berglund Developer in Sweden From m.e.sanliturk at gmail.com Thu Aug 27 10:01:15 2020 From: m.e.sanliturk at gmail.com (Mehmet Erol Sanliturk) Date: Thu, 27 Aug 2020 11:01:15 +0300 Subject: [Lazarus] Lazarus on Raspberry Pi In-Reply-To: References: <20200822210436.52dfbaa4@apus-f32.em.ld> Message-ID: On Thu, Aug 27, 2020 at 9:15 AM Bo Berglund via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On Sat, 22 Aug 2020 21:04:36 +1000, John via lazarus > wrote: > > >I recently dipped my toe into Raspberry Pi, and successfully built > >FPC (3.0.4) / Laz (2.0.8) using the instructions here: > > > > > https://wiki.lazarus.freepascal.org/Build_current_FPC_and_Lazarus_for_Raspbian > > That is NOT an instruction on how to install Fpc/Lazarus on a > Raspberry Pi! > Rather it is an instruction on how to build an installation package > for the same platform. Used in order to *distribute* Fpc/Lazarus to > other users mainly. > > Big difference and much more work than needed.... > > If you want to install Fpc/Lazarus in order to use it yourself and > update them going forward then the much simpler way to go is to: > > - Check out sources from svn (also done in the instructions) > - Install the build essentials and dependencies via apt > - Get the seed compiler (needed only once on any given system) > - Use the make command in the source dirs to build > - Use the make command in the source dirs to install in your system > - Create the desktop entry for starting Lazarus > > All of this can be done in a fairly small script which gives you an > upgradable installation based on svn updates. > > > -- > Bo Berglund > Developer in Sweden > > -- > _______________________________________________ > > Is there such a published script which you can supply its link ? If not , would you please add such a part into the above link ? Thank you very much . Mehmet Erol Sanliturk -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu Aug 27 11:40:19 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 27 Aug 2020 11:40:19 +0200 Subject: [Lazarus] Lazarus on Raspberry Pi References: <20200822210436.52dfbaa4@apus-f32.em.ld> Message-ID: On Thu, 27 Aug 2020 11:01:15 +0300, Mehmet Erol Sanliturk via lazarus wrote: >Is there such a published script which you can supply its link ? >If not , would you please add such a part into the above link ? I have published the link to my script and the seed compiler already in this group. But here is a link again: http://blog.boberglund.com/ -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Aug 27 22:51:00 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 27 Aug 2020 22:51:00 +0200 Subject: [Lazarus] Installing custom control in Lazarus - where can I find it? Message-ID: I am (again) trying to port a Delphi application to Lazarus/FPC. This time I need a customized version of TListView, which I converted to use in Lazarus back in 2018. See thread titled: "Converting a component package Delphi->Lazarus using built-in converter?" I found the files for the converted component on my disk as: easylistview.lpk THis is the package file EasyListView.pas EasyListView.dcr No using Lazarus 2.0.8 and FPC 3.0.4 I did the following: - Started Lazarus - Told it to start a new project (to not interfere with my current project) - Package/Open package file - Navigated to the easylistview.lpk file - Clicked the Compile button. Finished successfully. - Use/Install. Lazarus started to rebuild itself - No visible errors shown - Lazarus restarted Now, how do I find the component I just installed so I can use it? I expected a new tab named AGI to appear with the component inside of it but I cannot find it... This is what is (or rather was, see below) in the register procedure in EasyListView.pas: procedure Register; begin RegisterComponents('AGI', [TEasyListView]); end; And this is the lpk file content after the compile/install: <_ExternHelp Items="Count"/> Now the strangest thing is that in this process Lazarus has completely mangled the EasyListView.pas source file so it now only has this content wheras the original was 27 kbytes....: { This file was automatically created by Lazarus. Do not edit! This source is only used to compile and install the package. } unit EasyListView; {$warn 5023 off : no warning about unused units} interface uses LazarusPackageIntf; implementation procedure Register; begin end; initialization RegisterPackage('EasyListView', @Register); end. So it is overwriting the source file for the component with a basically empty file, which it successfully installs and is nowhere to be found.... Apparently I am doing something completely wrong here, but what? -- Bo Berglund Developer in Sweden From werner.pamler at freenet.de Thu Aug 27 23:27:27 2020 From: werner.pamler at freenet.de (Werner Pamler) Date: Thu, 27 Aug 2020 23:27:27 +0200 Subject: [Lazarus] Installing custom control in Lazarus - where can I find it? In-Reply-To: References: Message-ID: Am 27.08.2020 um 22:51 schrieb Bo Berglund via lazarus: > Now the strangest thing is that in this process Lazarus has completely > mangled the EasyListView.pas source file so it now only has this > content wheras the original was 27 kbytes....: I guess the component code is in unit EasyListView.pas and the package is named EasyListview.lpk. This is bad because installation creates the "package unit" with the same name as the package file, i.e. it overwrites your component unit. Remedy: give the package a different, more "package-like" name, e.g. EasyListViewPkg, or LazEasyListView (also to distinguish from any Delphy package). Carefully check the contents of the new LazEasyListView.lpk file to make sure that the old package name is not mentioned any more (or recreate the package from the start - this is not difficult and almost no work). IIRC, I had tried to convert this component some time ago, too, and found it very difficult. Well, maybe because my intention was to make it cross-platform. From coppolastudio at gmail.com Fri Aug 28 07:46:02 2020 From: coppolastudio at gmail.com (Salvatore Coppola) Date: Fri, 28 Aug 2020 07:46:02 +0200 Subject: [Lazarus] Installing custom control in Lazarus - where can I find it? In-Reply-To: References: Message-ID: Have restarted the lazarus just recompiled? ⁣Ottieni BlueMail per Android ​ Il giorno 27 Ago 2020, 22:51, alle ore 22:51, Bo Berglund via lazarus ha scritto: >I am (again) trying to port a Delphi application to Lazarus/FPC. >This time I need a customized version of TListView, which I converted >to use in Lazarus back in 2018. >See thread titled: >"Converting a component package Delphi->Lazarus using built-in >converter?" > >I found the files for the converted component on my disk as: >easylistview.lpk THis is the package file >EasyListView.pas >EasyListView.dcr > >No using Lazarus 2.0.8 and FPC 3.0.4 I did the following: >- Started Lazarus >- Told it to start a new project (to not interfere with my current >project) >- Package/Open package file >- Navigated to the easylistview.lpk file >- Clicked the Compile button. Finished successfully. >- Use/Install. Lazarus started to rebuild itself >- No visible errors shown >- Lazarus restarted > >Now, how do I find the component I just installed so I can use it? >I expected a new tab named AGI to appear with the component inside of >it but I cannot find it... > >This is what is (or rather was, see below) in the register procedure >in EasyListView.pas: > >procedure Register; >begin > RegisterComponents('AGI', [TEasyListView]); >end; > >And this is the lpk file content after the compile/install: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <_ExternHelp Items="Count"/> > > > > >Now the strangest thing is that in this process Lazarus has completely >mangled the EasyListView.pas source file so it now only has this >content wheras the original was 27 kbytes....: > > >{ This file was automatically created by Lazarus. Do not edit! > This source is only used to compile and install the package. > } > >unit EasyListView; > >{$warn 5023 off : no warning about unused units} >interface > >uses > LazarusPackageIntf; > >implementation > >procedure Register; >begin >end; > >initialization > RegisterPackage('EasyListView', @Register); >end. > > >So it is overwriting the source file for the component with a >basically empty file, which it successfully installs and is nowhere to >be found.... > >Apparently I am doing something completely wrong here, but what? > > >-- >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 bo.berglund at gmail.com Fri Aug 28 08:12:07 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 28 Aug 2020 08:12:07 +0200 Subject: [Lazarus] Installing custom control in Lazarus - where can I find it? References: Message-ID: On Thu, 27 Aug 2020 23:27:27 +0200, Werner Pamler via lazarus wrote: >Am 27.08.2020 um 22:51 schrieb Bo Berglund via lazarus: >> Now the strangest thing is that in this process Lazarus has completely >> mangled the EasyListView.pas source file so it now only has this >> content wheras the original was 27 kbytes....: > >I guess the component code is in unit EasyListView.pas and the package >is named EasyListview.lpk. This is bad because installation creates the >"package unit" with the same name as the package file, i.e. it >overwrites your component unit. > >Remedy: give the package a different, more "package-like" name, e.g. >EasyListViewPkg, or LazEasyListView (also to distinguish from any Delphy >package). Carefully check the contents of the new LazEasyListView.lpk >file to make sure that the old package name is not mentioned any more >(or recreate the package from the start - this is not difficult and >almost no work). > >IIRC, I had tried to convert this component some time ago, too, and >found it very difficult. Well, maybe because my intention was to make it >cross-platform. Hello Werner! After posting this I late last night found a mail correspondence with you from June 2018 where you helped me convert this very component! And luckily the final files were attached in the email at the end of the conversation so I could extract them. Meanwhile I have had to replace my old Win7 computer and lost a lot of files in the process... :( Anyway now I have placed the files under subversion so that will not happen again. So I took these files (where the naming was better with a difference between the package and the sourcefiles) and repeated the process and it succeeded! I now have an EasyListView component on my Lazarus palette! This is very good because almost all of my old GUI style Delphi projects used the component to display data and so is crucial to being able to port them. The reason I had forgotten our interaction could be that at the time in 2018 I was convalescing from a bad fall from the roof of my house and could barely move... I want to (hopefully again) thank you so very much for your help at the time! -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Fri Aug 28 08:14:09 2020 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 28 Aug 2020 08:14:09 +0200 Subject: [Lazarus] Installing custom control in Lazarus - where can I find it? References: Message-ID: On Fri, 28 Aug 2020 07:46:02 +0200, Salvatore Coppola via lazarus wrote: >Have restarted the lazarus just recompiled? Yes, that is automatic. My problem was that I did not know that you are not allowed to have the same name for all file in such a package with only an extension difference! See further my reply to Werner Pamler. -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Fri Aug 28 08:53:14 2020 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Fri, 28 Aug 2020 08:53:14 +0200 Subject: [Lazarus] Installing custom control in Lazarus - where can I find it? In-Reply-To: References: Message-ID: <20200828085314.3605c6ff@limapholos.matflo.wg> On Fri, 28 Aug 2020 08:14:09 +0200 Bo Berglund via lazarus wrote: > On Fri, 28 Aug 2020 07:46:02 +0200, Salvatore Coppola via lazarus > wrote: > > >Have restarted the lazarus just recompiled? > > Yes, that is automatic. > > My problem was that I did not know that you are not allowed to have > the same name for all file in such a package with only an extension > difference! https://wiki.freepascal.org/Lazarus_Packages#Create_a_package_with_a_unit_that_has_the_same_name_as_the_package Mattias From steveg at nevets.com.au Sun Aug 30 07:59:02 2020 From: steveg at nevets.com.au (SteveG) Date: Sun, 30 Aug 2020 15:59:02 +1000 Subject: [Lazarus] App for PinePhone Message-ID: Anybody know how to create an app for the pinephone running ubports (Ubuntu Touch) It is using Wayland, and wont run X11 apps directly (though can use Libertine once stable) So I guess my question is - can Laz/Fpc do this currently, and if so how ? Dont mind if has to be QT5 / Gtk3 / fpGui / etc Regards - SteveG From juha.manninen62 at gmail.com Sun Aug 30 08:30:46 2020 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sun, 30 Aug 2020 09:30:46 +0300 Subject: [Lazarus] App for PinePhone In-Reply-To: References: Message-ID: On Sun, Aug 30, 2020 at 8:59 AM SteveG via lazarus wrote: > Dont mind if has to be QT5 / Gtk3 / fpGui / etc QT5 widgetset is rather complete and stable. AFAIK it does not require X11. That's the number 1 choice. GTK3 is still buggy and features are missing but it may be enough for some applications. fpGui widgetset binding is not maintained very actively. I am not sure how it works currently. Juha From steveg at nevets.com.au Sun Aug 30 10:49:01 2020 From: steveg at nevets.com.au (SteveG) Date: Sun, 30 Aug 2020 18:49:01 +1000 Subject: [Lazarus] App for PinePhone In-Reply-To: References: Message-ID: <4f35c5a4-c6f1-1e9f-5786-09049754841e@nevets.com.au> On 30/8/20 4:30 pm, Juha Manninen via lazarus wrote: > On Sun, Aug 30, 2020 at 8:59 AM SteveG via lazarus > wrote: >> Dont mind if has to be QT5 / Gtk3 / fpGui / etc > QT5 widgetset is rather complete and stable. AFAIK it does not require > X11. That's the number 1 choice. > GTK3 is still buggy and features are missing but it may be enough for > some applications. > fpGui widgetset binding is not maintained very actively. I am not sure > how it works currently. > > Juha Thank you Juha - will attempt crosscompile to arm64 using qt5 (have to figure that first) From francesco.sammarco at gmail.com Sun Aug 30 12:11:41 2020 From: francesco.sammarco at gmail.com (Francesco Sammarco) Date: Sun, 30 Aug 2020 12:11:41 +0200 Subject: [Lazarus] App for PinePhone In-Reply-To: <4f35c5a4-c6f1-1e9f-5786-09049754841e@nevets.com.au> References: <4f35c5a4-c6f1-1e9f-5786-09049754841e@nevets.com.au> Message-ID: Keep us informed, it interests me too. I just did some tests for the application console. Il giorno dom 30 ago 2020 alle ore 10:49 SteveG via lazarus < lazarus at lists.lazarus-ide.org> ha scritto: > On 30/8/20 4:30 pm, Juha Manninen via lazarus wrote: > > On Sun, Aug 30, 2020 at 8:59 AM SteveG via lazarus > > wrote: > >> Dont mind if has to be QT5 / Gtk3 / fpGui / etc > > QT5 widgetset is rather complete and stable. AFAIK it does not require > > X11. That's the number 1 choice. > > GTK3 is still buggy and features are missing but it may be enough for > > some applications. > > fpGui widgetset binding is not maintained very actively. I am not sure > > how it works currently. > > > > Juha > > Thank you Juha - will attempt crosscompile to arm64 using qt5 (have to > figure that first) > > > > -- > _______________________________________________ > 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 aaa5500 at ya.ru Sun Aug 30 18:43:27 2020 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sun, 30 Aug 2020 19:43:27 +0300 Subject: [Lazarus] OS theme change via TAppProperties Message-ID: <42c6bb0c-454c-a465-35b7-f36ea4db6cbd@ya.ru> This forum topic is about how we can react to macOS theme change. https://forum.lazarus.freepascal.org/index.php?topic=43111.msg376056;topicseen#new and I had the idea to make all this task simpler. we have the TApplicationProperties. let's add OnThemeChange there! some widgetset funcs will be needed. now it's the problem - do this reaction on macOS, on win32,... no one knows how to do it on gtk2/qt... I wrote to Dmitry (Cocoa developer) about this idea, then wrote here. Alexey Torgashin