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
PaulSquires
Posts: 938
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 »

wallyg wrote:A simple addition that would be nice is that on the Tool Bar that is at the top of the window, you have an Icon for SAVE of the current file. Would it be possible to add an additional Icon for File Menu's submenu SAVE ALL?
There will not be a toolbar in the new update. Keyboard shortcuts or menu selection will be your options going forward much like the popular editors available on the market. I know that will be a little bit of an adjustment for some folks but you get used to it very quickly. Areas of the StatusBar are still click-able allowing you to do actions like select build configuration, goto line, change encoding, set file type, etc.

Also, if you are coding within a Project then all files get automatically saved every time you do a compile (unless you have that autosave unchecked in the Environment Options).
As I have mentioned before I use GLADE all the time. It does have one nice feature I was wondering if it was possible to add to WinFBE. Every XXX seconds (user settable - default is 5 seconds) if the text has been modified since the last Save/autoSave the System automatically saves the current source code to a file with the ~ appended to the suffix. When Glade starts up it checks to see if the *.*~ file exists, if it does, it checks the date on the ~file versus the non~file and if the ~file is newer asks the user if they want to use the *.* file verses the *.*~ file.
I do like that idea and I have made note of it and will try my best to implement it.
miilvyxg
Posts: 193
Joined: Dec 07, 2021 6:51

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

Post by miilvyxg »

wallyg wrote:As I have mentioned before I use GLADE all the time. It does have one nice feature I was wondering if it was possible to add to WinFBE. Every XXX seconds (user settable - default is 5 seconds) if the text has been modified since the last Save/autoSave the System automatically saves the current source code to a file with the ~ appended to the suffix. When Glade starts up it checks to see if the *.*~ file exists, if it does, it checks the date on the ~file versus the non~file and if the ~file is newer asks the user if they want to use the *.* file verses the *.*~ file.
filename~ is the convention for backup file on Linux. filename~ is the backup file of filename. It's indeed two stage save. First filename be renamed to filename~ and the changed buffer will be saved as filename. JEdit does this, too.
PaulSquires
Posts: 938
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 »

wallyg wrote:...one nice feature I was wondering if it was possible to add to WinFBE. Every XXX seconds (user settable - default is 5 seconds) if the text has been modified since the last Save/autoSave the System automatically saves the current source code to a file with the ~ appended to the suffix. When Glade starts up it checks to see if the *.*~ file exists, if it does, it checks the date on the ~file versus the non~file and if the ~file is newer asks the user if they want to use the *.* file verses the *.*~ file.
Auto Save (and crash recovery) of files (thanks to Wallyg for this inspiration)

I analyzed how it works in Glade and also JEdit. They both deal with Auto Save very similarly.

This turned out to be a really cool feature and works perfectly for Project and non-project based files alike. The "Auto Save" option is now available on the File menu (similar to VSCode) so it is very easy to turn and off. This will all be in the next WinFBE update.

When auto save is enabled, every 10 seconds a check is performed to determine if the editor text has been modified further since the last AutoSave was done. If yes, then WinFBE automatically saves the current source code to a filename wrapped in # characters. For example, if the source filename is C:\FB\EXAMPLE.BAS then the auto saved file is called C:\FB\#EXAMPLE.BAS#. Later in a subsequent editing session, when WinFBE tries to load the original file it checks to see if the ### wrapped file exists and if it does, it checks the date on both files. If the auto saved #filename# is newer then WinFBE asks the user if they want to use the new auto saved version.

This feature is fantastic for situations where your computer has a power outage or WinFBE crashes prior to saving your unsaved edits.

This feature is also different than "backup". As Wallyg described in his FreeBasic forum post, he mentioned that Glade attaches a trailing tilde ~ to its auto save file. In actuality, Glade uses the ~ when backing up a file (so does JEdit). Both Glade and JEdit use the ### approach when handling auto save. Automatic backup of files is a different topic and editors approach this differently with some backing up a file when it is first loaded only, and others whenever the file is saved. Of course, some editors allow for multiple backups EXAMPLE.BAS~1, EXAMPLE.BAS~2, EXAMPLE.BAS~3, etc. I am on the fence as to whether I want to implement Backup into WinFBE. I feel that auto save is sufficient and leave the backup and archiving of source code files to the user so that they can handle it however they wish.

