WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V3.1.0 June 4, 2023)

User projects written in or related to FreeBASIC.
Post Reply
Pim Scheffers
Posts: 54
Joined: Jun 29, 2014 17:15

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by Pim Scheffers »

Hello Paul,

Thanks for the update, I really think WinFBE is a wonderful editor.

Some small remarks (just my personal opinions) and not meant as criticism :-)

Peronally I would:
1* default deselect 'Treat Tab as spaces' (really messes up final .bas files with mixed tabs / spaces) and took me a while to find and turn off.
2* make Tab size default to 4 (more standard)
3* add option for accompanying variable to auto-complete 'Next' statement (could enhance code readability in large loops)
4* include FB with GCC 8.x (Why not?)
5* Default font to Consolas in the editor as the Courier font is extremely thin on high RES / DPI screens (mine is 2736x1824).

But again thanks for the hard work.

greets, Pim
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by PaulSquires »

Hi Pim, thanks for the feedback, I really appreciate it. Those defaults were set the way that they are because those are settings that I've used for as many years as I can remember. LOL. I've always preferred spaces over tabs. I have seen many people use Tab = 4 so I will change that default setting.

I use the 5.2 GCC because that is the one from the official release. Some people don't like it when other "non sanctioned" GCC's are used with FB. Personally, I have no problem with using later versions of GCC.

I've used Courier New forever. Consolas is nice because it is a little darker and has a somewhat of a more semi-bold look. Not sure if I'd fall in love with it but I guess it would take a bit of time for it to grow on me. Similar to you, I use a very high DPI (3840 x 2160, it's a 4K laptop). I also set scaling at 350%. One of the best things about WinFBE is it's ability to handle high dpi and scaled displays. Many other editors have a hard time with that.

For your comment #3, do you mean something like this:

For i As Long = 1 To 100

Next i

Basically adding the "i" after the Next statement?
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by paul doe »

PaulSquires wrote:...
Those defaults were set the way that they are because those are settings that I've used for as many years as I can remember. LOL. I've always preferred spaces over tabs. I have seen many people use Tab = 4 so I will change that default setting.
...
They're quite similar to mine, incidentally...
PaulSquires wrote:...
I use the 5.2 GCC because that is the one from the official release. Some people don't like it when other "non sanctioned" GCC's are used with FB. Personally, I have no problem with using later versions of GCC.
...
Beware of this, though. I had troubles compiling shared libs with FreeBasic with any GCC version above 5.x, so I would advice caution here. Going with the 'official' version of GCC is bound to be the safer bet.
PaulSquires wrote: ...
One of the best things about WinFBE is it's ability to handle high dpi and scaled displays. Many other editors have a hard time with that.
...
Indeed. This feature, however, caused some headaches to another member, which got different results when he compiled some code with FbEdit and WinFBE and couldn't explain why. It took me a while to also figure this out XD

As for the fonts, my personal preferences go to Cascadia Code and Fira Mono. Both beautiful and quite readable, especially to tired eyes like mine.

Now going to test the new release. Thanks, Paul. You seem quite dedicated to your userbase, which is very much appreciated =D
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by PaulSquires »

Thanks Paul - I appreciate the support. I love programming and getting feedback from users helps to keep my interest high.

I have already made slight changes to the brace highlighting colors because a user said that it was too faint on their system. I have adjusted the alpha values of the background and borders to make them more visible. I'll have that in the next update. Please let me know if brace highlighting does not work the way that you expect because I haven't used it before in other editors.
Pim Scheffers
Posts: 54
Joined: Jun 29, 2014 17:15

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by Pim Scheffers »

Hello Paul,

I indeed meant a variable after 'Next' for completion.

Code: Select all

For y = 0 to 799
	for x = 0 to 599
		some_function()
	next x <-----
next y <-----
Greets,
Pim
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by paul doe »

PaulSquires wrote:Thanks Paul - I appreciate the support. I love programming and getting feedback from users helps to keep my interest high.

I have already made slight changes to the brace highlighting colors because a user said that it was too faint on their system. I have adjusted the alpha values of the background and borders to make them more visible. I'll have that in the next update. Please let me know if brace highlighting does not work the way that you expect because I haven't used it before in other editors.
Almost there =D

Matching is working correcty for both parens and curly brackets:
Image
Image
But not for square brackets:
Image

Now, functionality wise: the colors are indeed too faint for me to read (with the default color scheme they're almost illegible to me). The simplest solution for this would be to simply make the back color solid and that's that.
For what is worth, the functionality mostly works (save the single exception above) but I find it a little less useful than in other editors. Let me explain: the whole gist of the matching facility is to help you match braces as you're writing code. This is how, for example, FbEdit handles it:
Image
Image
As you can see, when you write a brace, it matches it with the innermost one and highlights both of them (here it just bolds both) so you can see which brace you just closed. That is to say, highlight braces if either of these conditions hold:
  • The caret is at the left char of an opening brace
  • The caret is at the right char of a closing brace
That would be pretty easy to change, since your current implementation matches either brace if they are at the right char of the caret.
Now, some other editors handle it in a more 'fancy' way. Look at this sequence to see how MetaEditor (a language to code experts/indicators/scripts for a trading platform, MetaTrader 4) handles them:
Image
Image
Image
Image
As the last two images show, it simply highlights the innermost brackets, relative to the position of the caret. Also simple but very effective. Works similarly but it highlights a different piece of info (which brace you need to close, as opposed to which brace you've just closed). Either method is fine with me (but perhaps you'll prefer the first one since it's almost already implemented)

I hope the above exposition makes sense to you. If not, just give me a shout ;)
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by PaulSquires »

Hi Paul, thanks for the detailed explanation and images. I think that I understand better the effect that you are looking for. I have uploaded two new exe's to my website if you wish to download and overwrite your existing 32 and 64 bit WinFBE exe's. These new exe's contain code to (hopefully) simulate the MetaTrader brace highlighting. It also contains code to better colorize the brace indicators.

Please let me know if the situation is better, worse, or at least in the ballpark. :-) Thanks.

Download from: https://www.planetsquires.com/pauldoe.rar
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by PaulSquires »

...and I'm not sure why the square brackets are acting that way. If there are spaces after the brackets then the highlighting does not work, whereas if there are no spaces then it does work. That is, [ 123 ] does not work, whereas [123] does work. Not sure why Scintilla treats this differently than, say, parenthesis.
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by paul doe »

PaulSquires wrote:...
Please let me know if the situation is better, worse, or at least in the ballpark. :-) Thanks.

