04-16-2009 03:46 PM
If you want to custom paint a ChoiceField (not the popup) but you want your code to work for all platforms this bit of information may help because the ChoiceField is a little convoluted. The ChoiceField.paint(Graphics) method controls when the selection popup opens. I know, right, wth... So that makes custom painting difficult because the Storm likes to paint giant buttons that are easy to click, but get in our way when painting. One way around that would be to call super.paint(Graphics) and the graphics.clear()... but then you lose everything the Manager painted behind it if you choose to have a margin or rounded edges. So with that option off the table you sill have to call super. Pushing a graphics context and setting the gobal alpha to 0 (transparent) before calling graphics.clear() doesn't work either. Finally we come to:
Bitmap bitmap = new Bitmap(1,1);
Graphics graphics = new Graphics(bitmap);
super.paint(graphics);
This allows the parent class be notified that the selection popup should displayed (bleh), and it doesn't trash up your custom painting becuase the graphics object gets discarded.
Cheers,
04-20-2009 10:46 AM
12-07-2009 12:44 PM
Thank you very much for this! For the last couple hours, I've been trying to figure out how to make the PopUp appear!
06-15-2012 09:59 AM
Thanks!!!!
It works like charm ![]()