Page 1 of 1

SplitterGadget()

Posted: Fri Mar 21, 2014 6:11 pm
by Fenix
Hi @ all,

I want to use three gadgets combined by two splitter gadgets (one gadget is used in both splitters). But this has some ugly effects, in other words: it doesn't work :(

Code: Select all

OpenWindow(0, 10, 10, 510, 300, "SPLITTER", #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_SystemMenu)

; first splitter
ButtonGadget(11, 0, 0, 0, 0, "BTN1")
ButtonGadget(22, 0, 0, 0, 0, "BTN2")
SplitterGadget(99, 0, 0, 250, 150, 11, 22, #PB_Splitter_Separator | #PB_Splitter_Vertical)

; second splitter
ButtonGadget(33, 0, 0, 0, 0, "BTN3")
SplitterGadget(98, 125, 0, 250, 150, 22, 33, #PB_Splitter_Separator | #PB_Splitter_Vertical)

Repeat
  event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
End
I there a way to do it anyway?? Does the splitter gadget fire any event when it's being clicked/moved?

Thanx,
Fenix

Re: SplitterGadget()

Posted: Fri Mar 21, 2014 6:28 pm
by skywalk
Link the 1st splitter gadget # in your 2nd splitter and play around with your desired actions.

Code: Select all

OpenWindow(0, 10, 10, 510, 300, "SPLITTER", #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_SystemMenu)

; first splitter
ButtonGadget(11, 0, 0, 0, 0, "BTN1")
ButtonGadget(22, 0, 0, 0, 0, "BTN2")
SplitterGadget(99, 0, 0, 250, 150, 11, 22, #PB_Splitter_Separator | #PB_Splitter_Vertical)

; second splitter
ButtonGadget(33, 0, 0, 0, 0, "BTN3")
SplitterGadget(98, 125, 0, 250, 150, 99, 33, #PB_Splitter_Separator | #PB_Splitter_Vertical)

Repeat
  event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
End

Re: SplitterGadget()

Posted: Fri Mar 21, 2014 6:37 pm
by Fenix
skywalk wrote:Link the 1st splitter gadget # in your 2nd splitter and play around with your
Never thought of using a splitter gadget insider another spliter :idea:
It work's exactly how I wanted it :D

Thanx skywalk!!

Re: SplitterGadget()

Posted: Sat May 24, 2014 5:23 am
by mestnyi
Fenix in your example, when you move why the second splitter and the first move? How to avoid?