It is currently Thu Oct 29, 2020 12:53 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: #PB_Splitter_FirstMinimumSize doesn't work for vertical spit
PostPosted: Fri Sep 25, 2020 11:40 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 703
Location: BE
Hi,

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

Greatings.
Code:
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()

_________________
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.


Top
 Profile  
Reply with quote  
 Post subject: Re: #PB_Splitter_FirstMinimumSize doesn't work for vertical
PostPosted: Tue Sep 29, 2020 3:06 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 703
Location: BE
Second not working example.
Code:
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()

_________________
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.


Top
 Profile  
Reply with quote  
 Post subject: Re: #PB_Splitter_FirstMinimumSize doesn't work for vertical
PostPosted: Tue Sep 29, 2020 3:36 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3708
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:
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()

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: #PB_Splitter_FirstMinimumSize doesn't work for vertical
PostPosted: Tue Sep 29, 2020 8:27 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 703
Location: BE
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.

_________________
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: AMpos and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye