Bug: Form Designer does not read .pbf files correctly

You need some new stunning features ? Tell us here.
Lothar Schirm
User
User
Posts: 54
Joined: Mon Nov 26, 2012 4:57 pm

Bug: Form Designer does not read .pbf files correctly

Post 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:
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

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

Post by Polo »

Thanks for this precise bug report, I'll have a look!
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

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

Post by Polo »

These issues should be fixed for next release, thanks again! :)
Lothar Schirm
User
User
Posts: 54
Joined: Mon Nov 26, 2012 4:57 pm

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

Post by Lothar Schirm »

Polo, thank you, and good success for your work!
Lothar Schirm
User
User
Posts: 54
Joined: Mon Nov 26, 2012 4:57 pm

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

Post 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.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

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

Post 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 ;)
Lothar Schirm
User
User
Posts: 54
Joined: Mon Nov 26, 2012 4:57 pm

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

Post 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!
Post Reply