08-04-2011 01:49 PM
I am developing an application for blackberry torch.
I have buttons and list which need to be selected based on selection.
When the button or any focusable field is focused if i click on any part of the screens its accepting as a click event. Please tell me how to disable this event.
08-04-2011 03:20 PM
This is a consequence of the mechanics of the clkick - there is only one click switch under the display, so the focused control is going to get the click.
I remember having this issue - I believe that we simply checked the coordinates of the touch event when the click occurred to determine if the touch that triggered the click was actually within the region of the control.
08-04-2011 11:44 PM
You should be able to get the global X,Y coordinates of the touch from the touch event, and compare this with Field.getExtent() of the focused field - just guessing.
In fact, you can either get the local X, Y (getX/getY) and check them to fall within (0, getWidth()) and (0, getHeight()) or get the global X and Y and compare with the results of getFieldExtent - there is a piece of code here in the forums, use 'Search' to find it.
08-08-2011 02:13 PM
Itrie dthis at the field level and then the problem is only the focussed icon or field is getting selected. If select another field its not getting selected. To overcome this I checked whether thetouch event is click or unclick then performed the extent check. Then when I click the bottom of the screen last item gets selected . How to overcome this ?