Page 1 of 1

Bug: Form Designer does not read .pbf files correctly

Posted: Mon Nov 26, 2012 6:00 pm
by Lothar Schirm
Form Designer 5.00 beta 3 shipped with PureBasic 5.00 does not read .pbf files correctly in some cases:

1. If the .pbf file contains a button with caption "=" (e.g. in a program for a calculator where this button shall be used to display the result), the code is incorrect, see below.

2. If the .pbf file contains an editor gadget with text including commas, the text is not shown completely.

I have summarized the two errors in a short file Test.pbf. The file has been created correctly using the Form Designer. Code:

Code: Select all

; Form Designer for Purebasic - 5.0
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.

Enumeration #PB_Compiler_EnumerationValue
  #Window_0
EndEnumeration

Enumeration #PB_Compiler_EnumerationValue
  #Button_0
  #Editor_0
EndEnumeration

Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 600, 400, "Test.pbf", #PB_Window_SystemMenu)
  ButtonGadget(#Button_0, 40, 30, 40, 20, "=")
  EditorGadget(#Editor_0, 30, 90, 480, 130)
  AddGadgetItem(#Editor_0, -1, "This text line will be shown correctly if Test.pbf is opend by the Form Designer again - ")
  AddGadgetItem(#Editor_0, -1, "this text line, however, not because it contains comma.")
EndProcedure


When this file is opened again by the Form Designer, the Form Designer creates the following code view:

Code: Select all

Global ButtonGadget(#Button_0, 40, 30, 40, 20, "

Enumeration #PB_Compiler_EnumerationValue
  #Window_0
EndEnumeration

Enumeration #PB_Compiler_EnumerationValue
  #Editor_0
EndEnumeration

Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 600, 400, "Test.pbf", #PB_Window_SystemMenu)
  ButtonGadget(#Button_0, 40, 30, 40, 20, " = ButtonGadget(#PB_Any, 40, 30, 40, 20, "=")
  EditorGadget(#Editor_0, 30, 90, 480, 130)
  AddGadgetItem(#Editor_0, -1, "This text line will be shown correctly if Test.pbf is opend by the Form Designer again - ")
  AddGadgetItem(#Editor_0, -1, "this text lin")
EndProcedure
If you change from the Code View to the Design View - Button_0 Property Window, you see that the checkbox "PB Any" is marked. (When creating the .pbf file, it was not marked.) The variable name of Button_0 has changed to ButtonGadget(#Button_0, 40, 30, 40, 20, ". :shock:

Re: Bug: Form Designer does not read .pbf files correctly

Posted: Mon Nov 26, 2012 7:14 pm
by Polo
Thanks for this precise bug report, I'll have a look!

Re: Bug: Form Designer does not read .pbf files correctly

Posted: Tue Nov 27, 2012 7:17 pm
by Polo
These issues should be fixed for next release, thanks again! :)

Re: Bug: Form Designer does not read .pbf files correctly

Posted: Wed Nov 28, 2012 12:19 pm
by Lothar Schirm
Polo, thank you, and good success for your work!

Re: Bug: Form Designer does not read .pbf files correctly

Posted: Sun Dec 16, 2012 5:24 pm
by Lothar Schirm
@Polo,

error number 2 relating to text including commas is also true for text gadgets. I did not check if this also the case for other gadgets, but it seems to be a general problem.

Re: Bug: Form Designer does not read .pbf files correctly

Posted: Sun Dec 16, 2012 11:44 pm
by Polo
Lothar Schirm wrote:@Polo,

error number 2 relating to text including commas is also true for text gadgets. I did not check if this also the case for other gadgets, but it seems to be a general problem.
It probably is but should be fixed for next version ;)

Re: Bug: Form Designer does not read .pbf files correctly

Posted: Tue Dec 25, 2012 6:17 pm
by Lothar Schirm
@Polo,

I have just seen in PureBasic 5.10 beta 1 that the first error (button with caption "=") ist still existing. I also wanted to check if the other error (text with commas) is fixed, but the IDE crashed again (see my Bug report in Bugs Windows - 5.10 beta 1 crashed "forever").

Nevertheless, the new version of the IDE with the integrated Form Designer is a very nice concept, thanks to you and to the PureBasis team! Merry Christmas!