WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

User projects written in or related to FreeBASIC.
Post Reply
jj2007
Posts: 2327
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by jj2007 »

cbruce wrote: Jan 26, 2022 3:195. I use bookmarks a lot.
Me too. My first word processor, programmed around 1990 in GfaBasic plus Assembly, had bookmarks. Years after that, I wrote a VBA bookmark macro for M$ Word. Below is what I currently use (for inspiration, Paul - I'm not selling my editor):
- select some text, e.g. #define
- hit Ctrl D (as in most browsers): done, it's there
- they get saved with the file, so that on next opening you have them all

In addition, there is a listbox with the matches of the last search. I swear it's even more useful than the bookmarks ;-)

To implement the persistent bookmarks, the easiest way might be to store them in a textfile built like this:
lesson22.bas ts1234abcd #012309 #045607 #07af20 #0abc09

That would be one entry with 4 bookmarks, starting at e.g. 0123 bytes (hex notation) offset from the file origin, with 9 chars selected. Of course, this is valid only if the source hasn't been edited elsewhere. The ts1234abcd would be a timestamp to check if the file was edited; if yes, the bookmarks would have to be discarded.

Image
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

Thanks jj2007, I am already saving and restoring the bookmarks per file (for Projects) somewhat similar to the approach you mention. I need to implement the listbox of bookmarks. Most likely I'll have it display in the right side panel (the "Explorer panel" area in WInFBE). I'll base my design on the VSCode Bookmarks extension by Alessandro Fragnan. It seems like a reasonable solution.
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

Imortis wrote: Jan 26, 2022 17:00 The new editor looks quite clean. I am interested to try it, both on Windows and Linux. I currently use poseidonFB on linux, but it not quite as stable as I would like. As a result I do most of my work on Windows right now.
Thanks Imortis, I look forward to hearing your impressions on what works well and what doesn't. The new GUI (top menus, tab controls, statusbar, etc) are all custom handwritten Win32 api code so I can now easily customize it in a manner not easily done previously. Still lots of work to do but hopefully the end product will be useful for yourself and FB.
Munair
Posts: 1274
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by Munair »

Imortis wrote: Jan 26, 2022 17:00 The new editor looks quite clean. I am interested to try it, both on Windows and Linux. I currently use poseidonFB on linux, but it not quite as stable as I would like. As a result I do most of my work on Windows right now.
Munair wrote: Jan 26, 2022 8:54 Just wondering, as I'm not a WinFBE user. If the editor targets the Windows API (I'm thinking of the designer), is it actually worth the effort to get it running under Wine? Linux users already have Geany, which uses Scintilla natively. Just my two cents.
I should try Geany. I keep forgetting that is an option.
In my experience Geany is the best option for Linux. It is lightning fast, has built-in support for FreeBASIC (write code, hit F8 and it compiles). And contrary to the Windows version, it has an integrated console window, so any message the compiler would show in the terminal will be displayed directly. Very convenient.
cbruce
Posts: 160
Joined: Sep 12, 2007 19:13
Location: Dallas, Texas

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by cbruce »

Paul, is WinFBE parsing/tokenizing edited code in real-time? If so, then I should express the wish that I make hundreds of time every day....

"I wish that WinFBE had autocomplete for all of the rest of the tokens (variables, consts, types, etc.) in my code as I type!"

Give me a base file that I can populate with any standard tokens that I use often and then dynamically add/remove tokens from a user list as the code is edited.

WinFBE would probably need to maintain a dynamic list for each file being edited.

WinFBE could *not* start with the FB-keyword list and then dynamically switch from FB list to User-token list when it ran out of matches in the FB list... because that would disallow finding shorter user tokens whose characters were the same as the beginning of a longer FB-keyword.

So maybe it could be a single dynamically *merged* list that displayed the FB-keywords differently than the User-tokens:
1. The two sets are displayed in different colors.
2. One set is indented relative to the other set.
3. ???

Some of my variable names are quite long at times - might need a wide listbox. :)

Thanks for "listening", Paul!
CBruce
jj2007
Posts: 2327
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by jj2007 »

I reinstalled WinFBE and tried to compile C:\FreeBasic\examples\win32\GDIPlus\circle.bas
First, a message that the compiler paths were not set.
So I found Options/Environment Options/Compiler Setup and inserted C:\WinFBE_Suite\WinFBE32.exe
I press F5, and it hangs. After a while, being a little bit beyond the n00b phase, I realise that maybe the compiler path should be C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\fbc32.exe instead, and voilà, it does compile now but fails with another cryptic message: linking failed: 'C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\ld.exe' terminated
Trying to copy the error message by right-clicking into that line fails miserably, but after another while I realise that "Compiler log file" might be the place to go. And indeed, here it is, in all its beauty:

Code: Select all

