Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how to catch home and end keys in SWT styledText
how to catch home and end keys in SWT styledText [message #530523] Thu, 29 April 2010 23:03 Go to next message
Lidder is currently offline Lidder
Messages: 46
Registered: July 2009
Member
Hello,

I have implemented a spell checker on SWT StyledText widget. The basic logic is that the spell checking is done when the modifyText function fires. I calculate the annotations (squiggly lines) I need to draw and then draw them on the widget in the paintListener -> paintContol() method. There is one problem.
Let's say I write some incorrect text in the styledtext widget. The spell checker recognizes the modify event and run a spell check. The paint then draws the errors. Assume that the widget has SWT.SINGLE style. I can keep typing and the spell check keeps drawing the annotations. Now when I hit home to go the start of my text, the annotations are not refreshed as there is no modify event. I want to be able to capture when the "visible text" changes and redraw the annotations. Is there a way to do that?

Thanks for your help.
Re: how to catch home and end keys in SWT styledText [message #530984 is a reply to message #530523] Mon, 03 May 2010 08:59 Go to previous message
Praveen  is currently offline Praveen
Messages: 86
Registered: July 2009
Member
The keys Home and End does not result in Modify event as it does not
cause in any modification of the text. I believe the only way is to
capture those events is through verifyKey event (ofcourse, or through
keyDown/keyUp) of StyledText.
Previous Topic:Metawidget has added SWT support
Next Topic:OLEControlSite and complete menubar loss
Goto Forum:
  


Current Time: Thu Oct 30 16:41:41 GMT 2014

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

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