Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to not hide cursor when typing(How to not hide cursor when typing)
How to not hide cursor when typing [message #632624] Wed, 13 October 2010 11:48 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:SWT Browser Scrollbar
Next Topic:Preventing TreeItem to expand/collapse
Goto Forum:
  


Current Time: Tue Jul 08 18:25:52 EDT 2025

Powered by FUDForum. Page generated in 0.03122 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top