Image
wallyg
Posts: 204
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 »

This sounds like a very valuable addition.

What about the situation where I have 10 files open and working on all 10 and something happens bad. The next time I start WinFBE will I get 10 separate questions? Maybe add a third/fourth button for "Save All" and "Ignore All" or some shortcut for multiple files that are going to get the same question with the same response.

Because of this feature, I no longer do any saves in Glade until the end of the session, which in WinFBE could mean I have touched 100s of routines over an extended period of time. Especially if you eventually give me "replace texta by textb" across all files in the project" hint hint hint

I vote for the default to be ON when WinFBE starts.

Wally
PaulSquires
Posts: 938
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 »

wallyg wrote:What about the situation where I have 10 files open and working on all 10 and something happens bad. The next time I start WinFBE will I get 10 separate questions? Maybe add a third/fourth button for "Save All" and "Ignore All" or some shortcut for multiple files that are going to get the same question with the same response.
Currently, yes, you will get a separate message box for each file. I see your point and I'll come up with a better user experience solution than separate message boxes. Maybe a listbox showing all of the autosaved files and then the option to use all of them or ignore them. Then there's the question if the user only wants to re-load some and not all of those auto saves. Let me think about this one.
Especially if you eventually give me "replace texta by textb" across all files in the project" hint hint hint
Noted. I have to dive into the "Find in Files" code anyway so looking to add "Replace in Files" certainly sounds like a good idea. :-)
I vote for the default to be ON when WinFBE starts.
When the WinFBE config files is first created in the eventual new version release, the Auto Save feature will be ON by default. The user can easily uncheck this option if they wish from the File menu but I agree with you that having it on is much better. There is very little performance penalty for using the feature and the upsides certainly outweigh the downsides.
Michele_Baldi
Posts: 1
Joined: Jan 23, 2022 17:36

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

Post by Michele_Baldi »

Paul,
You did a great, great job.
For any help I am available as a beta tester or other as you prefer ...
With a graphical debugger it will be a professional job!
Thank you so much !!!
wallyg
Posts: 204
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 was wondering if it would be possible when I save a file if those areas that were collapsed (ie the leading "-" is now "+" ) could be saved and restored the next time that file was opened? Not a biggie but would be useful for areas of the file that are not "interesting" during the current debugging time frame.

Wally
PaulSquires
Posts: 938
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 »

Michele_Baldi wrote: Jan 23, 2022 17:43 Paul,
You did a great, great job.
For any help I am available as a beta tester or other as you prefer ...
With a graphical debugger it will be a professional job!
Thank you so much !!!
Thanks! Still lots of work to do. :-) A debugger would be a big job to integrate but something like FBDebugger would be cool. Maybe someday.
PaulSquires
Posts: 938
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 »

wallyg wrote: Jan 25, 2022 22:41 I was wondering if it would be possible when I save a file if those areas that were collapsed (ie the leading "-" is now "+" ) could be saved and restored the next time that file was opened? Not a biggie but would be useful for areas of the file that are not "interesting" during the current debugging time frame.

Wally
Hi Wally, you have good timing. I was working on the folding code today because it is something that I don't use at all. I did change the functionality of one of the folding actions. From the change log:

- Changed logic of "Toggle Current and All Below" folding to now work on fold levels inside a function that of greater depth than the fold level being toggle. Previously, this function only worked on base level fold points (basically, the sub/function line and all other sub/functions below it in the source code). This new logic makes it easier to fold/unfold code blocks from deep with a particular function making it somewhat more usable in practice than the old logic.

On first thought, I am pretty sure that I can implement your save/restore code folding points suggestion.

While I have your ear, I can let you know that I have implemented multiple selection on the Explorer list allowing you to select multiple nodes and perform actions on them. From the change log:

- The Explorer window now allows for multiple nodes to be selected (via Ctrl or Shift) and to popup right-click menu to perform actions on the group of selected nodes (for example, to re-designate files to different FileTypes, etc).

