Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ResizeEvent handler for Application. Currently using Display.addFilter().
ResizeEvent handler for Application. Currently using Display.addFilter(). [message #446815] Thu, 02 December 2004 20:39 Go to next message
Jesse Eichar is currently offline Jesse EicharFriend
Messages: 29
Registered: July 2009
Junior Member
What I am trying to do is determine whether or not a mouse button is
down when I obtain a resize event(the component of concern is an
editor). If it is then I want to post-pone the resize until the mouse
button is released. The strategy I have currently is to add a Filter
with the Display that the editor component is contained by.

component.getDisplay().addFilter(SWT.MouseDown, listener);
component.getDisplay().addFilter(SWT.Up, listener);

This works as long as the resize is one of the internal dividers. For
example, if one of the views are resized. But when the window is being
enlarged by dragging the listener's handleEvent method is not being
called.

This really sucks because when a resize event occurs a very expensive
process is started and right now when the window is resized this happens
many times during the resize.

Any one have suggestions on how to fix this problem?

Thank you,

Jesse
Re: ResizeEvent handler for Application. Currently using Display.addFilter(). [message #446833 is a reply to message #446815] Fri, 03 December 2004 15:12 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
You won't get mouse when the user clicks on the trim of a control. Your
work around sounds like a bit of a dangerous hack (although I can understand
why you might want to defer a resize). An alternate approach would be to
use Display.asyncExec() to defer the resize work until the user interface
thread is idle. You could also use Display.timerExec() do the resize work
at certain intervals. Both of these approaches can be used to cut down the
work you do in a resize handler. If you can't get it to work, I can write
you a snippet.

"Jesse Eichar" <jeichar@refractions.net> wrote in message
news:conukc$196$1@www.eclipse.org...
> What I am trying to do is determine whether or not a mouse button is
> down when I obtain a resize event(the component of concern is an
> editor). If it is then I want to post-pone the resize until the mouse
> button is released. The strategy I have currently is to add a Filter
> with the Display that the editor component is contained by.
>
> component.getDisplay().addFilter(SWT.MouseDown, listener);
> component.getDisplay().addFilter(SWT.Up, listener);
>
> This works as long as the resize is one of the internal dividers. For
> example, if one of the views are resized. But when the window is being
> enlarged by dragging the listener's handleEvent method is not being
> called.
>
> This really sucks because when a resize event occurs a very expensive
> process is started and right now when the window is resized this happens
> many times during the resize.
>
> Any one have suggestions on how to fix this problem?
>
> Thank you,
>
> Jesse
Previous Topic:PocketPC: size of Dialog
Next Topic:Mouse Wheel
Goto Forum:
  


Current Time: Mon Nov 30 15:28:13 GMT 2020

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

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

Back to the top