Found an issue in SpiderBasic ? Please report it here !
User avatar
Peter
 
Posts: 774
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

SplitterGadget() and TrackBarGadget() doesn't work...

by Peter Wed Mar 25, 2020 6:25 pm

... properly in a borderless window in mobile view.

Hi,

while SplitterGadget() and TrackBarGadget() work fine in a normal window, they don't work in a borderless window when the app is displayed in a mobile view (for example on a mobile phone).

Example with SplitterGadget():
Image

The same behavior also occurs in a window with the #PB_Window_Background flag.

Code: Select all
EnableExplicit

Define W1, W2
Define B1, B2, SG

W1 = OpenWindow(#PB_Any, 10, 10, 300, 300, "Window1")
B1 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button1")
B2 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button2")
SG = SplitterGadget(#PB_Any, 0, 0, WindowWidth(W1), WindowHeight(W1), B1, B2)


W1 = OpenWindow(#PB_Any, 10, 360, 300, 300, "Window2", #PB_Window_BorderLess)
B1 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button1")
B2 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button2")
SG = SplitterGadget(#PB_Any, 0, 0, WindowWidth(W1), WindowHeight(W1), B1, B2)

CloseDebugOutput()
useful
 
Posts: 37
Joined: Tue Feb 25, 2014 1:15 pm

Re: SplitterGadget() and TrackBarGadget() doesn't work...

by useful Thu Mar 26, 2020 2:53 am

Code: Select all
EnableExplicit
Define W11,B11,B12,SG1
Define W21,B21,B22,SG2

W11 = OpenWindow(#PB_Any, 10, 10, 300, 300, "Window1")
B11 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button1")
B12 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button2")
SG1 = SplitterGadget(#PB_Any, 0, 0, WindowWidth(W11), WindowHeight(W11), B11, B12)


W21 = OpenWindow(#PB_Any, 10, 360, 300, 300, "Window2", #PB_Window_BorderLess)
B21 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button1")
B22 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button2")
SG2 = SplitterGadget(#PB_Any, 0, 0, WindowWidth(W21), WindowHeight(W21), B21, B22)

CloseDebugOutput()
2B or not 2B = FF
User avatar
Peter
 
Posts: 774
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: SplitterGadget() and TrackBarGadget() doesn't work...

by Peter Thu Mar 26, 2020 8:03 am

@useful: I'm not sure what you want to show me with your code, but it doesn't work like mine does.
useful
 
Posts: 37
Joined: Tue Feb 25, 2014 1:15 pm

Re: SplitterGadget() and TrackBarGadget() doesn't work...

by useful Thu Mar 26, 2020 7:33 pm

I have a splitter with my code that works in both the first and second windows.
And with your code, it only works in the first window.

Maybe I misunderstood your problem?
2B or not 2B = FF
User avatar
Peter
 
Posts: 774
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: SplitterGadget() and TrackBarGadget() doesn't work...

by Peter Fri Apr 03, 2020 7:23 am

useful wrote:Maybe I misunderstood your problem?


For a better understanding I have created a test project (*):

http://test.tuebben.de/splittergadgettest/

If you access the page with a mobile device (like a cell phone), the SplitterGadget does not work correctly.

As mentioned: This only happens if the window has no border (#PB_Window_BorderLess or #PB_Window_Background).

Greetings ... Peter

(*) This is the underlying code:
Code: Select all
EnableExplicit

Define W1, W2
Define B1, B2, SG

W1 = OpenWindow(#PB_Any, 10, 360, 300, 300, "Window2", #PB_Window_Background)
B1 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button1")
B2 = ButtonGadget(#PB_Any, 0, 0, 0, 0, "Button2")
SG = SplitterGadget(#PB_Any, 0, 0, WindowWidth(W1), WindowHeight(W1), B1, B2)

CloseDebugOutput()
Dirk Geppert
 
Posts: 183
Joined: Fri Sep 22, 2017 7:02 am

Re: SplitterGadget() and TrackBarGadget() doesn't work...

by Dirk Geppert Fri Apr 03, 2020 12:05 pm

There seems also none EventType() for the SplitterGadget(). That's why you can't use BindGadgetEvent().

This is my workaround fo this:
Since the ContainerGadget, contrary to the documentation, triggers an event when changing the size, I put everything into containers and catch the container events.

How would you monitor the changes of the SplitterGadget State?
I would not like to do this with a timer and the query via GetGadgetState().
User avatar
Peter
 
Posts: 774
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: SplitterGadget() and TrackBarGadget() doesn't work...

by Peter Fri Apr 03, 2020 12:36 pm

Dirk Geppert wrote:There seems also none EventType() for the SplitterGadget(). That's why you can't use BindGadgetEvent().

the SplitterGadget() should work automatically (just like in a normal window).
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 2 guests