PB 5.11 - Visual Designer - SetGadgetState

You need some new stunning features ? Tell us here.
SniffTheGlove
Enthusiast
Enthusiast
Posts: 122
Joined: Sat Nov 19, 2011 6:51 pm

PB 5.11 - Visual Designer - SetGadgetState

Post by SniffTheGlove »

Documentation for the Visual Designer is quite spares so I do not know if this is a bug or not but shall list it here.

Create a New Form then switch to code view. Paste the following code replacing what is currently in the code window.

Take a note of the code line SetGadgetState(Combo_0,1) in the OpenWindow_0() Procedure

Now goto the Form Menu and switch back Form view and then switch back to code view and you will notice that the SetGadgetState code line is no longer in the code. ie switching views deletes the code line.

Code: Select all

Global Window_0

Global Combo_0


Procedure OpenWindow_0()
  Window_0 = OpenWindow(#PB_Any, 0, 0, 310, 120, "", #PB_Window_SystemMenu)
  Combo_0 = ComboBoxGadget(#PB_Any, 40, 14, 100, 25, #PB_ComboBox_UpperCase)
  AddGadgetItem(Combo_0, -1, "N")
  AddGadgetItem(Combo_0, -1, "S")
  SetGadgetState(Combo_0,1)
EndProcedure

Procedure Window_0_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure


Can anybody else confirm..
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: PB 5.11 - Visual Designer - SetGadgetState

Post by Polo »

Code not supported by the Form Designer is removed.
You should not assume any code apart from what the Designer actually generates will remain.
SniffTheGlove
Enthusiast
Enthusiast
Posts: 122
Joined: Sat Nov 19, 2011 6:51 pm

Re: PB 5.11 - Visual Designer - SetGadgetState

Post by SniffTheGlove »

Polo wrote:Code not supported by the Form Designer is removed.
You should not assume any code apart from what the Designer actually generates will remain.
Thank you Polo for your reply.
Post Reply