• Welcome to PlanetSquires Forums.
 

WinFBE v3.0.3 (November 24, 2022)

Started by Paul Squires, November 24, 2022, 08:32:42 AM

Previous topic - Next topic

Paul Squires

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

Version 3.0.3 (November 24, 2022)

Editor:
- Fixed bug whereby SaveAs dialog would appear for Quick Run files during the compiling phase.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

Hi All

This is a frivolous question, but here goes.

On the BUTTON, if you place a 48X48 Image AND add TEXT to bottom center of the button, you need to elongate the button a bit to make everything fit nicely.
But then the image has a large border to the top of the button. I saw a setting for Image Margin, but I do not see anything happen if I change it.

Can one reduce the top margin for the Image on the button, or am I again missing the obvious?

-Have a great day gents.

--Peter
-Regards
Peter

Paul Squires

Hi Peter,

I took a quick look. Two things: (1) It looks like Image Margin only takes effect at runtime. Changes to that value do not seem to be reflected at design time within the visual designer; (2) Looks like I have not exposed the SetImagePos (or the ImagePos property) from Jose's underlying CXpButton class that I use for buttons in WinFBE. I need to do that so that you can properly position the image within the button.

' ========================================================================================
' Sets the position of the image
' Parameters:
' - nPos = Position.
'     %XPBI_NONE = &H0                                    ' // No image
'     %XPBI_LEFT = &H1                                    ' // Left (default)
'     %XPBI_RIGHT = &H2                                   ' // Right
'     %XPBI_CENTER = &H4                                  ' // Center
'     %XPBI_VCENTER = &H8                                 ' // Vertically centered
'     %XPBI_TOP = &H10                                    ' // Top
'     %XPBI_BOTTOM = &H20                                 ' // Bottom
'     %XPBI_ABOVE = %XPBI_TOP OR %XPBI_CENTER             ' // Above the text
'     %XPBI_BELOW = %XPBI_BOTTOM OR %XPBI_CENTER          ' // Below the text
'     %XPBI_CENTERCENTER = %XPBI_CENTER OR %XPBI_VCENTER  ' // Center-center (no text)
' - fRedraw = TRUE or FALSE (redraws the button to reflect the changes)
' ========================================================================================
PRIVATE SUB CXpButton.SetImagePos (BYVAL nPos AS LONG, BYVAL fRedraw AS LONG = FALSE)
   m_ImagePos = nPos
   IF fRedraw THEN this.Redraw
END SUB
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Quote from: Petrus Vorster on November 24, 2022, 02:05:53 PMOn the BUTTON, if you place a 48X48 Image AND add TEXT to bottom center of the button, you need to elongate the button a bit to make everything fit nicely.
But then the image has a large border to the top of the button. I saw a setting for Image Margin, but I do not see anything happen if I change it.

Can one reduce the top margin for the Image on the button, or am I again missing the obvious?
Hi Peter,

I have made additions to the Button control to better handle Image positioning. There is now a new "ImageAlign" property.

Here is a download link where you can find a text WinFBE EXE (32 bit only) and the needed necessary new WinFormsX include files (that you would need to copy over your existing ones that are in the compiler's toolchain \inc folder).

Please let me know if I'm on the right path with this change. Hopefully it will make your project's image buttons a little easier to work with.

https://www.planetsquires.com/files/peter_button_image.zip
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Here are two more fixes that will be in version 3.0.4.

- Form files would have their file encoding reset to ANSI on subsequent reloading of the project.

- New Projects created with a Visual Designer template would not have the new Form located in the Normal section of the Explorer treeview.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

QuoteWhen 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.
Hi Paul,
EVENTS:
In a project with 7 forms, only 1 form will not allow Events to be checked for any controls. Checking any Toolbox Event will cause the creation of multiple Event Functions (as was happening previously). Double-clicking multiple times will create multiple Event Functions (the Code Editor doesn't open so unchecking the event creates another Event Function). And for just that form double-clicking will not switch to the code editor - all the remaining forms will switch to the code editor when double-clicking a Toolbox Event.
The subject form is a Tab control Child form. The other Tab control's Child forms do not exhibit this issue.
All the forms in this project were Transformed using the JSON Editor Online.
FORMS:
One of the forms in this project doesn't survive a WinFBE restart. I used the JSON Editor to Transform the form and it opens properly in WinFBE. Make changes, edit, etc. and compile and run - all good. Close WinBFE and restart WinFBE and the Form will no longer display in the Visual Designer and must again be Transformed.
No other projects display the behaviours described above.
Clive Richey

Paul Squires

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Hi Clive,

When you say, "I used the JSON Editor to Transform the form and it opens properly in WinFBE"... what properties in the JSON are you changing?
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

Hi Paul, I change nothing except a comma (,) that is reported as an error and disables the Transform button. Once I change the the comma I am able to transform the code. It is all neatly formatted in the right panel and there I Save To Disk. Although this is where something may get changed because Save To Disk now opens Visual Studio with JSON formatting and editing options (used to open a Save As box). Here I can VS Save As so perhaps that is where the problem is. I've had no luck in stopping VS from intercepting the Save To Disk option on the JSON Editor Online website. Could be a Windows 10 or Chrome setting.
I'll review and report.
Clive Richey

SeaVipe

Hi Paul,
frmTabSearch would not compile because of multiple Event definitions.
The offending control was a listview without any events checked.
frmTabSearch.inc.design had a line:
"events": [
        {
          "name": "Click"
        }
That was the only control's 'events' with a value and it was also the control causing the duplicate definitions so I changed the line to match the other controls on the form:
"events": [And the project compiled.
In Designer, I checked the Click Event and it duplicated the Event of course the compiler error returned.
The project won't compile if any control on frmTabSearch has a Click Event checked.
Clive Richey

Paul Squires

Quote from: SeaVipe on December 10, 2022, 03:47:41 PMHi Paul, I change nothing except a comma (,) that is reported as an error and disables the Transform button. Once I change the the comma I am able to transform the code. It is all neatly formatted in the right panel and there I Save To Disk. Although this is where something may get changed because Save To Disk now opens Visual Studio with JSON formatting and editing options (used to open a Save As box). Here I can VS Save As so perhaps that is where the problem is. I've had no luck in stopping VS from intercepting the Save To Disk option on the JSON Editor Online website. Could be a Windows 10 or Chrome setting.
I'll review and report.

That is odd that VS would intercept the Save As.

Maybe try using a different online JSON editor to change the file?

I have used these in the past:

https://jsonlint.com/

https://jsonformatter.org/
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Would it be possible for you to send me a copy of that frmTabSearch form and the design file?  I can not reproduce the issue with my tests so maybe there is something specific with that file that I am missing.

Also, take a look at the file format that the Form file is being saved in. Is it UTF-16 or ANSI? I fixed a bug related to this but I doubt that it affects your code unless you are using foreign characters.

changes:
- Form files would have their file encoding reset to ANSI on subsequent reloading of the project.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer