Another issue:Juha please have a look at this, we already have this functionality built in to TListBox: TListBox built-in search+filter functionality (https://youtu.be/PfuiRoJxpc8)
The search or filter edit control sucks. It shows the "Search Here" text also when it gets focus. A user must delete the text first. A TListViewFilterEdit control should be used instead. It is designed for exactly this purpose.
To see it in action, open in Lazarus IDE: Package -> Open Loaded Package ...
It also supports browsing the list with arrow keys while the filter edit has focus.
The search or filter edit control sucks. It shows the "Search Here" text also when it gets focus. A user must delete the text first.Such a hint text should not be stored in the Edit.Text itself but in the Edit.TextHint which is displayed in grayed-out style as long as Edit.Text is empty (https://lazarus-ccr.sourceforge.io/docs/lcl/stdctrls/tcustomedit.texthint.html).
Juha please have a look at this, we already have this functionality built in to TListBox: TListBox built-in search+filter functionality (https://youtu.be/PfuiRoJxpc8)No we don't. Please see my answer in the other thread. Why do you call it search+filter functionality while it is only a search?
I thought it was both but I guess I was wrong :-(Juha please have a look at this, we already have this functionality built in to TListBox: TListBox built-in search+filter functionality (https://youtu.be/PfuiRoJxpc8)No we don't. Please see my answer in the other thread. Why do you call it search+filter functionality while it is only a search?
Earlier (issue #39671) I tried to change the logic for this exact same LazarusDirectory but it caused a regression.You told me you had fixed it. And from memory, it needed to be fixed. But you did not tell me you reverted that fix. Thanks very much.
I still wonder why nobody else noticed this problem.Well, in my case I am not using trunk for day to day work anymore because of this https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39540
Such a hint text should not be stored in the Edit.Text itself but in the Edit.TextHint which is displayed in grayed-out style as long as Edit.Text is empty (https://lazarus-ccr.sourceforge.io/docs/lcl/stdctrls/tcustomedit.texthint.html).
But when an Edit control has Focus, the TextHint is not shown.Yes, this is in the docs, but in fact, the TextHint IS shown for the focused Edit on Windows and cocoa. This is different from Delphi. The TextHint is not shown on gtk2/gkt3, though (did not not test the qt's). It would be better if we'd have a consistent behaviour here.
Thanks WP.But when an Edit control has Focus, the TextHint is not shown.Yes, this is in the docs, but in fact, the TextHint IS shown for the focused Edit on Windows and cocoa. This is different from Delphi. The TextHint is not shown on gtk2/gkt3, though (did not not test the qt's). It would be better if we'd have a consistent behaviour here.
Thanks WP.But when an Edit control has Focus, the TextHint is not shown.Yes, this is in the docs, but in fact, the TextHint IS shown for the focused Edit on Windows and cocoa. This is different from Delphi. The TextHint is not shown on gtk2/gkt3, though (did not not test the qt's). It would be better if we'd have a consistent behaviour here.
Yes, thats what I have found although only tested on GTK2, Qt5 and Windows so far. Qt5 is OK too so its "only" a GTK2/3 issue.
So, I have some workable code but I am not exactly happy with it. Have to support GTK and drag the others down (or ifdef all over the place).
To make it usable in GTK2/GTK3, IMHO, I need to alter the tab order, have initial focus on the ListView (so the texthint shows) and first tab stop after that is the EditSearch. Thats fine so far, maybe even reasonably intuitive. But then tabbing back to the ListView (from the EditSearch) is hopeless if you have all the checkboxes and buttons as tabstop.
(Please look away now Aruna)
Does anyone seriously try and use these interfaces without a mouse ? Or choose tabbing rather than clicking 'cos its faster ? Using the mouse is flawless.
Anyway, I will graft this new model into my full test install and see if I like it, if I do, I will push another patch up in place of the previous one. Maybe later today unless someone has a better approach to suggest.
Right now, I need to go out and cut some firewood before it gets too hot.
Davo
(Please look away now Aruna)Davo, listen to me please. The way 'I' see it 'anything' we design and develop will have two human interface devices connected, the keyboard and that mouse correct? All I am saying is whatever one is able to do by pointing and clicking the mouse one should also be able to do using the keyboard. If you are unable to do so to me that is a serious design flaw that needs to be reviewed and rectified.
Does anyone seriously try and use these interfaces without a mouse ? Or choose tabbing rather than clicking 'cos its faster ? Using the mouse is flawless.
All I am saying is whatever one is able to do by pointing and clicking the mouse one should also be able to do using the keyboard.
....... I forgot the behaviour I was seeing was native to my gtk2/3 .....Are you referring to the failure to Search While You Type you reported ? Thats not a gtk2 thing, I do all my dev on gtk2, test on several different platforms, always works for me. I think you are using six or seven month old source.
But when an Edit control has Focus, the TextHint is not shown.Yes, this is in the docs, but in fact, the TextHint IS shown for the focused Edit on Windows and cocoa. This is different from Delphi. The TextHint is not shown on gtk2/gkt3, though (did not not test the qt's). It would be better if we'd have a consistent behaviour here.
My "fix" was based on poor knowledge of the code. After reverting it I planned to study the issue more but I had many other activities during the past year and this one got postponed.Earlier (issue #39671) I tried to change the logic for this exact same LazarusDirectory but it caused a regression.You told me you had fixed it. And from memory, it needed to be fixed. But you did not tell me you reverted that fix. Thanks very much.
background : Initially, direct access to LazarusDirectory was not available, Getmen eventually either found a way or made a way but by that stage, my code was in the review pipeline.
https://forum.lazarus.freepascal.org/index.php/topic,57680.msg434967.html#msg434967
Clearly I should have gone back to it but I was traveling then and time was a rare commodity. But with a fix applied to the LazarusDirectory name issue, it was not critical. :-[
$ git blame components/buildintf/ideoptionsintf.pas
This is a portion of its output :151f452c847 components/ideintf/ideoptionsintf.pas (ondrej 2015-11-27 05:35:22 +0000 135) procedure RemoveFromRecentPackageFiles(const AFilename: string); virtual; abstract;
151f452c847 components/ideintf/ideoptionsintf.pas (ondrej 2015-11-27 05:35:22 +0000 136)
68276150e12 components/ideintf/ideoptionsintf.pas (joost 2019-01-01 16:49:20 +0000 137) function GetParsedCompilerFilename: string; virtual; abstract;
9d1b8c9d875 components/ideintf/ideoptionsintf.pas (joost 2019-04-12 21:08:55 +0000 138) function GetParsedFppkgConfig: string; virtual; abstract;
6f9144a5841 components/buildintf/ideoptionsintf.pas (balazs 2022-02-23 08:04:33 +0200 139) function GetParsedLazarusDirectory: string; virtual; abstract;
fba579ac625 components/ideintf/ideoptionsintf.pas (mattias 2018-09-22 12:03:45 +0000 140)
151f452c847 components/ideintf/ideoptionsintf.pas (ondrej 2015-11-27 05:35:22 +0000 141) procedure AddHandlerAddToRecentOpenFiles(Handler: TOnAddToRecent; const AsFirst: boolean = true); // AsFirst means: first to call
151f452c847 components/ideintf/ideoptionsintf.pas (ondrej 2015-11-27 05:35:22 +0000 142) procedure RemoveHandlerAddToRecentOpenFiles(Handler: TOnAddToRecent);
It was added by balazs in February this year. Kudos to him. [I got confused by names and had an inaccurate comment here for a while]Well, in my case I am not using trunk for day to day work anymore because of this https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39540Yes, it must be fixed properly. Now it does not crash any more but the popup opens in a wrong place.
The problem only shows up if you are using the default location for PCP. Most trunk users have it as a second install and its config is redirected. Certainly in my case.PCP is "Primary Config Path". The bug happened also when using --pcp= parameter.
.....After reverting it I planned to study the issue more but I had many other activities during the past year and this one got postponed.Quite a lot of activities I understand. Outside ... :)
Now it is fixed. No worries mate, or how they say in Australia?If you can draw the 'a' in mate out a bit, maaaate .....
PCP is "Primary Config Path". The bug happened also when using --pcp= parameter.
About the filter :Its OK now with the patch I posted a few hours ago. The issue for me was that a user seeing the window for the first time had no way of knowing just what that field was for. Now I start with the focus on the ListView (and thats actually good), the EditSearch is only a click or a tab away and an Enter in the EditSearch brings you back into the ListView. Its actually quite intuitive.
It is OK if TextHint is not shown when the filter has focus.
I added a comment in issueI'll respond to issue 40034 in Isue 40034, my bad !
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40034
You still haven't commented on using the TListViewFilterEdit control.
Oh, I did not realise that, I thought any redirection of PCP masked the problem. So, is it because of the '~' rather than an absolute path ? I usually use $HOME rather than tilde because sometimes the shell plays with '~' in unexpected ways. Its managed internally rather than expanded like $HOME is.'~' is interpreted by a (bash) shell and works just fine there.
Anyway, even though its no longer a problem here, I suspect it needs to be resolved, it will bite us again, sooner or later.It is now resolved properly!
Its OK now with the patch I posted a few hours ago. The issue for me was that a user seeing the window for the first time had no way of knowing just what that field was for. Now I start with the focus on the ListView (and thats actually good), the EditSearch is only a click or a tab away and an Enter in the EditSearch brings you back into the ListView. Its actually quite intuitive.Not good. Sorry.
TListViewFilterEdit ? Probably another very good component with no documentation.Yes. :)
Every time I want to use a new component, I have to spend days experimenting on how it works (and writing up my finding in the wiki) so, I use the ones I know. Its really sad we have such great people writing such good code but they won't add an extra 15 minutes documenting what they have done ! (Get off your soap box David, he used to be in a position to 'instruct' his developers to write good docs but not any more.)Example code works as documentation, too.
* Can it handle multiple columns in the list view ?TListViewFilterEdit ? Probably another very good component with no documentation.Yes. :)
... no, it has documentation:
https://wiki.freepascal.org/LazControls#TListViewFilterEdit
OK, it is rather short but it says "Data should be added to TListViewFilterEdit.Items, not to the container ListView."
What else you need to know? :P
Anyway, when working with a huge existing code base the biggest challenge is not writing new code but learning the existing code.
TListViewFilterEdit ? Probably another very good component with no documentation.
...
* Can it handle multiple columns in the list view ?
* How to add an item ? Seems its a call to ~.items.add(Item:T); And that item is fgl thingo. I use Pascal because its strongly typed, if I want something that can be any old type depending on the day of the week, I'd use Python.
* How to specify and apply the filter ?
* Can you filter for, eg "Words together" plus another ?
* Will it work with Owner Data ?
* Why does it have no mention in the chm help files ?
* Why is it Red on in the table that appears, eg on https://wiki.freepascal.org/TEdit ?
* Why is there no Example Project showing how to use TListViewFilterEdit ?
1. When down key is pressed in SearchEdit, the listview should get focus with the first item selected(sorry it's too late, I don't have time for a patch):I will add your suggestions to the code later.
Now a related question: Why is the Example form KeyDown handler not triggered?Most likely the KeyPreview property of the form is false.
OK, https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40036Reverting back? No way. In my opinion the Example Window now looks good and works well. Thank you for you efforts! A few minor tweaks can be added, like the ones in your patch above.
Now ESC closes window from everywhere (?) and GetMem's two suggestions implemented (beginupdate and a keypress moves from listview to editsearch).
Sorry this project has needed so much attention, despite my enthusasim to tackel it, evidence is it was beyond me. Still, I think its OK now but will not, in any way be offended if its decided to drop it.
Reverting back to old Example Window in the IDE would be easy, a global find and remove of *.ex-meta files easy too.
Davo
OK, https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40036Like Juha asked 'me', why are 'you' apologizing? How is it beyond you when it is already working? Maybe not 100% the way everyone would like to see it work but we are getting there. So please no more talk of this 'people deciding to drop it', and it would be best if you[da] gets back to work on that as and when time permits him to do so. I fail to understand how does a person who chops his own firefood just give up? So uh-uh not happening on my shift :)
Sorry this project has needed so much attention, despite my enthusasim to tackel it, evidence is it was beyond me. Still, I think its OK now but will not, in any way be offended if its decided to drop it.
Reverting back to old Example Window in the IDE would be easy, a global find and remove of *.ex-meta files easy too.No need to revert. I am working on the old 'testall' and we can always put it in LCL/tests as Juha suggested. So we have access to the old 'testall' as well as the 'examples' you are working on. Problem solved and we have the best of both worlds? Now this next question is related to the old 'testall' and if everyone wants a separate thread that would be fine but I am asking here in the mean time.
Most likely the KeyPreview property of the form is false.Damn yes. Somehow I forgot it. The latest commit fixes it and cleans the VK_ESCAPE handling.
Sorry this project has needed so much attention, despite my enthusasim to tackel it, evidence is it was beyond me. Still, I think its OK now but will not, in any way be offended if its decided to drop it.Nobody wants to drop it!
My concern about the future of the new Example Window is the growth in complexity, too complex means too hard to maintain ! And thats a bad thing !I don't see it as too complex or too hard to maintain. The search engine is quite advanced.
@Aruna, I will create a new thread about TestAll project issues.Ok sounds good to me.
[Edit] For this winter I am a carrot professional. It is good physical work. I move literally tons of carrots around. There is also brain activity involved when classifying carrots as 1., 2. or 3. quality. On a conveyor belt there is 0.x seconds / carrot to make the decision and there are lots of border cases. Hands must move quickly to separate them.I have many worked many factories here in Toronto over the last 16 years and on many conveyor belts before moving onto an office environment call center and now I am involved with homeless people and hiv/aids agencies in downtown Toronto. Those conveyor belts I never used to like they usually crank up the speed to get extra production failing to understand we are not machines we have to deal with fatigue and hunger. And a 8 hour shift usually left me dog tired and you have to be very careful on the belt otherwise quite possible you can injure your hands or fingers. But yes this kind of work will keep you healthy :D
With computer programming I can ponder on problems much longer. :)Yes especially the problems 'I' create like changing the path from '/' to '\' manually to trigger that error :-D
In the evenings I feel lazy.A ice cold beer and some hot food usually helps..
There is more going on there than meets the eye Aruna, the lpi file is written to by Lazarus, not you and I. So, please check the paths in the Lazarus project, click Project->ProjectOptions->Paths perhaps ?I knew it... and Juha just re-confirmed what you said it seems the ide at some point converts the path delimiter as needed by the operating system things are running on eh
Maybe it has a specific hard wired (for Windows) path in there, the rest of the path you found is pure linux, no windows machine is going to have a path like that. Strange.Actually 'I' manually changed the '\' to a '/` to get things working an reverted things again to trigger the error. It seems I had checked out a branch before Juha's fix, it happens!
Generally, in your code, you would use the const "PATHDELIM" , never use either slash unless you are absolutely certain is not cross platforms (except, of course in a web address ....).Thank you I will grep for this "PATHDELIM"
My concern about the future of the new Example Window is the growth in complexity, too complex means too hard to maintain! And thats a bad thing !We can cross that bridge when we get to it, you worry too much. Remember, use the mouse Luke :-D
1. Since there are 200+ example projects, it's very likely that users will perform a search first. In my opinion EditSearch should receive focus, this also follows IDE convention.I fixed the TabOrder in my latest commit. At least with GTK2 the focus visually shows only in the SearchEdit filter control when pressing TAB many times. So it made very little difference.
However if it's decided that ListView is the active control, which is also fine, at least can we select the first item? Also ListView.RowSelect looks much better in my opinion.
2. TabOrder is not correct
......it's very likely that users will perform a search first. In my opinion EditSearch should receive focus, .....Indeed this was my first model, however, GTK2 does not show the TextHint if the control has focus. And by default, Lazarus on Linux is based on GTK2. We could avoid this problem (and a lot of code I suspect) if we just added a label next to the EditSearch "Search Here" but, honestly, that does not look cool.
I wanted to add a glyph image to the SpeedButton. The image ('btnfiltercancel') is already part of LCL and is used in the IDE's controls. Yet calling :does not work. Resource 'btnfiltercancel' not found.
ClearSearchButton.LoadGlyphFromLazarusResource('btnfiltercancel');
IIRC that function works for SpeedButtons in the IDE. This example window is an IDE plugin and LoadGlyphFromLazarusResource should work there as well.
Now I loaded the bitmap directly into the button's Glyph property. Loading from LCL would share resources and support High-DPI automatically.
Any ideas?
Indeed this was my first model, however, GTK2 does not show the TextHint if the control has focus. And by default, Lazarus on Linux is based on GTK2.Even without the TextHint it's pretty obvious that the first control is a filter, especially after @Juha added the filter glyph, but I don't want to insist, it's up to you to decide. I'll shut up now. :)
I wanted to add a glyph image to the SpeedButton. The image ('btnfiltercancel') is already part of LCL and is used in the IDE's controls. Yet calling :AFAIK, the image is not in a Lazarus resource but in an FPC resource (res), and this is why the image is not found. But after Ondrej's rework of the speedbutton and bitbtn glyphs it is much more advantageous to use an imagelist to assign the glyphs because this automatically handles lcl scaling. And in unit ideimagesintf, there's a ready-to-use imagelist with the available resource images: IDEImages.Images_16, and the imageindex can be found from the GetImageIndex method with the resource name as parameter:does not work. Resource 'btnfiltercancel' not found.
ClearSearchButton.LoadGlyphFromLazarusResource('btnfiltercancel');
IIRC that function works for SpeedButtons in the IDE. This example window is an IDE plugin and LoadGlyphFromLazarusResource should work there as well.
Now I loaded the bitmap directly into the button's Glyph property. Loading from LCL would share resources and support High-DPI automatically.
Any ideas?
... GTK2 does not show the TextHint if the control has focus.That is perfectly OK. There are similar filter edits around the IDE with identical SpeedButton icons for clearing them. Clever Lazarus users know immediately what it is.
As it is now, the user is blissfully unaware of which control has focus, if they start typing character, they appear in the editsearch box and if they use the cursor keys, focus moves up and down in the ListView. (First part being Getmem's excellent suggestion). If the user presses Enter while in EditSearch (natural thing to do after entering text), focus is again shifted back to ListView so, again, thats what a user probably, unconsciously, expects. They don't need to tab right around (but can if they want to).TabOrder must be from top-down, left-right. That is a GUI convention everywhere. TAB must not jump around here and there.
I note Juha has altered the Tab order from what I initially set, I had the EditSearch first tabstop after (opening) ListView, now its last on the list. Juha's model is good if the user realizes that typing will automatically take you to the EditSearch but that is not obvious IMHO. So I provided one (tab) press to get there. Now, once you press Tab, you have to keep pressing (or use the mouse). I am uncertain ....
We have also set a goal that the window is usable without a mouse (necessary or otherwise) so that means everything needs to be a tabstop. Personally, I rarely tab between controls and don't believe too many other users do either. But its there.Support for using keyboard to navigate a GUI is a normal convention again. Nothing special to this Examples window.
But what about your forestry project, that is far more interesting ??My hobby forest now sleeps under thick snow. South Finland got permanent snow in mid-November which is unusual. Now we have a proper winter, cold and lots of snow, and more is coming! May be a record snow level before mid-December. A new ice age is coming clearly.
Hello everyone, I tried to test the latest changes in ulaz_examples.lpi but got this warning below.
The project does not use the LCL unit interfaces, which is required by LCLBase. You will get strange linker errors if you use the LCL without interfaces.
Another thing I noticed quite by accident is when I close the IDE using File->Quit everything shuts down and I am back in my terminal. Which is good. If I use the close 'X' in the top right corner of the window in the IDE then it does close everything but I am not taken back to a shell prompt. I am taken back to the terminal but it hangs until I press Ctrl+C ? This is nothing urgent or a major issue just thought I should let you know.Does it have to be Ctrl-C ? Maybe just Enter ? In both cases, you are back in the terminal with a shell prompt its just if there is some data there, the terminal does not always show the prompt until it sees some input from you. All good.
I have been asked to work Mon to Fri again so I may not be as active as I am right now but on weekends I will try to be around.
Aruna, I am not sure just what you are doing "I tried to test the latest changes ulaz_examples.lpi". To test the example window, get Lazarus Main, build it and run it. Click the Examples button or menu under tools. You should not be interacting with ulaz_examples.lpi directly.Indeed the ulaz_examples.lpi project does not work. I guess it is a standalone version of the examples window. IMO it should be either fixed or removed.
I dare to link a picture of my son who visited and helped with the logs, although this is out of topic in Lazarus list :If that young man was to grow a beard he would be your twin. He looks exactly like you.
https://drive.google.com/file/d/1hS_f_1zMAYLz03n2gie5rmJ1Ko0wdCMQ/view
He worked with a chainsaw for the first time and liked it.
Aruna, I am not sure just what you are doing "I tried to test the latest changes ulaz_examples.lpi". To test the example window, get Lazarus Main, build it and run it. Click the Examples button or menu under tools. You should not be interacting with ulaz_examples.lpi directly.I wanted to test the examples window just like any other stand-alone if I can do that it will save me a lot of time compared to always git fetch then git merge then rebuild the ide (which can be a real pain when you have to do it many times). So how do I get it to run like any other stand alone then?
Yes Juha I saw both the .lpk and the .lpi so I decided to give the .lpi a test drive but as you saw the IDE started complaining.Aruna, I am not sure just what you are doing "I tried to test the latest changes ulaz_examples.lpi". To test the example window, get Lazarus Main, build it and run it. Click the Examples button or menu under tools. You should not be interacting with ulaz_examples.lpi directly.Indeed the ulaz_examples.lpi project does not work. I guess it is a standalone version of the examples window. IMO it should be either fixed or removed.
@Aruna, exampleprojects.lpk is the IDE plugin package.
I have no idea ulaz_examples.lpi is doing there. Running ulaz_examples as a standalone project makes no sense, it needs a wrapper around it to provide various data inputs. I don't remember making it but I must have, perhaps in early experimental days.Well no one remembers everything they did especially if it has been many months so this is normal. I can't remember what I did last evening most times.
I have tested both my Test Rig for ulaz_examples and Lazarus itself, neither care that ulaz_examples.lpi was deleted. Its a distraction, remove it please !I disgaree. You say distraction I say this is an opportunity to learn? And once we learn how to get that ulaz_examples.lpi to run like a stand alone it will help others at some later point in time. If you look carefully the form caption/title says 'Prototype'
If you want to run ulaz_examples in a standalone mode (heaps easier to test/develop) I suggest https://gitlab.com/dbannon/laz_examples/-/tree/main/Utility/ExScanner - the temp rig I made to manage moving the various examples around and building their initial metadata files. Most of its functionality is now redundant and its a bit of a lash up. But its one remaining use is to test the new Examples window outside of Lazarus.This is exactly what I want to do but why can I not do this in teh Lazarus ide? Why do I have to do this outside of lazarus? That would be defeating the purpose?
Maybe I should strip out all the redundant stuff and make it just the wrapper to demonstrate the Example Window ?Yes please lets do that.
As mentioned previously, to just create and edit a metadata file use https://github.com/davidbannon/ExampleMetaDataI am still trying to understand the reason you decided to go with json? We can do the same thing with a simple text file? Unless you were thinking of the online/internet/trunk/remote stuff? With a plain old text file we can reduce the code to a few lines compared to what we need right now to process that json?
If you want to run ulaz_examples in a standalone mode (heaps easier to test/develop) I suggest https://gitlab.com/dbannon/laz_examples/-/tree/main/Utility/ExScanner - the temp rig I made to manage moving the various examples around and building their initial metadata files. Most of its functionality is now redundant and its a bit of a lash up. But its one remaining use is to test the new Examples window outside of Lazarus.This is exactly what I want to do but why can I not do this in teh Lazarus ide? Why do I have to do this outside of lazarus? That would be defeating the purpose?
I am still trying to understand the reason you decided to go with json? We can do the same thing with a simple text file? Unless you were thinking of the online/internet/trunk/remote stuff? With a plain old text file we can reduce the code to a few lines compared to what we need right now to process that json?In the early part of this project, we considered moving the Examples to an online repo, that would reduce the SRC tree size a bit and it was one way to solve the *nix "installed in Read Only Space" issue. However, Lazarus on MacOS has a less than perfect http unit and it was decided to drop that for the immediate future at least. The code is still in there, ifdef'ed out and the repo where the content lives is https://gitlab.com/dbannon/laz_examples/ - now only used when a user asks to see an example in the browser.
You can open the ExScanner project in Lazarus IDE after you downloaded it from gitlab.com/dbannon repository. It should be easy enough.If you want to run ulaz_examples in a standalone mode (heaps easier to test/develop) I suggest https://gitlab.com/dbannon/laz_examples/-/tree/main/Utility/ExScanner - the temp rig I made to manage moving the various examples around and building their initial metadata files. Most of its functionality is now redundant and its a bit of a lash up. But its one remaining use is to test the new Examples window outside of Lazarus.This is exactly what I want to do but why can I not do this in teh Lazarus ide? Why do I have to do this outside of lazarus? That would be defeating the purpose?
I wanted to test the examples window just like any other stand-alone if I can do that it will save me a lot of time compared to always git fetch then git merge then rebuild the ide (which can be a real pain when you have to do it many times). So how do I get it to run like any other stand alone then?You are doing something wrong if the update is a pain. Just do "git pull" in main branch, then open Lazarus IDE and rebuild it from its Tools menu. Usually the build is quick. However after a (rare) refactoring change that moved files around the compilation may fail and you must select "Clean all" in the Configure "Build Lazarus" window. Then compilation takes longer but even then just few minutes unless you have a very slow machine.
What kind of car is that? Must be very strong if it can pull all those logs.Volvo S60 AWD from 2002, bought from a net auction almost 4 years ago. A 5-cylinder engine with turbo. Yes, 5 (five).
Ok now I understand. Thank you.I am still trying to understand the reason you decided to go with json? We can do the same thing with a simple text file? Unless you were thinking of the online/internet/trunk/remote stuff? With a plain old text file we can reduce the code to a few lines compared to what we need right now to process that json?In the early part of this project, we considered moving the Examples to an online repo, that would reduce the SRC tree size a bit and it was one way to solve the *nix "installed in Read Only Space" issue. However, Lazarus on MacOS has a less than perfect http unit and it was decided to drop that for the immediate future at least. The code is still in there, ifdef'ed out and the repo where the content lives is https://gitlab.com/dbannon/laz_examples/ - now only used when a user asks to see an example in the browser.
Thanks I will stop by that repo soon :-)
The tools to manage keeping that repo up to date are in the current EXScanner ....
You can open the ExScanner project in Lazarus IDE after you downloaded it from gitlab.com/dbannon repository. It should be easy enough.Thank you I will try this soon.
Lazarus distribution should stay slim and not be bloated with such extra stuff. I also hope the online examples idea is still alive. It would be a perfect match.Agreed no bloat and slim as we can get is good. What exactly is this online examples you are referring to? This is the first time I am hearing of this. I think David mentioned this as well but I was not aware we had a repositery full of online examples somewhere. Or is this yet to be done?
The Examples window is able to open a selected example project in the IDE on the fly. That's why it is an IDE plugin. A standalone application cannot do that.
You are doing something wrong if the update is a pain. Just do "git pull" in main branch, then open Lazarus IDE and rebuild it from its Tools menu. Usually the build is quick. However after a (rare) refactoring change that moved files around the compilation may fail and you must select "Clean all" in the Configure "Build Lazarus" window. Then compilation takes longer but even then just few minutes unless you have a very slow machine.The last three lines below in the bash terminal output snippet should answer the question if my machine is slow. And this was a make clean all from the command prompt. I like to see all the stuff the shell/terminal throws up as it goes through the copile and link proces :-D Line # 17,18 and 19 will be of interest.
P.S.Wow a 5 cylinder eh? Volvo's are very strong cars built to last. I saw your picture here (https://wiki.freepascal.org/Developer_pages):What kind of car is that? Must be very strong if it can pull all those logs.Volvo S60 AWD from 2002, bought from a net auction almost 4 years ago. A 5-cylinder engine with turbo. Yes, 5 (five).
The German Anssems trailer has brakes and can carry over a ton of payload legally. Nice!
I guess you saw my Google profile photo which is outdated. Now I look older because ... I am older. I will remove the profile photo sometime soon.
Agreed no bloat and slim as we can get is good. What exactly is this online examples you are referring to? This is the first time I am hearing of this. I think David mentioned this as well but I was not aware we had a repositery full of online examples somewhere. Or is this yet to be done?It is yet to be done, although the Examples window has already code for it. There were some technical issues.
The last three lines below in the bash terminal output snippet should answer the question if my machine is slow. And this was a make clean all from the command prompt. I like to see all the stuff the shell/terminal throws up as it goes through the copile and link proces :-D Line # 17,18 and 19 will be of interest.Nice. Not slow.
real 2m12.537s user 1m35.501s sys 0m7.744s
Wow a 5 cylinder eh? Volvo's are very strong cars built to last. I saw your picture here (https://wiki.freepascal.org/Developer_pages):OK, my picture in wiki developer pages is also outdated. I guess I should take a new picture of myself.
I removed the obsolete .lpi file in 8a80bb3b85.Thanks !
You can open the ExScanner project in Lazarus IDE after you downloaded it from gitlab.com/dbannon repository. It should be easy enough.But remember, to do a valid test using EXScanner, you must copy the current ulaz_examples.pas/lfm files from the Lazarus tree into ExScanners tree so its testing the current version ! (And possibly some of the other files from ~/components/examplewindow if they have changed. Use diff if doubtfull.
Lazarus distribution should stay slim and not be bloated with such extra stuff. I also hope the online examples idea is still alive. It would be a perfect match.
I wanted to test the examples window just like any other stand-alone if I can do that it will save me a lot of time compared to always git fetch then git merge then rebuild the ide (which can be a real pain when you have to do it many times). So how do I get it to run like any other stand alone then?
Volvo S60 AWD from 2002, bought from a net auction almost 4 years ago. A 5-cylinder engine with turbo. Yes, 5 (five).Diesel ? My Ranger has a European 5 cyclinder Diesel, they could have some common ansersory. Its a great engine, strong and reliable.
I was not aware we had a repositery full of online examples somewhere. Or is this yet to be done?Open the Examples Window, select a project and click "View in Browser".
* How to add an item ? Seems its a call to ~.items.add(Item:T); And that item is fgl thingo. I use Pascal because its strongly typed, if I want something that can be any old type depending on the day of the week, I'd use Python.A specialized generics type is strongly typed. In this case it is a container of TListViewDataItem.
Diesel ? My Ranger has a European 5 cyclinder Diesel, they could have some common ansersory. Its a great engine, strong and reliable.My Volvo has a 2.4 liter gasoline engine. Yes, Ford co-operated with Volvo at some point. The engine has Volvo origins.
Juha, those logs ? They look straight and long enough for construction use, seems a waste to use them for firewood, is there no better market than that ? We don't use softwood for firewood here anyway, having a good (but NOT endless) supply of hardwood. Hmm, being softwood, they would be lighter than I would expect just looking at the picture.Complex issue. Big wood companies prefer to buy a lot of wood at a time. By selling firewood I could do it gradually. I am a newbie in selling wood, let's see what happens.
....OK, that makes more sense. My favorite thing with Pascal is its strong Typing, that bug seemed (but only "seemed") to confirm my worst fears ! Very glad its just a codetools issue. I depend on CodeTools quite a lot, if its wrong, there was nowhere to fall back on. But, as you see in the demo, it was pretty easy to work out.
The bug is in Codetools. The code hint in editor shows "const Item T" instead of "const Item TListViewDataItem". It doesn't mean that compiler would accept any other type than TListViewDataItem.
I found it was reported already 6 years ago.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/29860
Somebody should fix it. The report even gives a hint about where the fix should go.
The ListViewFilterEdit example project you provided revealed a bug in the filter. Setting Filter := 'x' in program code does not show it visually in the edit. I will fix and extend it.That would be much nicer. The programmer can, of course, set it themself. Do you have the time to fix it ?
We have little "hardwood" here. Birch is the best firewood energy-wise, but fir and pine are burned as we have a lot of them.And of course they grow a lot quicker than hardwood too. My own land, classed as "woodland", not forest, is all hardwood mostly about 100 years old. Was all cleared back in the gold rush. Australia grows a lot of pinus radiata, not a native but good commercial crop. Grows fast if it gets enough water. But our fire places and wood burners are designed for hardwood.
Yes I remember those days when all we had was a dial up connection using a modem running at 9600 baud, 9.6kb/sec somewhere in the early 1980's and later at 56,000 baud, 56kb/sec over a two-wire analog phone line somewhere in 1991.Agreed no bloat and slim as we can get is good. What exactly is this online examples you are referring to? This is the first time I am hearing of this. I think David mentioned this as well but I was not aware we had a repositery full of online examples somewhere. Or is this yet to be done?It is yet to be done, although the Examples window has already code for it. There were some technical issues.
It would be analogous to the online package manager. Practically every programmer nowadays has an internet connection. It wasn't so always. Even with a poor connection it is enough to get a proper connection once to download many online examples and packages which then stay in the user's machine. It is the right way to go with code that only part of the users need.
I did not know this. Thank you I will test this.The last three lines below in the bash terminal output snippet should answer the question if my machine is slow. And this was a make clean all from the command prompt. I like to see all the stuff the shell/terminal throws up as it goes through the copile and link proces :-D Line # 17,18 and 19 will be of interest.
real 2m12.537s user 1m35.501s sys 0m7.744s
Nice. Not slow.
Did you know that rebuilding Lazarus from its Tool menu is even faster because it compiles packages in parallel? The more CPU cores you have, the faster it compiles.
This is true both for your own projects and for a Lazarus rebuild.
OK, my picture in wiki developer pages is also outdated. I guess I should take a new picture of myself.That first video link you sent from 0:06 seconds to 0.16 seconds it sounds like a motorbike accelerating and if we go put wings on that am betting that set of wheels is going to take off just like an airplane. Haha Swedish commentator huh? Whoever who made the video has a great sense of humour :-D
Volvo's 5-cylinder engines have a unique sound, also partly because of its crankshaft angles and exhaust manifold design. Somebody wrote it sounds like a baby-10-cylinder engine.
https://www.youtube.com/watch?v=5FQh79xgaK0
More Volvo exhaust fumes: https://www.youtube.com/watch?v=DybVpNuPKFU Swedish commentator :)
One more out of topic picture, taken today :It will be -40 in the evening in Edmonton this coming Wednesday 21st of December. I have attached a screenshot. Ice age never left places like Nunavit normal daytime temperature is usually below 20 degrees celsious. I have attached a screenshot.
https://drive.google.com/file/d/1-2-42qMzRCKdcVJEPjAMPQCJdvFMtmFq/view
We have almost 40 cm of snow. There was never so much snow in southern Finland in mid-December during my lifetime. Ice age coming!
Temperature early this morning was -23°C.
Oh-kay will do :-)I wanted to test the examples window just like any other stand-alone if I can do that it will save me a lot of time compared to always git fetch then git merge then rebuild the ide (which can be a real pain when you have to do it many times). So how do I get it to run like any other stand alone then?
No, no need to git fetch. Just pull. If you have made a lot of local changes, easy to revert them with git checkout <file> unless you want to keep them. Un like Juha, I always do a make clean before make. Just to be sure. You don't need to do that pull that often, look on gitlab and see if any changes have been made in the specific area you are working in, if not, don't be in too much of a rush to pull.
I was not aware we had a repositery full of online examples somewhere. Or is this yet to be done?
Open the Examples Window, select a project and click "View in Browser".I just tried this and very nice, good stuff!
@JuhaManninen and @dbannon I was wondering since we now have an examples window that works is it really necessary to keep testall?No, not in my opinion. But I was looking for "examples" not "test apps". From memory it uses some depreciated techniques and, probably as you say, clever code. But clever code is often hard to make cross platform and maintain.
@JuhaManninen and @dbannon I was wondering since we now have an examples window that works is it really necessary to keep testall?We classified it as a test instead of an example. It can be added to lcl/tests. Just fix the clear bugs you found, no need to improve it further.
I will try to send you a pull request by this weekend. Since I started working again time has become a very limited commodity for my personal projects.@JuhaManninen and @dbannon I was wondering since we now have an examples window that works is it really necessary to keep testall?We classified it as a test instead of an example. It can be added to lcl/tests. Just fix the clear bugs you found, no need to improve it further.
Even if you plan to improve it more later, you should publish it soon. FOSS development, remember.
Yes, there is plenty of other code to improve, in examples and elsewhere. For example Lazarus project has now 2153 open issues.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/?sort=updated_desc&state=opened
Juha said put it under lcl/tests so that is what I am going to do and I will start working on the "needs work" example projects soon.@JuhaManninen and @dbannon I was wondering since we now have an examples window that works is it really necessary to keep testall?No, not in my opinion. But I was looking for "examples" not "test apps". From memory it uses some depreciated techniques and, probably as you say, clever code. But clever code is often hard to make cross platform and maintain.
If you have some available time, I think, personally, it would be far better spent dealing with some of the "needs work" example projects. They are ones that I thought demonstrated useful techniques but had (usually) minor issues that detracted from the overall "gloss".
Just my humble opinion.
Davo
I find gitlab a great deal harder to work with than github I am afraid. While you can sync the remote from the web view on github, on git lab you need to fetch from the official lazarus and push that up to your own remote gitlab repo. Its very messy IMHO.Yes, I fully agree GitLab can be a royal pain most times. So.. *nuke* my forked repo? Blow it away and start with a fresh clean fork? You are right you know... I have probably messed up my local repo. But how does one fetch/pull from lazarus main/trunk and make changes and push to 'my fork?' If you have any notes now is a good time to share them mate..
Sorry, I don't have my notes available right now so cannot be explicate. The broad idea is that you must try and keep your remote close to the Lazarus one. These changes you made to testall should be contained all in the one directory ? If so, I'd consider tucking them away some where safe locally and cleaning out your repo, and, maybe even your remote one !
I know its not the git way of thinking but your changes will be self contained, easily grafted back into a fresh repo when you have tidied up.
Davo
Oh, you do not have to blow it away, there will definitely be a 'git way' to get to where u need be. But that might take more reading than you want to do ....I think it will be easier to start from scratch instead of wasting any more time trying to fix whatever it was that I must have done that has caused git to hiccup. And then hopefully try and keep everything synced daily. I do not mind reading but right now with work and other daily involvements, time has become scarce and very limited.
Davo
Do I start a new thread or this is related so it is ok to discuss this here?We have the "TestAll" project issues thread. I answer there.