You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Snippet 386: Demonstrates Cursor constructors and DPI scaling in SWT
This snippet demonstrates several ways to construct and use cursors in
an SWT application, including system cursors, custom image cursors, and
DPI-aware cursors using ImageDataProvider. The user interface allows
interactive selection of the cursor construction method, and updates the
shell’s cursor in real time based on the current choice. The snippet
displays the current system zoom level (DPI) and the expected cursor
size, and draws reference ticks to help visualize scaling effects. It
also responds to system DPI changes, ensuring accurate display and
behavior at different zoom levels. The code is structured for clarity
and modularity, making it suitable for direct use with the SWT Snippet
Explorer.
Copy file name to clipboardExpand all lines: examples/org.eclipse.swt.snippets/Snippets.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@ To contribute a new snippet, [create a snippet contribution as a pull request](h
125
125
-[create a color cursor from a source and a mask](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet119.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet119.png"Preview for Snippet 119")
126
126
-[create a color cursor from an image file](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet118.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet118.png"Preview for Snippet 118")
127
127
-[hide the Cursor over a control](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet242.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet242.png"Preview for Snippet 242")
128
+
-[demonstrates various ways to construct and use custom cursors in an SWT application](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet386.png"Preview for Snippet 386")
128
129
129
130
### **DateTime**
130
131
-[create a DateTime calendar and a DateTime time](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet250.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet250.png"Preview for Snippet 250")
0 commit comments