It is currently Tue Oct 24, 2017 1:34 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: TreeGadget resizing
PostPosted: Tue Oct 10, 2017 1:19 pm 
Offline
User
User

Joined: Sun May 24, 2009 2:38 pm
Posts: 26
Hello

I have a window with one TreeGadget on the left, second TreeGadget on the right, and the PanelGadget between them (so i can't use splittergadget)
Is there any way to make treegadgets resizeable with mouse? (only horizontally)
I've tried to detect mouse clicks over the edge of the gadget and then resizing it but it didn't really work.


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget resizing
PostPosted: Tue Oct 10, 2017 1:59 pm 
Offline
Addict
Addict

Joined: Sun Apr 12, 2009 6:27 am
Posts: 2808
No you can use SplitterGadget
Code:
flags = #PB_Window_SystemMenu| #PB_Window_MaximizeGadget| #PB_Window_MinimizeGadget| #PB_Window_ScreenCentered
OpenWindow(0,0,0,600,400,"Test",Flags)
cont = ContainerGadget(#PB_Any,10,10,580,380,#PB_Container_Flat)
  tree1 = TreeGadget(#PB_Any,0,0,0,0)
  For a = 0 To 100
   AddGadgetItem(tree1, -1, "Elément normal "+Str(a), 0, 0)
  Next
  panel = PanelGadget(#PB_Any,0,0,0,0) 
    AddGadgetItem (panel, -1, "Panel 1")
  CloseGadgetList()
  split = SplitterGadget(#PB_Any,0,0,580,380,tree1,panel, #PB_Splitter_Separator|#PB_Splitter_Vertical ) 
CloseGadgetList()
SetGadgetState(split, 200)
tree2 = TreeGadget(#PB_Any,0,0,0,0)
For a = 0 To 100
 AddGadgetItem(tree2, -1, "Elément normal "+Str(a), 0, 0)
Next
split2 = SplitterGadget(#PB_Any,10,10,580,380,cont,tree2, #PB_Splitter_Separator|#PB_Splitter_Vertical )
SetGadgetState(split2, 400)   

Repeat
           
  Select WaitWindowEvent()     
    Case #PB_Event_CloseWindow
        Quit = 1
  EndSelect
Until Quit = 1
End


Edit :Modified

_________________
Egypt my love


Last edited by RASHAD on Tue Oct 10, 2017 3:06 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget resizing
PostPosted: Tue Oct 10, 2017 2:34 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 22, 2010 1:17 pm
Posts: 249
Location: United Kingdom
If you don't want to use two splitters, as Rashad shows, then you could also:-

1) Use a canvas gadget as a container and process the #PB_EventType_LeftButtonDown and #PB_EventType_LeftButtonUp events.
2) Use a window callback procedure to process the #WM_LBUTTONDOWN and #WM_LBUTTONUP messages.

In either case you would need to range test the X and Y co-ordinates to determine which gap had been clicked in the button down and the new gadget dimensions in the button up.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 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