Tim
Tim

Reputation: 1606

How to remove the screen dimming when is presented dialog?

I want to be able to press the other buttons on my screen when open dialog.

Dialog menuDialog = new Dialog("Dialog Demo");
menuDialog.setTimeout(1000);
menuDialog.show(90, 90, 10, 10, true);

Upvotes: 0

Views: 190

Answers (2)

Vimal
Vimal

Reputation: 1266

Whilst 'pheromix' is correct in associating an action to the pointerReleased region. You would also need to make setDisposeWhenPointerOutOfBounds(false) in the derived Dialog class.

You can also refer the detailed explanation here http://www.java.net/forum/topic/mobile-embedded/lwuit/how-remove-screen-dimming-when-presented-dialog-2

Upvotes: 1

pheromix
pheromix

Reputation: 19297

Don't use directly a Dialog but create a class which derives Dialog. Implement the pointerReleased method , assuming that the device is tactile , and test if the x and y params are contained inside the area delimited by the Buttons's coordinates :

if ( ( x >= btn.getAbsoluteX() && x <= btn.getAbsoluteX() + btn.getPreferredW() ) && ( y >= btn.getAbsoluteY() && y <= btn.getAbsoluteY() + btn.getPreferredH() ) )
   // execute the Buttons's action method
else
   super.pointerReleased(x,y);

Upvotes: 0

Related Questions