PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: Paul Squires on October 16, 2022, 06:32:49 PM

Title: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 16, 2022, 06:32:49 PM
Download:
https://github.com/PaulSquires/WinFBE/releases/tag/3.02-beta-2

NOTE: Download and replace the existing WinFBE EXE's with the two found in this download: https://www.planetsquires.com/files/WinFBE_Peter2.zip  These EXE's should fix a compile time error reported in the posts below.

NOTE: CHANGES ARE BEING MADE TO THE CODETIP AUTOCOMPLETE POPUPS SO RESULTS MAY BE INCONSISTENT

Editor:
- Fixed bug where WinFBE 64-bit only would GPF if currently loaded file is edited by an external editor causing WinFBE to reload the file.
- Fixed bug where focus would be lost from the Find textbox as the user typed a search word and a corresponding match was found.
- Fixed bug where an invalid startup position for the editor would be saved if WinFBE closed while it is minimized to the Windows Taskbar.

Visual Designer:
- MAJOR FILE FORMAT CHANGE: Form data separated from code file and is now saved to external file with *.design file extension.
- When selecting a control from the toolbox and then just clicking on a form (not "drawing" it), it creates a control with a height and width of 0. There are now default sizes for all controls that may be created too small.
- When double-clicking an event in the toolbox, automatically enable that event, create the placeholder (if needed) and switch to that event in the code view.
- When double-clicking a control in design view, automatically switch to the code view for the default event handler for that control (e.g.: the _Click handler if it's a button).
- Listview was not clearing columns/rows when a form is reused (e.g. via popup form).
- Added Listview property (HeaderThemed) to enable/disable theme drawing for the header portion of the Listview.
- The ability to set the default control font name and size for all new controls created for a project, rather than always defaulting to Segoe UI 9pt.
- Added Button control property (AllowFocusRect) to enable/disable drawing the rectangle around the button when it has focus. Only valid if Theme property is False.
- Added Button control property (TextForeColorHot) to set text color when mouse hovers over the button. Only valid if Theme property is False.
- Added Control property (Anchor) which allows you to specify layout resize/movement at design time (uses the WinFBX CLayout class behind the scenes).
- Added Anchor property for Forms.
- Added ChildFormParent property for Forms.
- Added new (mostly complete) internal code parser that creates codetips and autocomplete popups.

Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 16, 2022, 06:35:43 PM
Attached is a sample project showing child forms using Anchor properties.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Joerg B. on October 18, 2022, 11:05:10 AM
Hello Paul

Thank you very much for the second beta version.

... is in the second beta the codetip and the the code completion disabled?

At least with a test project after installation nothing is shown.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 18, 2022, 11:49:49 AM
Yes, as per the first post:

NOTE: CHANGES ARE BEING MADE TO THE CODETIP AUTOCOMPLETE POPUPS SO RESULTS MAY BE INCONSISTENT

Having said that, I have done a lot of work on this since I posted the Beta 2 and I am hoping that by Beta 3 that I should have the majority of that functionality working correctly.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Joerg B. on October 18, 2022, 11:53:57 AM
Hey Paul

oh my.
Who can read is clearly in the advantage.
Obviously, I do not have this advantage. :o
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Petrus Vorster on October 18, 2022, 02:02:50 PM
No worries Joerg.

I am the illeterate one here.
So many times I wished i could just put my foot in my mouth....

Great work Paul!

Regards, Peter
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: philbar on October 18, 2022, 05:11:15 PM
Hi Paul,

This is just one of those "Now what?" moments.

I created a little test project with a few controls in it, and then I added a status bar and a menu. When I compiled the project, the linker failed with:

undefined reference to FRMMAIN_MAINMENU_POPUP@8
undefined reference to FRMMAIN_MAINMENU_CLICK@8
undefined reference to FRMMAIN_STATUSBAR_CLICK@8

When I switched to the Code tab, all three events were right there, so I compiled again without changing anything, and it worked just fine. I played with it and found that the menu and status bar events aren't added to the code until after a compile. I even saved the project and shut down WinFBE, but on restarting, the events weren't in the code until after I tried to compile it.

Note: toolbar events don't have that problem, and when I tried the same thing in Ver. 3.0.1 the events appeared in the code after a few seconds delay.

Anything I can do to make your day.

Phil
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 18, 2022, 09:59:25 PM
Thanks Phil, I appreciate the report. You have noticed something that Peter also experienced and sent me a private email about earlier today. I have coded a fix for the problem that should work. You can download the new EXE's from this link and see if it fixes the problem.

https://www.planetsquires.com/files/WinFBE_Peter.zip

Thanks,
Paul
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: philbar on October 19, 2022, 11:20:58 AM
Thanks for the update, Paul. It's daunting how you can write actual code while I'm still sharpening my pencil.

It's an interesting timing issue. If all my controls are in place on the form before I add the status bar, then the status event doesn't show up in the code until I compile it. The linking error is gone now, by the way.

However, if I add one more control (with an event), or even just add an event to an existing control, after creating the status bar then the status event is inserted along with the control event, and I can go ahead and do whatever action is needed when the status bar is clicked.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 19, 2022, 02:41:39 PM
Quote from: philbar on October 19, 2022, 11:20:58 AMHowever, if I add one more control (with an event), or even just add an event to an existing control, after creating the status bar then the status event is inserted along with the control event, and I can go ahead and do whatever action is needed when the status bar is clicked.

Thanks Phil, I found the source of this problem. In previous WinFBE versions, switching from the visual designer to the code editor would trigger an internal call to "GenerateFormCode" and that function would add any default event code that may be missing from the code editor. In your case, it is the StatusBar event code. The problem was that a certain state flag was not set prior to calling the GenerateFormCode function so it would not generate the StatusBar event handler as one would expect. The GenerateFormCode is also called during the compile process so that is why you saw it show up when you compiled.

This is now fixed and will be in the next update (or you can download the latest EXE's directly from the GitHub repository if you want it sooner).

Thanks!
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: SeaVipe on October 19, 2022, 03:19:43 PM
Hi Paul, Is there a way to determine how much time is left in a session while composing a post? Too many times I've exceeded this timer and clicking 'Post' clears the editor and pops up the login box.
I had a really wordy post for you about .Design files not displaying in BETA-2.  :'(
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 20, 2022, 08:36:07 AM
Quote from: SeaVipe on October 19, 2022, 03:19:43 PMHi Paul, Is there a way to determine how much time is left in a session while composing a post? Too many times I've exceeded this timer and clicking 'Post' clears the editor and pops up the login box.
I had a really wordy post for you about .Design files not displaying in BETA-2.  :'(

I could not not find a setting in the forum software that gives this information but I did find one (and I just enabled it) called: "Enable the saving of Post drafts". I set that option to automatically save draft posts every 30 seconds so hopefully what happened to you will not happen again.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 20, 2022, 12:02:25 PM
I have updated the EXE download link in the initial post because the code generation for the Form's control ID Anchor property was incorrect.    https://www.planetsquires.com/files/WinFBE_Peter2.zip

Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: SeaVipe on October 20, 2022, 06:33:23 PM
Hi Paul,
The attached form file will not load into any version of WinFBE that I currently have on my PC. WinFBE crashes if this file is included in a project or opened as a single file or added to a project.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 20, 2022, 07:53:26 PM
Hi Clive,

I have analyzed your form file and the problem is that for some reason the first "control" that is output is not the Form itself but a Label. The Form data is not output until further down in the file. That is strange because the Form data should always be the first data that is output because the controls get loaded to the pointer created by that form control. If the form control does not exist then the controls will GPF when trying to attach to nothing.

I have manually edited the file to move the form data to the first position and now the file will successfully load. Please try it for yourself to see if it works.

Thanks,
Paul
 
Title: Re: WinFBE v3.0.2 (BETA-2) - UPDATED
Post by: SeaVipe on October 20, 2022, 09:31:42 PM
Thank you, Paul,
I see where you made the manual edits, I would not have thought to change that!
The form file was successfully added to the project but would not compile - Duplicate Definitions. An easy fix using Designer; just deleted the duplicated controls.
Still won't compile though. I had this problem before and recall it was something to do with images. I'll look into it and report back.

Here is the failed compile log:

Failed Compile (Errors 1  Warnings 0  [2022-10-20  04:57:46])

Command Line:
C:\WinFBE_Suite\Toolchains\FreeBASIC-1.09.0-winlibs-gcc-9.3.0\fbc64.exe -m "C:\SRC\DailyJournal\WinFBE_VD_MAIN.bas" "C:\SRC\DailyJournal\TMP73E7.rc" -v -g -exx -s console  -x "C:\SRC\DailyJournal\DailyJournal.exe"

FreeBASIC Compiler - Version 1.09.0 (2021-12-31), built for win64 (64bit)
Copyright (C) 2004-2021 The FreeBASIC development team.
standalone
target:      win64, x86-64, 64bit
backend:      gcc
compiling:    C:\SRC\DailyJournal\WinFBE_VD_MAIN.bas -o C:\SRC\DailyJournal\WinFBE_VD_MAIN.c (main module)
compiling C:  C:\WinFBE_Suite\Toolchains\FreeBASIC-1.09.0-winlibs-gcc-9.3.0\bin\win64\gcc.exe -m64 -march=x86-64 -S -nostdlib -nostdinc -Wall -Wno-unused -Wno-main -Werror-implicit-function-declaration -O0 -fno-strict-aliasing -frounding-math -fno-math-errno -fwrapv -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-format -g -masm=intel "C:\SRC\DailyJournal\WinFBE_VD_MAIN.c" -o "C:\SRC\DailyJournal\WinFBE_VD_MAIN.asm"
assembling:  C:\WinFBE_Suite\Toolchains\FreeBASIC-1.09.0-winlibs-gcc-9.3.0\bin\win64\as.exe --64 "C:\SRC\DailyJournal\WinFBE_VD_MAIN.asm" -o "C:\SRC\DailyJournal\WinFBE_VD_MAIN.o"
compiling rc:              C:\WinFBE_Suite\Toolchains\FreeBASIC-1.09.0-winlibs-gcc-9.3.0\bin\win64\GoRC.exe /ni /nw /o /machine X64 /fo "C:\SRC\DailyJournal\TMP73E7.obj" "C:\SRC\DailyJournal\TMP73E7.rc"
ÿþ

The 2 characters on a separate line are part of the compile log.
Remove frmSettings.inc from the project and it compiles successfully.

UPDATE:
The addition of the frmSettings.inc file duplicated an image in the Image Manager which was causing the compile failure. Using Image Manager the duplicate image was removed and now the project compiles correctly.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 21, 2022, 08:24:54 AM
Hi Clive,

Thanks for the update. I will look at that duplicate images issue as well as adding code to ensure that Form data is output first to the design file.

Thanks!
Paul
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: SeaVipe on October 21, 2022, 05:51:42 PM
Thanks again, Paul, all your hard work is really appreciated!
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 22, 2022, 12:01:35 AM
Tonight I finished the new internal parser. It is awesome and serves to create the lists of subs/functions and TYPES, ENUMS, PROPERTIES, CONSTRUCTORS, DESTRUCTORS, and VARIABLES. It is also a lot faster than the older hacked together version that I was using.

So, I am just about ready to post BETA 3. If you have anything that is critical that needs to be included in this next BETA then now is time to speak up. I will post BETA 3 this weekend assuming that everything goes as planned.

Here is the full list of changes:

Editor:
- Fixed bug where WinFBE 64-bit only would GPF if currently loaded file is edited by an external editor causing WinFBE to reload the file.
- Fixed bug where focus would be lost from the Find textbox as the user typed a search word and a corresponding match was found.
- Fixed bug where an invalid startup position for the editor would be saved if WinFBE closed while it is minimized to the Windows Taskbar.
- Added new internal code parser that creates codetips and autocomplete popups.

Visual Designer:
- MAJOR FILE FORMAT CHANGE: Form data separated from code file and is now saved to external file with *.design file extension.
- When selecting a control from the toolbox and then just clicking on a form (not "drawing" it), it creates a control with a height and width of 0. There are now default sizes for all controls that may be created too small.
- When double-clicking an event in the toolbox, automatically enable that event, create the placeholder (if needed) and switch to that event in the code view.
- When double-clicking a control in design view, automatically switch to the code view for the default event handler for that control (e.g.: the _Click handler if it's a button).
- Listview was not clearing columns/rows when a form is reused (e.g. via popup form).
- Added Listview property (HeaderThemed) to enable/disable theme drawing for the header portion of the Listview.
- The ability to set the default control font name and size for all new controls created for a project, rather than always defaulting to Segoe UI 9pt.
- Added Button control property (AllowFocusRect) to enable/disable drawing the rectangle around the button when it has focus. Only valid if Theme property is False.
- Added Button control property (TextForeColorHot) to set text color when mouse hovers over the button. Only valid if Theme property is False.
- Added Control property (Anchor) which allows you to specify layout resize/movement at design time (uses the WinFBX CLayout class behind the scenes).
- Added Anchor property for Forms.
- Added ChildFormParent property for Forms.
- Added check to prevent duplicate code output into the resource file for images with the same path and filename as this would cause a compile error.
- Added code to ensure that when saving Form data it is output to the JSON design file prior to any Controls on the form, otherwise a GPF may occur when loading.

Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 22, 2022, 08:19:05 AM
Here is something that I am hoping to be able to implement before releasing BETA 3.

When you create a MENU or STATUSBAR, WinFBE will automatically generate code to handle CLICK and POPUP events. The problem is that this is a one-time occurrence. If you go back and add to your menu or statusbar then WinFBE will not add those additions to the generated code. It would be very convenient if the additional items would be added to the existing generated event code.

I will see if I can get this functionality working today.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 22, 2022, 10:03:39 AM
Quote from: Paul Squires on October 22, 2022, 08:19:05 AMHere is something that I am hoping to be able to implement before releasing BETA 3.

When you create a MENU or STATUSBAR, WinFBE will automatically generate code to handle CLICK and POPUP events. The problem is that this is a one-time occurrence. If you go back and add to your menu or statusbar then WinFBE will not add those additions to the generated code. It would be very convenient if the additional items would be added to the existing generated event code.

I will see if I can get this functionality working today.

Well, that was easier to implement than I expected it to be  ;D

This new functionality should make it much easier to deal with creating and modifying MENUS, STATUSBARS, and TOOLBARS.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Petrus Vorster on October 22, 2022, 04:56:30 PM
Hi Paul

Thank you and José for the great amount of work all of this runs on.
Truly impressive.

I have not been able to find any link errors or issues with anchoring so far.

The High-DPI awareness and images quality on buttons and controls just makes everything looks so much better than before.
The panels work perfectly.(thank you for all the examples and help)

Wishlist:[I know I ask a LOT !]
1. A MAXLEN on the Textbox conrol.
2. A right-click property on a listview(or any control for that matter) where you can just add your choices in the property field and it generates the code for a right-click and the actions.
3. A simple output to PDF (I believe like Richard did in Powerbasic)...There may be such a thing already)

Issues:
THE ONLY little issue that I can stil lfind is the TEXT background on FRAME does not change, even if I select a different color.
Image attached. (I am not sure if this happens only on a child form, as I am pretty sure it worked on the FrmMain.

Brilliant stuff gents.

-Peter
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Paul Squires on October 23, 2022, 08:25:18 AM
Hi Peter, thanks for the suggestions.

(1) Text MaxLength property has now been added.

(2) Right click menu popup. This is not as easy at it sounds from within the visual designer so it would have to wait until a future version if possible. Here is an example of how you would display a popup menu from a textbox.

CONST IDM_CUT    = 1000
CONST IDM_COPY   = 1001
CONST IDM_PASTE  = 1002
''
''
Function frmMain_Text1_MouseDown( ByRef sender As wfxTextBox, ByRef e As EventArgs ) As LRESULT
  
   if e.RButton then
  
      Dim hPopUpMenu As HMENU = CreatePopupMenu()
      AppendMenu( hPopUpMenu, MF_ENABLED, IDM_CUT, wstr("Cut") )
      AppendMenu( hPopUpMenu, MF_ENABLED, IDM_COPY, wstr("Copy") )
      AppendMenu( hPopUpMenu, MF_SEPARATOR, 0, "" )
      AppendMenu( hPopUpMenu, MF_ENABLED, IDM_PASTE, wstr("Paste") )

      dim as long nResult
      nResult = TrackPopupMenu( _
                   hPopUpMenu, TPM_RETURNCMD or TPM_NONOTIFY, _
                   e.x, e.y, 0, frmMain.hWindow, 0 )
      DestroyMenu hPopUpMenu

      select case nResult
         case IDM_CUT
            AFXMSG( "CUT" )
         case IDM_COPY
            AFXMSG( "COPY" )
         case IDM_PASTE
            AFXMSG( "PASTE" )
      end select
     
   end if

   Function = 0
End Function

(3) Frame control label text backcolor. I have fixed this in both the visual designer display and in code output. You can not set the Frame forecolor due to Windows limitations.

Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: philbar on October 23, 2022, 04:29:17 PM
About the Frame backcolor: the Option Button and Checkbox have the same problem. I have a dim memory that Windows treats those three things "differently" from other controls. No idea why.

My 2¢ worth.
Title: Re: WinFBE v3.0.2 (BETA-2)
Post by: Petrus Vorster on October 23, 2022, 05:05:33 PM
Thank you Paul.

Right click Menu added to project.
The example works perfectly.


-Regards, Peter