I know that this approach may not be as sexy as the old drag & drop but in practice it is much more usable.

Also, today I started work on your suggestion to add user defined Explorer nodes. Those nodes will be accessible from the right-click popup menu mentioned above. I am only about half way through coding it but it looks like a good addition.
PaulSquires
Posts: 938
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 »

Here is a running list of the more significant changes to the editor. I'll post it here in the hopes that it might trigger some ideas or suggestions for features that I haven't thought of.

- Complete re-write of main editor UI to have a look and feel more in line with modern code editors.
- Updated to Scintilla Version 5.1.5 (Dec 7, 2021). Also, switched to use Lexilla.dll with custom lexer called lexWinFBE that handles the FreeBasic lexing.
- All new Theme system. All colors (RGB) can be edited in external .theme files found in the \themes folder.
- Added Windows API keywords and syntax highlighting.
- New option to save/restore "session". Allow reloading and showing of files active during most previous editor use. Will reload a project should a project had been active.
- New keyboard binding mapping allowing the user to choose their own keyboard shortcuts for various editor functions.
- New Auto Save functionality. When enabled, unsaved files will be periodically saved to temporary files. In the event of crash, these files will be ask to be used when the editor next attemspts to load the crashed file.
- New Font option (Environment Options / Colors and Fonts) to allow for extra spacing between editor lines on screen.
- Added Load Session and Save Session. Allows user to save editor state (open windows, editing position, selected compiler) and restore them upon next use.
- Added Environment option to automatically load the last used Session when the editor starts. If the last Session saved was a Project, then the project will be loaded.
- Re-worked portions of Code Folding to make it visually more appealing.
- Changed some default Code Folding keyboard shortcuts because "Alt" based shortcut would sometimes invoke Windows system functionality.
- Changed logic of "Toggle Current and All Below" folding to now work on fold levels inside a function that of greater depth than the fold level being toggle. Previously, this function only worked on base level fold points (basically, the sub/function line and all other sub/functions below it in the source code). This new logic makes it easier to fold/unfold code blocks from deep with a particular function making it somewhat more usable in practice than the old logic.
- Greatly increased the Font selector combobox (Environment Options / Colors and Fonts) so it should be easier now to pick fonts that have long descriptive names.
- Multiple code editor text selections is now enabled. Hold CTRL and highlight multiple areas of text.
- Editor will try to gracefully fallback amongst various monospaced fonts should the previously selected font in the config file no longer exist. This can occur, for example, if you switch to different computers without the same fonts installed, or you switch between Windows and Linux (Wine).
- Replace All actions are now batched allowing Ctrl+Z Undo to undo all of the changes made, not just the last one.
- Changed Replace keyboard short from Ctrl+R to Ctrl+H to be in line with the vast number of other editors that use the Ctrl+H shortcut.
- Added the forward slash ('/') key shortcut for commenting lines (in addition to the current 'B' key option).
- Removed the ancient Win32 api help file and the menu option to invoke it.
- Removed main editor Toolbar to be consistent with most other modern editors that have foregone the use of a dedicated toolbar.
- When files added to a Project, newly added *.BAS files are now treated as NORMAL rather than MODULE files.
- Tweaked "Check for Updates" to provide more reliable reporting in the event of failure to retrieve information from the server.
- Tweaked the F3 and Shift+F3 accelerator that will Find Next/Prev the last highlighted search text. It is now more consistent by not being reset to a different search term under some situations.
- Re-worked the Find/Replace popup dialog to be visually more appealing and to work better with keyboard. Added keyboard shortcuts for some find/replace actions (for example, Ctrl+Alt+Enter to Replace All).
- Added keyboard shortcut "CTRL+~" (ctrl+tilde) to allow you to move keyboard focus back to the active editing window. This is useful, for example, for jumping between the editing window and the Find/Replace dialog.
- Added keyboard shortcuts to move to next and move to previous compiler errors. This is a quick way to jump to and fix errors without having to use your mouse to double click the compiler error message in the Output window.
- The Explorer window now allows for multiple nodes to be selected (via Ctrl or Shift) and to popup right-click menu to perform actions on the group of selected nodes (for example, to re-designate files to different FileTypes, etc).
PaulSquires
Posts: 938
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 »

