Android Question B4XDateTemplate - Trapping mouse LONG CLICK

beelze69

Active Member
Licensed User
Longtime User
Hi Team,

I am using the B4XDateTemplate which is available inside XUI Views.b4xLib(zip file) code for an application..

I have been able to customize it for 'highlighting days' based on a certain condition with a specific color.

However, I would like to carry out some activity upon doing a 'LONG CLICK' in the days panel.

The relevant code snippet where I think I need to modify is in the code block:

B4X:
Private Sub DaysPaneFg_Touch (Action As Int, X As Float, Y As Float)
Dim p As B4XView = DaysPaneFg
Log("Day Panel Touched")
HandleMouse(X, Y, Action <> p.TOUCH_ACTION_UP)
End Sub

Requesting for some guidance on how to go about doing this.

Thanks.
 
Last edited:

beelze69

Active Member
Licensed User
Longtime User
Hi Erel,

Please refer my post.


I posted this on Friday, 4th February,2022.

Since no one has responded till today, I am requesting you.

Thanks
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
I am not @Erel, but I will try to answer.

The Touch event has a Action parameter that includes p.TOUCH_ACTION_UP and p.TOUCH_ACTION_DOWN.
(p is the panel, but any B4XView will do, they all have these constants)

You need to time the difference (add a global variable for this). If the interval is what you consider is "Long", make you action.

See:https://www.b4x.com/guides/B4XBasicLanguage/?page=1

Section 5.8.1 Page 76

Edit: Corrected Link
 
Last edited:
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
I am not @Erel, but I will try to answer.

The Touch event has a Action parameter that includes p.TOUCH_ACTION_UP and p.TOUCH_ACTION_DOWN.
(p is the panel, but any B4XView will do, they all have these constants)

You need to time the difference (add a global variable for this). If the interval is what you consider is "Long", make you action.

See: file:///C:/Users/willi/Desktop/Booklets/BasicLangage/B4XBasicLanguageV2_2.pdf

Section 5.8.1 Pa

I am not @Erel, but I will try to answer.

The Touch event has a Action parameter that includes p.TOUCH_ACTION_UP and p.TOUCH_ACTION_DOWN.
(p is the panel, but any B4XView will do, they all have these constants)

You need to time the difference (add a global variable for this). If the interval is what you consider is "Long", make you action.

See: file:///C:/Users/willi/Desktop/Booklets/BasicLangage/B4XBasicLanguageV2_2.pdf

Section 5.8.1 Page 76
Thanks William,

I did it and was able to log the 'Long Click' and the 'Click' separately...

I also took help from this post..

Thanks for the guidance...
 
Last edited:
Upvote 0
Top