| How to not hide cursor when typing [message #632624] |
Wed, 13 October 2010 11:48  |
Andy Coleman Messages: 33 Registered: September 2009 |
Member |
|
|
Hi,
We have a dialog which has a number of Text controls and an ok button. In most situations the user will open the dialog, accept the default values and press the ok button. To help with this we move the mouse button over the ok button when the dialog is opened.
The main problem we have is that if a user types anything into one of the text controls the mouse pointer disapears. I appreciate that this is standard behaviour (this is on Windows) but we would like to override that behaviour and keep the mouse visible?
Is there any way we can do this.
Thanks
Andy
|
|
|
| Re: How to not hide cursor when typing [message #633607 is a reply to message #632624] |
Mon, 18 October 2010 10:32  |
 |
Lakshmi Shanmugam Messages: 271 Registered: July 2009 Location: India |
Senior Member |
|
|
Hi,
You can try something like this:
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (display.getCursorControl() == okButton) {
display.setCursorLocation(display.getCursorLocation());
}
}
});
If you have many text controls, you could consider using a display filter for SWT.Modify event. Add/remove the display filter when dialog opens/closes.
Lakshmi P Shanmugam
|
|
|
Powered by
FUDForum. Page generated in 0.01797 seconds