Page 1 of 1

FormDesigner - Problems with SplitterGadget

Posted: Thu Feb 06, 2020 11:39 am
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


Re: FormDesigner - Problems with SplitterGadget

Posted: Thu Feb 06, 2020 2:25 pm
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:

Re: FormDesigner - Problems with SplitterGadget

Posted: Tue Feb 11, 2020 10:01 am
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