Because I now do a lot of work using Linux, I am trying my best to get WinFBE to work as well under Wine as possible. So far, so good. I have had to disable a couple of features like translucent windows that do not seem to respond well under Wine, but that change is merely cosmetic rather than impacting core functionality.

I will be implementing custom scroll bars for the Scintilla editing control. I implemented them in a different project so I just need to migrate most of that code over to WinFBE.

Here is how WinFBE currently looks under Kubuntu 21.10 (Wine 7)

Image
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, I already owe you a huge amount of thanks for WinFBE; I would not be productive in FreeBASIC without it.... And now you increase your good karma by making WinFBE even better and enabling this GUI nerd to finally be able to do something useful on Linux! (And that is a nice looking UI also!)

Here's my current wishlist:

1. An indicator for a file's current EOL type would be handy. Maybe [Edit][End of Line Character Conversion] that looks like [Edit][File Encoding] instead of the current [Convert to ???] selections. The user gets the choice of EOL format with an indicator dot that shows the current EOL in use for that file.

2. Find/replace would be stronger if the textboxes were replaced with single line combo boxes with pulldowns that each kept their last 15 or 20 items available for selection. (And keep that data across sessions?)

3. (bug?) - Replace currently ignores [in selection] when doing [replace all] and just replaces all occurrences in the file.
A. It would also be proper if [replace next] would respect the limits of [in selection].

4. It would be nice if an active [Find] did *NOT* automatically jump into a file when switching tabs to another file - (I lose my spots in files (and train of thought) ALL the time!)).

5. I use bookmarks a lot. It would be really nice if the positioning of the retrieved bookmark lines was consistent... ie. when I hit next/prev bookmark, that line is always positioned as first row on screen, or middle row on screen. That way, I'm not scanning the screen looking for where the bookmark is each time. Also, it comes in very handy to "overlay", and allow for visual compare of, a couple of pieces of code.

