09-27-2009 02:05 PM - edited 09-27-2009 02:17 PM
Hi all,
I'm having an issue using the Curve 8830 simulator and JDE 4.2.1 when closing dialog boxes. When I close a dialog message in my app, upon closing, the dialog box clears a rectangle of the screen that is in proportion to the size of the dialog box. That is, if I've drawn bitmaps in the background, they are erased (and I believe fields are left unaffected). This seems to only happen using the 8830 and doesn't happen when using, say, the 8520 simulator (that has a newer OS). Are there any potential solutions to this issue? Thanks in advance!
I'm basically calling the dialog box using:
//for example...
int response = Dialog.ask(Dialog.D_YES_NO, "Do you think the screen will clear the background", Dialog.YES);
if(response == Dialog.NO){
...
}else{
...
}
In reading a similar thread, it's suggest that this may help, "If you are not using pushModal() with the GLOBAL flag set, then please try this first.", but there was no clear example of how to exactly implement this...
Thanks again
Solved! Go to Solution.
09-27-2009 03:51 PM
You should detect the onFocus() or onExposed() event in your screen and call invalidate().
This will precipitate a repaint.
09-27-2009 06:43 PM
Hi RexDoug!
Thanks for the reply. This was actually the first thing I tried to do to fix it and it didn't seem to work. I'm already calling the Dialog to appear using an "onExposed" method, but invalidate still clears the background without repainting the bitmaps (since they aren't called to be painted within the main paint thread I believe) .
Thanks!
- Jordan
09-27-2009 07:31 PM
I've just decided to fix the problem by calling invalidate and then having all the bitmaps redrawn under the paint method. I was trying to save resources, but this is the only solution that seems to work at this point...
- Jordan
09-27-2009 08:16 PM
Not sure I understand the staement "call Dialog from the onExposed() method".
Can you elaborate? I've nver seen a situation where you issue could not be resolved with a deft call to invalidate() (in the right place).
09-27-2009 09:46 PM
Oh sorry for the confusion - I just meant that the reason I'm displaying a dialog box is if the App is "exposed". So "onExposed" display message "..." etc...
Thanks for the advice though, calling invalidate and then repainting the bitmaps works fine.
- Jordan