Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341960 - [cursors] NESW and NWSE styles missing
Summary: [cursors] NESW and NWSE styles missing
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-05 16:00 EDT by Austin Riddle CLA
Modified: 2011-04-12 13:25 EDT (History)
1 user (show)

See Also:


Attachments
Patch for 1.4 release (1.73 KB, application/octet-stream)
2011-04-05 16:00 EDT, Austin Riddle CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Riddle CLA 2011-04-05 16:00:52 EDT
Created attachment 192596 [details]
Patch for 1.4 release

This issue arises because Draw2d uses these styles for resizing figures.

Currently these SWT constants are missing:


 /**
   * System resize north-east-south-west cursor (value is 6).
   */
  public static final int CURSOR_SIZENESW = 6;
  /**
   * System resize north-west-south-east cursor (value is 8).
   */
  public static final int CURSOR_SIZENWSE = 8;


----------------


There is a partial implementation already in place in the code for supporting these cursors.  It seems like it may not be supported across all browsers. Does anyone have a reason why this partial implementation exists? Since we are at API freeze, I would like to propose the attached patch to allow support of the cursors in 1.4 with the Draw2d implementation.

After the final release we should add these officially.
Comment 1 Ivan Furnadjiev CLA 2011-04-11 07:46:29 EDT
Visually I don't see any difference between CURSOR_SIZENWSE and CURSOR_SIZENW, CURSOR_SIZENESW and CURSOR_SIZENE. As cursors CURSOR_SIZENW and CURSOR_SIZENE exist in RAP the fix will be to simple map these new cursors to the existing one.
Comment 2 Ivan Furnadjiev CLA 2011-04-11 10:07:28 EDT
Fixed in CVS HEAD. Now CURSOR_SIZENWSE and CURSOR_SIZENW are rendered as "nw-resize", CURSOR_SIZENESW and CURSOR_SIZENE as "ne-resize".
Comment 3 Cole Markham CLA 2011-04-11 10:08:03 EDT
The problem is on Linux/GTK they have different cursors for each corner. See this page http://www.pygtk.org/docs/pygtk/class-gdkcursor.html for what they actually look like. It looks like SWT on GTK maps SIZENESW and SIZENWSE to GDK_SIZING which looks more or less like the cursor used on Windows and presumably other platforms.
Comment 4 Cole Markham CLA 2011-04-11 10:20:27 EDT
I think the only way to handle this properly is with a custom cursor. I was tracing through the javascript code last week and it looked like the support was there to load a custom cursor, all that would be required is to register a static resource with qooxdoo.

If we don't go with the custom cursor I would recommend using "crosshair" to avoid the issue with Linux. If the other platforms all use the same cursors for ne-resize/sw-resize and nw-resize/se-resize, then there should at least be a custom case for Linux like is already there for IE and Opera.
Comment 5 Ivan Furnadjiev CLA 2011-04-11 11:05:58 EDT
Cole, there is no custom case for IE and Opera (if you refer the Widget.js)... "nesw-resize" is mapped to "ne-resize" and "nwse-resize" to "nw-resize". This is exactly what  the current implementation does. By respecting the Windows cursors we are cross-browsers compliant as well. If we have to respect the Linux cursors, we have to provide six custom cursors - four for all different corners + two for nwse and nesw sizing.
Comment 6 Rüdiger Herrmann CLA 2011-04-12 03:17:50 EDT
So far, we consider RAP to be a 'platform' of its own. Apart from some allowances for specific Mac keys, RAP behaves much the same regardless on which OS/WS the browser runs.
To me, it seems too much of an effort to handle those rather exotic cursor shapes differently on different platforms.
Does that make sense? Can you live with that?
Comment 7 Cole Markham CLA 2011-04-12 13:25:36 EDT
(In reply to comment #6)
> So far, we consider RAP to be a 'platform' of its own. Apart from some
> allowances for specific Mac keys, RAP behaves much the same regardless on which
> OS/WS the browser runs.
> To me, it seems too much of an effort to handle those rather exotic cursor
> shapes differently on different platforms.
> Does that make sense? Can you live with that?

I can understand that, and that would be fine. I'm not even really sure what the use-case for those cursor types would be.

The best way to handle "exotic" cursor shapes is probably to have custom images like the up_arrow. That way they could be themed if the user wanted something different. However until I see a valid use-case for even using these cursor types, I don't see much use in adding them.