Download from: https://www.planetsquires.com/pauldoe.rar
Thank YOU for all the troubles =D

Almost there! Nested braces don't work as expected, unfortunately:
Image
Now that is what I'd call brace highlighting, indeed LOL

Anyway, perhaps this might help?
https://github.com/jacobslusser/Scintil ... e-Matching
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by paul doe »

PaulSquires wrote:...and I'm not sure why the square brackets are acting that way. If there are spaces after the brackets then the highlighting does not work, whereas if there are no spaces then it does work. That is, [ 123 ] does not work, whereas [123] does work. Not sure why Scintilla treats this differently than, say, parenthesis.
Might it have something to do with this, in modSciLexer.bi?

Code: Select all

#Define SCLEX_CONTAINER                            0      ' // No lexer selected (default)
/' ... '/
#Define SCLEX_VB                                   8      ' // Visual Basic lexer
/' ... '/
'#Define SCLEX_FREEBASIC                            75     ' // FreeBasic lexer
That is, the lexer selected is the VB one, and not the FreeBasic one? VB doesn't use '[' and ']' as braces...
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.1 April 14, 2020)

Post by PaulSquires »

Hi Paul, thanks for the link https://github.com/jacobslusser/Scintil ... e-Matching I ported that code over to FB. I hope it works as you expect. I am uploading a new package momentarily.
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.2 April 16, 2020)

Post by PaulSquires »

Version 2.1.2 (April 16, 2020)

Editor:
- Added: An additional "Code Editor" page of "Environment Options" because the number of options had filled the first Code Editor page.
- Changed: Refactored the logic for displaying brace highlighting to be the same as used by ScintillaNET.
- Changed: Improved the visibility of brace highlighting by changing the alpha values of the highlight colors.
- Fixed: Turning off Brace matching would not uncolor any braces that were active at the time the option was changed.

Visual Designer:
- Fixed: Regression whereby new projects created via template not setting MAIN file and dispaying it in the correct Main Explorer treeview branch.

Download from: https://github.com/PaulSquires/WinFBE/releases

EDIT: I failed to bump up the version number in the EXE to 2.1.2 so the About dialog will unfortunately still show 2.1.1.
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.2 April 16, 2020)

Post by PaulSquires »

In addition to the brace highlighting code, I looked at some of the other code at ScintillaNET and was able to implement the character autocompletion code: https://github.com/jacobslusser/Scintil ... completion

I'll have that in the next update.
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.2 April 16, 2020)

Post by paul doe »

Nice, getting better and better...
I'll give it a shot and report back. Thanks!
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.3 April 18, 2020)

Post by PaulSquires »

Version 2.1.3 (April 18, 2020)
Editor:
- Added: Character Autocompletion option (enabled by default) adapted from code located at: https://github.com/jacobslusser/Scintil ... completion
- Added: New Auto Indentation sub option "Append loop variable to For/Next statement". (disabled by default)

Visual Designer:
- Fixed: Errors occuring in MAIN file for a visual designer project would cause "WinFBE_VD_MAIN.bas" to be loaded into the editor. The correct designated MAIN file is now loaded.
- Fixed: wfxTextBox.SelectionLength() was returning negative lengths.

Download from: https://github.com/PaulSquires/WinFBE/releases
Post Reply