09-27-2010 12:15 AM
hello,
i have gone through sample given in knowledge base article for bar diagram given at the link below,
http://supportforums.blackberry.com/t5/Java-Develo
can anyone please tell me is it possible to make individual bars in bar diagram click able?
Thanks,
Vijayta
09-27-2010 12:21 AM
For touch operation, you can make your custom field react to touch events and check the coordinates of the touch. For non-touch operation, you can maintain an internal model of the "current focus" (one of the bars) and react to navigation click events. (You also need to deal with several focus issues; see the documentation for Field.)
09-28-2010 02:00 AM
i understood your logic for touch screens but can you please explain for non-touch screens in detaili?
09-28-2010 09:20 AM
Keep a "focused" bar index as the Field member and highlight it (the "focused" bar) somehow in your paint() override. Change that index within navigationMovement() according to your logic (try to make it intuitive enough for the user) and invalidate() the field each time you adjust the index. Check that index in navigationClick() and act accordingly.
09-28-2010 09:47 AM
Here's a little more detail of what I was suggesting. I haven't looked at the sample code in the KB article you referenced, but let's take something like BarGraphField. I assume that it overrides the usual suspects: layout(), paint(), getPreferredWidth(), and getPreferredHeight(). These would probably not need to be changed. Instead, you would do the following:
I may have left out some steps, but I think that covers it. It will take some experimenting to get everything right.
03-09-2011 01:28 AM
Hi,
I too facing the same issue on the bar / pie . Can u give me briefing on the same or some links / sample code
Thanks in advance.
03-09-2011 06:53 PM
Previous poster has raised a separate Thread:
http://supportforums.blackberry.com/t5/Java-Develo