Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 257901 Details for
Bug 482022
[win32] MouseEnter not fired on fast traversals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Example Program highlighting the problem.
MouseEnter.java (text/plain), 2.39 KB, created by
DaveLaw
on 2015-11-12 10:43:59 EST
(
hide
)
Description:
Example Program highlighting the problem.
Filename:
MIME Type:
Creator:
DaveLaw
Created:
2015-11-12 10:43:59 EST
Size:
2.39 KB
patch
obsolete
>package org.eclipse.swt.snippets; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.MouseEvent; >import org.eclipse.swt.events.MouseTrackAdapter; >import org.eclipse.swt.events.PaintEvent; >import org.eclipse.swt.events.PaintListener; >import org.eclipse.swt.graphics.Color; >import org.eclipse.swt.widgets.Canvas; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Control; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class MouseEnter { > > private static final class MouseCanvas extends Canvas { > > public MouseCanvas(final Composite parent, final int canvasNumber, final Color colour) { > super(parent, SWT.NONE); > > final Control thisCanvas = this; > final int gap = 10; > final int canvasWidth = 120; > final int canvasHeight = 60; > > this.setBounds(canvasNumber * (gap + canvasWidth), 0, canvasWidth, canvasHeight + gap*2); > > this.addPaintListener(new PaintListener() { > public void paintControl(PaintEvent e) { > e.gc.setBackground(colour); > e.gc.fillRectangle(0, 0, thisCanvas.getBounds().width, thisCanvas.getBounds().height); > } > }); > > this.setToolTipText("Canvas " + canvasNumber); > > this.addMouseTrackListener(new MouseTrackAdapter() { > @Override > public void mouseEnter(MouseEvent e) { > thisCanvas.setCursor(Display.getDefault().getSystemCursor(SWT.CURSOR_HAND)); > System.out.println("Mouse Enter.: " + Integer.toHexString(e.getSource().hashCode()) + "\t" + e); > } > @Override > public void mouseExit(MouseEvent e) { > thisCanvas.setCursor(Display.getDefault().getSystemCursor(SWT.CURSOR_ARROW)); > System.out.println("Mouse Exit..: " + Integer.toHexString(e.getSource().hashCode()) + "\t" + e); > } > }); > } > } > > public static void main(String[] args) { > > final Display display = new Display(); > final Shell shell = new Shell(display, SWT.SHELL_TRIM & (~SWT.RESIZE) & (~SWT.MAX)); > > new MouseCanvas(shell, 0, Display.getDefault().getSystemColor(SWT.COLOR_RED)); > new MouseCanvas(shell, 1, Display.getDefault().getSystemColor(SWT.COLOR_GREEN)); > new MouseCanvas(shell, 2, Display.getDefault().getSystemColor(SWT.COLOR_BLUE)); > > shell.pack(); > shell.open(); > while (shell .isDisposed() == false) { > if (display.readAndDispatch() == false) { > display.sleep(); > } > } > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 482022
: 257901 |
257920
|
257942
|
278689