PaulSquires / WinFBE

FreeBASIC Editor and Visual Designer for Windows
https://www.planetsquires.com
GNU General Public License v3.0
156 stars 39 forks source link

bug: once StatusBar panel added, cannot be removed or app will not compile #22

Closed ghost closed 3 years ago

ghost commented 3 years ago

RECREATE: Create a new form app. In designer, right-click form client area, choose Statusbar Editor. in dialog (note that Display on Form already checked) Click Add. Panel added. Click OK. Press F5 to compile/run. Note panel present. Close app. Go back into Statusbar editor, highlight panel and press Delete. Entry removed from list. Press OK. Panel still present in status bar. Go into editor, uncheck Display on Form. Press OK. panel disappears. Press F5 to compiile/run. Compile errors. ERROR: FreeBASIC Compiler - Version 1.07.1 (2020-05-19), built for win32 (32bit) Copyright (C) 2004-2019 The FreeBASIC development team. standalone target: win32, 486, 32bit compiling: F:\Projects\FreeBASIC\WinFBE_VD_MAIN.bas -o F:\Projects\FreeBASIC\WinFBE_VD_MAIN.asm (main module) F:\Projects\FreeBASIC\frmMain.inc(117) error 59: Illegal specification, at parameter 1 (sender) of frmMain_StatusBar_Click() F:\Projects\FreeBASIC\frmMain.inc(118) error 265: Symbol not a CLASS, ENUM, TYPE or UNION type, before '.' EXPECTED: Should be able to remove panel from status bar Should be able to compile without Display on Form checked WORKAROUND: Re-check Display on Form, and continue development until fix is available VERSION: 2.1.8

PaulSquires commented 3 years ago

Two issues here: (1) Fixed: Error not being able to fully delete the last remaining Statusbar Panel, and (2) The compile error: Not sure best approach to "fix" this one because when a Statusbar is created there is default boiler plate code added to the editor in order to make life for the programmer easier. In this case, code is added that allows the user to add user code to handle clicking on individual panels. This is similar to boiler plate code added for the menu Editor in order to create a template that the user can add code to in order to respond to menu selections. The easiest solution is for the programmer to be aware that if he removes a Statusbar then he must either comment out the generated Statusbar_Click code or delete it all together.

ghost commented 3 years ago

If there is something left that the user can find and comment out in order to compile, that would be workable.

With my current copy, I've just now tried unchecking 'display status bar on form', and commenting out the click event, but I get a bunch of errors in code that is not mine that can't find pStatusBar.

PaulSquires commented 3 years ago

If there is something left that the user can find and comment out in order to compile, that would be workable.

With my current copy, I've just now tried unchecking 'display status bar on form', and commenting out the click event, but I get a bunch of errors in code that is not mine that can't find pStatusBar.

Thanks - yes, I am noticing that also. I am tracking down the source of why the pStatusBar pointer is getting output to the code even though no Statusbar should now be present in the generated code. I'll have this fixed before the next WinFBE upload.

PaulSquires commented 3 years ago

The pStatusBar pointer bug is now fixed. Error in WinFormsX library code, in wfxApplication.inc line 267 needed to be changed to:

ifdef CODEGEN_STATUSBAR

ghost commented 3 years ago

Thanks!

The pStatusBar pointer bug is now fixed. Error in WinFormsX library code, in wfxApplication.inc line 267 needed to be changed to:

ifdef CODEGEN_STATUSBAR