Dim R As Reflector
R.Target=Button1
R.SetOnTouchListener("Button1_Touch")
.......
Sub Button1_Touch(ViewTag As Object, Action As Int, X As Float,Y As Float, Motionevent As Object) As Boolean
Log("Touched")
End Sub
But it still wont trigger unless the finger is touched on the object that is being monitored.
You could use my Hotspot code module which would monitor a whole panel and tell you when a finger moves into the hotspot.
Sorry because i posted in wrong forum. and is a good idea you posted but i still need a doubleclick method.
so i repeat my question for customview: (or have anyone another idea to combine touch method and doubleclick method for a button ?)
I must create for my PhD an application for blind users. so i created an interface with buttons as customview. the blind user put a finger on screen and with TTS i can speak what button is. when he get wanted button he can doubleclick on it to start proper activity. till now all is fine.
but if the blind user is moving the finger on the screen without lifting the finger, when he get another customview button the method singleclick is not fired to use TTS, only if the finger is lift and put again on the screen.
Erel, can you create another method for customview like touch for a button (in addition to singleclick and doubleclick) ?
I saw you use a touch method for panel in CustomView Class. but the result is not what i want. i have a few customview buttons. when i put the finger on the screen, for the first button is rised singleclick (ok), but if i do not take my finger off the screen but moving it to next button, singleclick for next button is not rised. you know what i mean ?
You could have a look at chapter 5.3.3 Button with tooltip and additional buttons in the User's Guide.
There I use 4 buttons, they are in fact Panels (the source code is included).
A 'main' button and three additional ones.
In the Touch event of the main button with:
Action_DOWN a ToolTip is displayed, the background image is changed and some other tests are done.
Action_MOVE checks if the cursor is insides the area of a button, changes the bachgound images if necessary.
Action_UP if the cursor is insides the area of a button executes the function of that button, if the cursor is not insides of any button area nothing happens.
You could take this example as an inspiration for your specific needs.
You could have a look at chapter 5.3.3 Button with tooltip and additional buttons in the User's Guide.
There I use 4 buttons, they are in fact Panels (the source code is included).
A 'main' button and three additional ones.
In the Touch event of the main button with:
Action_DOWN a ToolTip is displayed, the background image is changed and some other tests are done.
Action_MOVE checks if the cursor is insides the area of a button, changes the bachgound images if necessary.
Action_UP if the cursor is insides the area of a button executes the function of that button, if the cursor is not insides of any button area nothing happens.
You could take this example as an inspiration for your specific needs.
Hi Klaus,
I just skimmed through the chapter quickly and have a brief questions. Is the Action capturing ONLY available at the Activity level (i see that buttons also have down and up events) and, If actions can be captured for buttond, can they also be captured for other viewsssuch as labels and images (my interest at this stage is for displaying tooltips)? Oh, yesterday, also is the ToolTips sub part of the core or do I need another library? Thanks.