6. Bookmarks could also be made much more useful if I had a picker for my current bookmarks (line# and initial text from that line).

7. If [clear bookmarks] only affects the current file, then it would be good to also keep bookmarks across sessions.... If changes were made outside of WinFBE that invalidated the bookmark positions - I could just clear them for that file.

8. I use the [file list] and [function list] combobox pulldowns *ALL* the time to jump around quickly.
A. Looking at your screenshot... am I losing that functionality?
B. If there is some way that I will still be accessing those lists, ([Explorer] I guess?), I would really prefer an option to have them list the files/functions in the order they are found in the tabs/code instead of being sorted alphabetically. It messes me up when I have to change *coordinate systems" between where I know these things are in the interface/file versus where they are in their respective lists.

9. That little combobox that displays (and allows me to choose) the current build configuration has saved me a *lot* of time. I often switch builds for different reasons, and sometimes... well, the only thing that has saved me a lot of troubleshooting at times is *seeing* the current build and going, "Whoa!"... set the correct build for the current purpose and get back to work. It would be good (for me) if that was still a visible item in the main UI of the new version.
A. Crazy idea #1: (optionally) give us a UI row and let us select some items from config settings to display all the time.

10. (bug?) - Syntax highlighting on a line fails for all keywords/characters after occurrence of a "#" used as a file reference. Examples:
put_result = put(#f, ,gCtxt())
print #dump_tables_fnum, hex(ibyt, 2); "trash string"
(There may be another character that does this to me also, but I cannot recollect what it is at the moment.)

Thanks a *LOT* !!!
CBruce
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 »

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.
PaulSquires
Posts: 938
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 26, 2022 3:19 Paul, I already owe you a huge amount of thanks for WinFBE; I would not be productive in FreeBASIC without it.... And now you increase your good karma by making WinFBE even better and enabling this GUI nerd to finally be able to do something useful on Linux! (And that is a nice looking UI also!)
Awesome thanks! I am looking forward to getting the new version out. As Munair points out, yes the editor is WinAPI based so the visual designer may not be a hit on Linux, but the designer is just one part of the editor. Sure, I doubt that many Linux users will give WinFBE a try on Linux because they already have their favorite native Linux editor. That makes sense. Maybe the whole Linux/Wine thing will eventually just serve as a personal learning experience for myself. I'm good with that.
An indicator for a file's current EOL type would be handy. Maybe [Edit][End of Line Character Conversion] that looks like [Edit][File Encoding] instead of the current [Convert to ???] selections. The user gets the choice of EOL format with an indicator dot that shows the current EOL in use for that file.
I have the line encoding moved to the statusbar (bottom right corner) and a popup menu will show when clicked on that allows you to change the file's line ending encoding. The current encoding is selected "with an indicator dot" on the popup menu.
Find/replace would be stronger if the textboxes were replaced with single line combo boxes with pulldowns that each kept their last 15 or 20 items available for selection. (And keep that data across sessions?)
Good idea. I have made a note of this and will implement it. VSCode handles this sort of thing by simply using your up/down arrow keys to cycle through the find/replace history (rather than dropdown comboboxes). I'll see what I can do.
(bug?) - Replace currently ignores [in selection] when doing [replace all] and just replaces all occurrences in the file.
A. It would also be proper if [replace next] would respect the limits of [in selection].
Most likely bug. I totally rewrote the whole find and find/replace code related to Selections. The logic when a selection would be active was wrong. All fixed now.
It would be nice if an active [Find] did *NOT* automatically jump into a file when switching tabs to another file - (I lose my spots in files (and train of thought) ALL the time!)).
Interesting. I thought that the automatic search would be a nice feature rather than a problem when switching edit windows. I can certainly disable this type of behaviour.
I use bookmarks a lot. It would be really nice if the positioning of the retrieved bookmark lines was consistent... ie. when I hit next/prev bookmark, that line is always positioned as first row on screen, or middle row on screen. That way, I'm not scanning the screen looking for where the bookmark is each time. Also, it comes in very handy to "overlay", and allow for visual compare of, a couple of pieces of code.
I'll check this. If I remember correctly, I wanted the edit control to position as needed especially if the bookmark was already visually on the screen. I can certainly reposition the screen to a consistent location when a bookmark is invoked.
Bookmarks could also be made much more useful if I had a picker for my current bookmarks (line# and initial text from that line).
I had never thought of this. I will take a look to see what I can implement.
]7. If [clear bookmarks] only affects the current file, then it would be good to also keep bookmarks across sessions.... If changes were made outside of WinFBE that invalidated the bookmark positions - I could just clear them for that file.
The new load/save sessions feature saves and restores bookmark positions. Projects have always saved/restored bookmarks.
I use the [file list] and [function list] combobox pulldowns *ALL* the time to jump around quickly.
Those are gone now. I have centralized in one place (Function List). It was previously in 3 different places. I will have several different ways to display the files and functions (sorted/unsorted, etc) as well as a search box.
That little combobox that displays (and allows me to choose) the current build configuration has saved me a *lot* of time. I often switch builds for different reasons, and sometimes... well, the only thing that has saved me a lot of troubleshooting at times is *seeing* the current build and going, "Whoa!"... set the correct build for the current purpose and get back to work. It would be good (for me) if that was still a visible item in the main UI of the new version.
It's still there, albeit now located in the bottom left of the statusbar. Clicking on it allows you to change the build configuration.
(bug?) - Syntax highlighting on a line fails for all keywords/characters after occurrence of a "#" used as a file reference. Examples:
put_result = put(#f, ,gCtxt())
print #dump_tables_fnum, hex(ibyt, 2); "trash string"
Yes, this is a limitation of the previous Scintilla lexer. I now have a dedicated lexer that I can tweak in order to fix things like this.
Thanks a *LOT* !!!
CBruce
You're very welcome :-) I'm sure that there will be lots of discussion once the new version is released and then further changes and tweaks made based on feedback.
Imortis
Moderator
Posts: 1858
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

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

Post by Imortis »

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.
Post Reply