FormDesigner - Problems with SplitterGadget

Post bugs related to the IDE here
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

FormDesigner - Problems with SplitterGadget

Post by Lebostein »

The code runs very well, but the FormDesigner can not show the right pane:

Code: Select all

;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;

Enumeration FormWindow
  #Window_0
EndEnumeration

Enumeration FormGadget
  #ListIcon_0
  #Panel_0
  #Splitter_0
  #Panel_1
  #Splitter_1
EndEnumeration


Procedure OpenWindow_0(x = 0, y = 0, width = 1280, height = 800)
  OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
  ListIconGadget(#ListIcon_0, 8, 8, 1000, 600, "Column 1", 100)
  PanelGadget(#Panel_0, 8, 617, 1000, 175)
  AddGadgetItem(#Panel_0, -1, "Tab 1")
  CloseGadgetList()
  SplitterGadget(#Splitter_0, 8, 8, 1000, 784, #ListIcon_0, #Panel_0)
  SetGadgetState(#Splitter_0, 600)
  PanelGadget(#Panel_1, 1017, 8, 255, 784)
  AddGadgetItem(#Panel_1, -1, "Tab 1")
  CloseGadgetList()
  SplitterGadget(#Splitter_1, 8, 8, 1264, 784, #Splitter_0, #Panel_1, #PB_Splitter_Vertical)
  SetGadgetState(#Splitter_1, 1000)
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

Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: FormDesigner - Problems with SplitterGadget

Post by Marc56us »

This is a nesting error in your code and the form designer can't display it.
See objects tree: the panel you can't see (Panel_1 ?) is a member of a splitter (Splitter_0) that is not member of any containing object. (ie: panel)
Left click on his name on Objects Tab and change parent object (or try to drag'n'drop it on tree)

:wink:
Last edited by Marc56us on Sun Mar 08, 2020 10:05 am, edited 1 time in total.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: FormDesigner - Problems with SplitterGadget

Post by Lebostein »

Marc56us wrote:This is a nesting error in your code
I see no nesting error in the code...

#Splitter_0 is a member of #Splitter_1:
SplitterGadget(#Splitter_1, 8, 8, 1264, 784, #Splitter_0, #Panel_1, #PB_Splitter_Vertical)

#Splitter_0 contains #ListIcon_0 and #Panel_0:
SplitterGadget(#Splitter_0, 8, 8, 1000, 784, #ListIcon_0, #Panel_0)

All OK!

Try the code without form designer!
Copy the lines above in a new project, add these two lines and press F5:

Code: Select all

OpenWindow_0()
Repeat: Until WindowEvent() = #PB_Event_CloseWindow
Post Reply