xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: On Changing the Mouse Cursor Appearance
Date Sat, 10 Jun 2006 17:33:30 GMT
Hi Phillip,

news <news@sea.gmane.org> wrote on 06/10/2006 08:54:43 AM:

>      I'm having problems on changing the appearance of the mouse cursor 
when 
> an event happens. I have an svg element on a JSVG Canvas, rect to be 
exact, 
> and I want to change the cursor whenever I click on the parts of the
> rectange.

   There is a good chance that this is a bug in Batik.  I think we only
check the cursor property when the mouse enters/exits an element. So
a change of the cursor without the cursor leaving or entering an element
may not update the cursor.

   If you could provide a test case in a bugzilla bug it would help us
check and ensure that we don't forget about this problem (if it is one).

> I want crosshair if I hover the mouse in the middle, and w-resize 
> and e-resize when the mouse is hovered in the edges. I already have my 
event 
> listeners on the rectangle and i want it to go with the mouseover event.

   You might consider creating 'hidden' elements over the areas you want
the cursor to change (thin rects on the edges of the base rect, that have
the cursor attribute already set).


>      I tried including a cursor attribute in the rect element, such as:
> 
>      <rect id="BaseRectangle" x="0" y="0" height="300" width="515" 
fill="red" 
> cursor="default"/>
> 
>     and I change the attribute's value to a type I want in the event 
handler:
> 
>      ( (Element) evt.getTarget() ).setAttribut("cursor", "w-resize" );
> 
>      Is there anything I'm doing wrong or anything I'm lacking to do?
> 
>      I also tried including cursor and pointer-events (with value 
"fill")
> attribute at the svg (root) element and also the latter to the rect 
element, 
> but nothing changes.
> 
>      I would really appreciate answers from you. Thank you very much in 
> advance.

   Probably not the answer you wanted to hear, but there it is...


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message