Page 1 of 1

#PB_Splitter_FirstMinimumSize doesn't work for vertical spit

Posted: Fri Sep 25, 2020 11:40 am
by Joris
Hi,

As the title says :
The #PB_Splitter_FirstMinimumSize doesn't work for vertical spit.

Greatings.

Code: Select all

Procedure Build_Window_1(x = 0, y = 0, width = 1400, height = 700)
  Window_1 = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, width, height, "", #PB_Window_SystemMenu |#PB_Window_ScreenCentered)
  btn_000 = ButtonGadget(#PB_Any,  5,  15,  90,  20, "Read Clipboard")
  btn_001 = ButtonGadget(#PB_Any,  5,  43,  90,  20, "gadget_001")
  btn_002 = ButtonGadget(#PB_Any,  5,  71,  90,  20, "gadget_002")
  btn_003 = ButtonGadget(#PB_Any,  5,  99,  90,  20, "gadget_003")
  lvi_004 = ListViewGadget(#PB_Any, 0,0,0,0)
  lci_005 = ListIconGadget(#PB_Any, 0,0,0,0, "0", 70, #PB_ListIcon_MultiSelect |#PB_ListIcon_GridLines)
    
  splt=SplitterGadget(#PB_Any, 110, 5,width-120, height -20, lvi_004, lci_005, #PB_Splitter_Separator |#PB_Splitter_Vertical)
  SetGadgetAttribute(splt, #PB_Splitter_FirstMinimumSize, 50) ;minimum hoogte onderste lijst
  ;ResizeGadget(splt,#PB_Ignore, #PB_Ignore, WindowWidth(Window_1)-220, #PB_Ignore) 
  
EndProcedure
Procedure EventLoop()
 
  Build_Window_1()
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_Gadget
        Select EventGadget()
          Case btn_000 :  
          Case btn_001 : 
          Case btn_002 :
          Case btn_003 :
          Case lvi_004 : 
          Case lci_005 :  
        EndSelect
      Case #PB_Event_Menu
      Case #PB_Event_CloseWindow
        CloseWindow(#PB_All)
        End
    EndSelect
  ForEver
EndProcedure
;************************************************************************
EventLoop()

Re: #PB_Splitter_FirstMinimumSize doesn't work for vertical

Posted: Tue Sep 29, 2020 3:06 am
by Joris
Second not working example.

Code: Select all

Global.i lci_005, lci_006, splt, Window_1 

Procedure Build_Window_1(x = 0, y = 0, width = 1200, height = 700)
  Window_1 = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, width, height, "", #PB_Window_SystemMenu |#PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget |#PB_Window_MaximizeGadget)

  lci_005 = ListIconGadget(#PB_Any, 0, 0, 0, 0, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  lci_006 = ListIconGadget(#PB_Any, 0, 0, 0, 0, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  ;lci_005 = ListIconGadget(#PB_Any,120, 6,970, 670, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  ;lci_006 = ListIconGadget(#PB_Any,120, 6,970, 670, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  ;lci_005 = ListViewGadget(#PB_Any, 0,0,0,0)
  ;lci_006 = ListViewGadget(#PB_Any, 0,0,0,0)
  ;lci_005 = ButtonGadget(#PB_Any,  5,  15,  90,  20, "Read Clipboard")
  ;lci_006 = ButtonGadget(#PB_Any,  5,  43,  90,  20, "gadget_001")
  ;splt=SplitterGadget(#PB_Any, 120, 6,width-130, height-30, lci_005, lci_006, #PB_Splitter_Separator)
  splt=SplitterGadget(#PB_Any, 120, 6,970, 670, lci_005, lci_006, #PB_Splitter_Separator)
  SetGadgetAttribute(splt, #PB_Splitter_SecondMinimumSize, 20) 

EndProcedure
Procedure EventLoop()
  
  Build_Window_1()
  
  Repeat
  Select WaitWindowEvent()
  Case #PB_Event_CloseWindow
    CloseWindow(#PB_All)
    End
EndSelect
ForEver

EndProcedure

EventLoop()

Re: #PB_Splitter_FirstMinimumSize doesn't work for vertical

Posted: Tue Sep 29, 2020 3:36 am
by RASHAD
Hi Joris
It is working as expected
SetGadgetAttribute() changes the splittergadget characteristics
So SetGadgetAttribute(splt, #PB_Splitter_FirstMinimumSize, 50) means that the first object size can not resized less than 50 later on
by using the splitter bar
It does not resize the object at start (If you mean that)

See the next example you can not go beyond 50

Code: Select all

Global.i lci_005, lci_006, splt, Window_1

Procedure Build_Window_1(x = 0, y = 0, width = 1200, height = 700)
  Window_1 = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, width, height, "", #PB_Window_SystemMenu |#PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget |#PB_Window_MaximizeGadget)

  lci_005 = ListIconGadget(#PB_Any, 0, 0, 0, 0, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  lci_006 = ListIconGadget(#PB_Any, 0, 0, 0, 0, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  ;lci_005 = ListIconGadget(#PB_Any,120, 6,970, 670, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  ;lci_006 = ListIconGadget(#PB_Any,120, 6,970, 670, "0", 70, #PB_ListIcon_FullRowSelect |#PB_ListIcon_GridLines)
  ;lci_005 = ListViewGadget(#PB_Any, 0,0,0,0)
  ;lci_006 = ListViewGadget(#PB_Any, 0,0,0,0)
  ;lci_005 = ButtonGadget(#PB_Any,  5,  15,  90,  20, "Read Clipboard")
  ;lci_006 = ButtonGadget(#PB_Any,  5,  43,  90,  20, "gadget_001")
  ;splt=SplitterGadget(#PB_Any, 120, 6,width-130, height-30, lci_005, lci_006, #PB_Splitter_Separator)
  splt=SplitterGadget(#PB_Any, 120, 6,970, 670, lci_005, lci_006, #PB_Splitter_Separator)
  SetGadgetAttribute(splt, #PB_Splitter_SecondMinimumSize, 50)
  SetGadgetState(splt,150)  ;To change the Position

EndProcedure
Procedure EventLoop()
 
  Build_Window_1()
 
  Repeat
  Select WaitWindowEvent()
  Case #PB_Event_CloseWindow
    CloseWindow(#PB_All)
    End
EndSelect
ForEver

EndProcedure

EventLoop()

Re: #PB_Splitter_FirstMinimumSize doesn't work for vertical

Posted: Tue Sep 29, 2020 8:27 am
by Joris
Rashad the manual says :
#PB_Splitter_FirstMinimumSize : Sets the minimum size (in pixels) than the first gadget can have.
#PB_Splitter_SecondMinimumSize: Sets the minimum size (in pixels) than the second gadget can have.

Strangly enough I was able to get this working once like should. Afterwords realy no more ???

Now your example works fine and shows me what I must have forgotten :
SetGadgetState(splt,20) ;To change the Position

I (was sure to have) used only this one SetGadgetAttribute(..)

Thanks.