B4J Question XUI_Touch event: how to consume it after processing ?

peacemaker

Expert
Licensed User
Longtime User
Hi, All

Is it possible to consume this event cross-platformly after processing ?
When processing is finished - it needs to prevent passing it to the container(-s).
 
Last edited:
Solution
In B4j: Pane has a Touch event but I assume you want to use the mouse for 'touching' the desktop screen.
(correct me if you really have a touch screen for the windows machine)

In the Touch event 3 different actions are handled:
- Pane1.TOUCH_ACTION_DOWN, the user touches the screen - similar to MousePressed
- Pane1.TOUCH_ACTION_MOVE, the user moves the finger without leaving the screen - similar to MouseDragged
- Pane1.TOUCH_ACTION_UP, the user leaves the screen - similar to MouseReleased

Each of MousePressed, MouseDragged, MouseReleased has a (EventData As MouseEvent) as argument
EventData has .Consume method

Magma

Expert
Licensed User
Longtime User
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
2) At your example the difference of top,left of one object with other top,left object changing with the move/jumping of scrollview (without dragging the items/objects) ?

I do nothing with ScrollView, manipulating only by the objects created from classes.
create a pane (view) and inside this pane

It's not the first version
Initial work was, sure, without ScrollView, over just Pane - and all worked fully OK, without any jumping.
But the Editor - it's big area for creating many objects, and all must be accesible via small window of the Editor's ScrollView - what is another way ?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Seems, i've already tried, and moved back.
Will try now again

tried:
 
Last edited:
Upvote 0

Magma

Expert
Licensed User
Longtime User
When create the pane (your designer canvas)

create code for when clicking/dragging:
1. at first click take a snap of editor.panelwidth at one variable and the editor.panelheight at other...
2. set editor (xuiscrollview2d) at panelwidth and and height at formheight / widths - the difference dips (titilebar, top from view, vertical scrollbar width, etc)
3. move without jumping
4. when user not clicking/dragging - set again the right values for panelwidth/height

Tell me about the result...
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
2. set editor (xuiscrollview2d) at panelwidth and and height at formheight / widths - the difference dips (titilebar, top from view, vertical scrollbar width, etc)
Pardon, i did not understand meaning here.

Editor.PanelWidth, Editor.Height - are not changed now during work.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
B4X:
    Editor.PanelWidth = B4XPages.GetNativeParent(Me).RootPane.width-15dip '~scrollbar width
    Editor.PanelHeight = B4XPages.GetNativeParent(Me).RootPane.Height-55dip 'is ~titlebar caption height + difference from top
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Sorry, i do not understand.
Yes, while no auto-scrolling - no coordinate jumping.
 

Attachments

  • b4xVectEdit_v0.232_xScrollView.zip
    9.4 KB · Views: 78
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
How to make the separate topic about "XUI_Touch event: how to consume it after processing ?"
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
...Not ready... having problems too

but... try to unzoom (make it smaller) to understand the problem

1. Don't know if that the right way to scale....
2. You are using DesignerCreateView... if you use addview, and createpanel, loadlayout... maybe you can consume mouseevents...

Editor.panel when it is at scale 1 seems that can controlled... So something happens with scaling and scroll....
If you unzoom perhaps 0.1 scale and move object you will more jumping especially when go down... to up not so much...

May you must try different approach at scaling or if you use addview and mousepress, event have better results...

For now ... cant think more... was a break for our IRS... EFT-POS<>ERP connections...
 

Attachments

  • b4xVectEdit_v0.232_xScrollView-magma.zip
    10.7 KB · Views: 50
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…