pauleffect Member Licensed User Longtime User May 9, 2014 #1 Hello! I'm trying to build an Ui that relies heavily on circles. A sample attached. My problem is clicking on those rounded buttons or... anywhere else for that matter. Is there any way for me to ignore the reddish zones which, in the ui are fully transparent, of course. so, when one was to click in the "top reddish corner", he would, instead, click on the button beneath it. the getpixel approach isn't the best as the design relies on percentages, fluid layouts... Thank you. Edit: I think I can limp with the math and determine the bounds of each shape, so on and so fourth. So... it really comes down to this: if(not reddish) -> do button 1 else return false -> pass to the one beneath Last edited: May 9, 2014
Hello! I'm trying to build an Ui that relies heavily on circles. A sample attached. My problem is clicking on those rounded buttons or... anywhere else for that matter. Is there any way for me to ignore the reddish zones which, in the ui are fully transparent, of course. so, when one was to click in the "top reddish corner", he would, instead, click on the button beneath it. the getpixel approach isn't the best as the design relies on percentages, fluid layouts... Thank you. Edit: I think I can limp with the math and determine the bounds of each shape, so on and so fourth. So... it really comes down to this: if(not reddish) -> do button 1 else return false -> pass to the one beneath
Erel B4X founder Staff member Licensed User Longtime User May 9, 2014 #2 You can manually call the Touch sub of the parent view. Upvote 0
pauleffect Member Licensed User Longtime User May 9, 2014 #3 i dont understand what you mean, exactly. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 9, 2014 #4 I mean that you can handle the Touch event of the front most panel. Then if you want to pass it to the parent panel then you can call Panel2_Touch(...). Another option which will be simpler is to use Reflection library to add a touch listener (instead of the touch event). With this listener you can choose whether to consume the event or not. Upvote 0
I mean that you can handle the Touch event of the front most panel. Then if you want to pass it to the parent panel then you can call Panel2_Touch(...). Another option which will be simpler is to use Reflection library to add a touch listener (instead of the touch event). With this listener you can choose whether to consume the event or not.
pauleffect Member Licensed User Longtime User May 9, 2014 #5 that's exactly what i am after. Another option which will be simpler is to use Reflection library to add a touch listener (instead of the touch event). With this listener you can choose whether to consume the event or not. Click to expand... That's exactly what I am after.I already tried it with a with a panel. But surely i did something wrong. Code: Copy Dim r As Reflector r.Target = p2 r.SetOnTouchListener("blah") Sub blah_Touch(ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean if x / y something ..... ->code return true else return false end if End Sub is this... close? Upvote 0
that's exactly what i am after. Another option which will be simpler is to use Reflection library to add a touch listener (instead of the touch event). With this listener you can choose whether to consume the event or not. Click to expand... That's exactly what I am after.I already tried it with a with a panel. But surely i did something wrong. Code: Copy Dim r As Reflector r.Target = p2 r.SetOnTouchListener("blah") Sub blah_Touch(ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean if x / y something ..... ->code return true else return false end if End Sub is this... close?
Erel B4X founder Staff member Licensed User Longtime User May 9, 2014 #6 Yes. If you return False then the event should pass to the next view. Upvote 0
pauleffect Member Licensed User Longtime User May 9, 2014 #7 damn. this is exactly what i tried, with little luck. must have done something wrong. it'll keep trying. thank you for your assistance. as always, i am in debt. Upvote 0
damn. this is exactly what i tried, with little luck. must have done something wrong. it'll keep trying. thank you for your assistance. as always, i am in debt.
pauleffect Member Licensed User Longtime User May 9, 2014 #8 Code: Copy Sub reftes_Touch(ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean If(X < p2.Width / 2) Then test Return True Else Return False End If End Sub Damn it... dosen't work. Clicking in the right half of the circle or near it dosen't trigger the test sub (setting a random color background for the view) but neither does it pass through to the square. Attachments Capture.PNG 52.1 KB · Views: 591 Upvote 0
Code: Copy Sub reftes_Touch(ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean If(X < p2.Width / 2) Then test Return True Else Return False End If End Sub Damn it... dosen't work. Clicking in the right half of the circle or near it dosen't trigger the test sub (setting a random color background for the view) but neither does it pass through to the square.
Erel B4X founder Staff member Licensed User Longtime User May 11, 2014 #9 Can you upload your project? Upvote 0
pauleffect Member Licensed User Longtime User May 11, 2014 #10 Hello. I got it working using a different approach. And I erased the "testing" part of the app. Thank you for your concern. Upvote 0
Hello. I got it working using a different approach. And I erased the "testing" part of the app. Thank you for your concern.