FreeBASIC Compiler - Version 1.07.2 (2020-12-25), built for win32 (32bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win32, 486, 32bit
compiling:    C:\FreeBasic\examples\win32\GDIPlus\circle.bas -o C:\FreeBasic\examples\win32\GDIPlus\circle.asm (main module)
C:\FreeBasic\examples\win32\GDIPlus\circle.bas(42) warning 3(2): Passing different pointer types, at parameter 2 of GDIPFILLELLIPSEI()
C:\FreeBasic\examples\win32\GDIPlus\circle.bas(45) warning 3(2): Passing different pointer types, at parameter 1 of GDIPDELETEBRUSH()
assembling:   C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\as.exe --32 --strip-local-absolute "C:\FreeBasic\examples\win32\GDIPlus\circle.asm" -o "C:\FreeBasic\examples\win32\GDIPlus\circle.o"
linking:      C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\ld.exe -m i386pe -o "C:\FreeBasic\examples\win32\GDIPlus\circle.exe" -subsystem console "C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\lib\win32\fbextra.x" --stack 1048576,1048576 -s -L "C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\lib\win32" -L "." "C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\lib\win32\crt2.o" "C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\lib\win32\crtbegin.o" "C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\lib\win32\fbrt0.o" "C:\FreeBasic\examples\win32\GDIPlus\circle.o" "-(" -lgdiplus -lole32 -lkernel32 -lgdi32 -lmsimg32 -luser32 -lversion -ladvapi32 -limm32 -luuid -loleaut32 -lfb -lgcc -lmsvcrt -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\lib\win32\crtend.o" 
C:\FreeBasic\examples\win32\GDIPlus\circle.o:fake:(.text+0x3f): undefined reference to `FRMWRK::RUN(FRMWRK::CONTEXT*)@4'
linking failed: 'C:\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\ld.exe' terminated with exit code 1
P.S., another little glitch: When you open a source, e.g. ..\FreeBasic\examples\GUI\win32\dialogres\dialog.bas, then close it and click again on Open, the file dialog is somewhere in the wilderness. Sometimes just one folder further up, sometimes at ..\FreeBasic.
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

jj2007 wrote: Jan 27, 2022 8:48 I reinstalled WinFBE and tried to compile C:\FreeBasic\examples\win32\GDIPlus\circle.bas
First, a message that the compiler paths were not set.
Yes, the most recent version failed to set the compiler path on first use. Known issue and already fixed for next release. Sadly, it's been almost a year since the last release (wow, time flies!). That's why am I am making a big push to get a better version released soon.
So I found Options/Environment Options/Compiler Setup and inserted C:\WinFBE_Suite\WinFBE32.exe
As you found out, that exe is the editor, not the compiler :-)
Trying to copy the error message by right-clicking into that line fails miserably, but after another while I realise that "Compiler log file" might be the place to go. And indeed, here it is, in all its beauty:.....
Looks like an error with the particular source code that uses GDI Plus rather than an editor error.
P.S., another little glitch: When you open a source, e.g. ..\FreeBasic\examples\GUI\win32\dialogres\dialog.bas, then close it and click again on Open, the file dialog is somewhere in the wilderness. Sometimes just one folder further up, sometimes at ..\FreeBasic.
Right you are, and for the new version I have already changed the code so that the most previously used open folder is remembered and used when the user invokes subsequent Open dialogs (or Save dialogs).

Thanks for sharing your experience with the current version. As you've seen, there are a number of opportunities to make the editor experience better.
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

cbruce wrote: Jan 27, 2022 2:22 "I wish that WinFBE had autocomplete for all of the rest of the tokens (variables, consts, types, etc.) in my code as I type!"
I hear you. I won't be making any major changes to this part of the editor for the upcoming version because that code requires an almost total rewrite to use better, faster, more efficient parsing and data structures. I need to dedicate a lot if time and thought to the autocomplete and intellisense code. It is certainly something that will be done.... just not for the next version.
jj2007
Posts: 2327
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by jj2007 »

PaulSquires wrote: Jan 27, 2022 13:50Thanks for sharing your experience with the current version. As you've seen, there are a number of opportunities to make the editor experience better.
Congrats, Paul, for your attitude. I wish all software developers were so positive about feedback...!
cbruce
Posts: 160
Joined: Sep 12, 2007 19:13
Location: Dallas, Texas

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by cbruce »

Paul, another small issue concerns accessing overloaded functions from function/explorer lists. No mater which instance of the same function name I pick from the list - WinFBE always takes me to the first instance of that function in the file.

Thanks!
CBruce
wallyg
Posts: 206
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by wallyg »

I typed in the following 2 For Statements. See what was added by the editor after the For statements. Notice the missing "next j"

for i as Integer = 0 to 7
for j as Integer = 0 to 7

next i

I had both "Enable Auto Completion" and "Append Loop Variable to For/Next Statement" turned on.

I also still get an Else or ElseIf statement auto indented to the wrong location. Always farther to the right than it is supposed to. I correct spacing and enter "Enter" at the end of the Else[if] line and it moves to the same wrong place. If I do an arrow down it stays in the correct place. Happens rarely now versus when I first reported this issue.

Wally
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

Thanks Wally, I know about these types of indenting issues and not matching closing For/Next. It is because the matching logic is not smart enough (yet) to match everything up. This happens a lot when, say, you have existing code with maybe a lot of If/EndIf's and then you go and enter a new If/EndIf somewhere inside of that code. The editor will most likely match to the wrong indent level when you press enter after the "If". Yes, it can be a little irritating.

On a more positive note, I have your create custom Explorer nodes/categories now working. Need to do testing tomorrow to ensure that I haven't missed anything. This will hopefully allow you to now be able to create as many categories as you wish in the Explorer to segment your code.
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

cbruce wrote: Jan 27, 2022 21:56 Paul, another small issue concerns accessing overloaded functions from function/explorer lists. No mater which instance of the same function name I pick from the list - WinFBE always takes me to the first instance of that function in the file.
Yes, I definitely need to find a good way to differentiate overloaded functions and ensure that when selected you get taken to the correct location. I have it noted in my to do list and will have something workable for the next update.
PaulSquires
Posts: 940
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Post by PaulSquires »

It has been a while since I've posted any information regarding progress on the next WinFBE update. Here are a couple of screenshots. Still some work to do before being able to put together a full version release.

Here are a couple of screenshots of the Dark & Light Themes. You can switch between them on-the-fly without having to restart the application. The only thing that I don't like is that the RichEdit & Listview controls in the Output window use the standard Windows scrollbars so they don't really fit in with the look and feel of the custom scrollbars elsewhere in the editor. Maybe someday I'll try to replace them with custom scrollbars. Too big of a job for now.

Image

Image
Post Reply