Grab cursors?

1,009 views
Skip to first unread message

graham.reeds

unread,
Jan 10, 2008, 1:33:34 AM1/10/08
to Google Web Toolkit
This isn't related to GWT per se, but it is related to a project in
GWT.

GoogleMaps has drag hand cursors in both Windows (IE6/7) and FireFox.
However my searches of the web only comes back with lists of CSS2.1
cursors which don't have the grabby drag hands, and the proprietary -
moz-grab.

So how does Google implement the IE version since I can't find any
information about it on the web?

Thanks, Graham Reeds

Peter Blazejewicz

unread,
Jan 10, 2008, 2:37:37 PM1/10/08
to Google Web Toolkit
hi,

I think that is via custom url type:
.className{
cursor: url(pathToCurFile.cur);
}

hit "Search" in windows explorer and type ".cur",
you will find hundreds,
run "serach" againts your Temp-Int-Files folder and if you just
watched GMaps you will find Google cur files there,

regards,
Peter

graham.reeds

unread,
Jan 10, 2008, 4:03:18 PM1/10/08
to Google Web Toolkit
Okay. I'll have to take your word for it, but I have no cursors in my
Temporary Internet Files.

I'll look into custom cursors.

Thanks, G.

On Jan 10, 7:37 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:

Peter Blazejewicz

unread,
Jan 10, 2008, 4:10:33 PM1/10/08
to Google Web Toolkit

graham.reeds

unread,
Jan 10, 2008, 5:05:33 PM1/10/08
to Google Web Toolkit
Thank you *very* much!

On Jan 10, 9:10 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:
> hi Graham,
> here you're:http://www.google.com/intl/en_ALL/mapfiles/closedhand.curhttp://www.google.com/intl/en_ALL/mapfiles/openhand.cur

graham.reeds

unread,
Jan 11, 2008, 1:05:38 AM1/11/08
to Google Web Toolkit
Okay. Just done a bit of testing with this and while
DOM.setStyleAttribute(mouseListenerContainer.getElement(), "cursor",
"url(cursors/closedhand.cur)");
works in the hosted browser it doesn't work in IE or FF.
DOM.setStyleAttribute(mouseListenerContainer.getElement(), "cursor",
"url(\"cursors/closedhand.cur\"));
works in IE but not FF.
DOM.setStyleAttribute(mouseListenerContainer.getElement(), "cursor",
"url(\"cursors/closedhand.cur\"), default");
works in both IE and FF. Haven't test Opera or Safari.

Now, why doesn't the cursor stick in FF...

G.


On Jan 10, 10:05 pm, "graham.reeds" <graham.re...@gmail.com> wrote:
> Thank you *very* much!
>
> On Jan 10, 9:10 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
> wrote:
>
> > hi Graham,
> > here you're:http://www.google.com/intl/en_ALL/mapfiles/closedhand.curhttp://www.g...

Peter Blazejewicz

unread,
Jan 11, 2008, 7:44:25 AM1/11/08
to Google Web Toolkit
hi,

url equals: GWT.getModuleBase()+"cursors/cursor.cur"

also just use .css classes and gwt addStyleName or
addStyleDependantName, that's easier to develop, you could create
static html for testing cursors without any code,

<div class="openhand">open</div>
<div class="closedhand">closed</div>

.closedhand {
cursor: url("./cursors/closedhand.cur");
}

.openhand {
cursor: url("./cursors/openhand.cur");
cursor: -moz-grab;
}


regards,
Peter

Christian Wolf

unread,
Jan 11, 2008, 7:55:10 AM1/11/08
to Google Web Toolkit
I use

DOM.setStyleAttribute(getElement(),"cursor", "url(\"images/grabbing.cur
\"),move");

and it works.

what do you mean with "why doesn't the cursor stick in FF"?

graham.reeds

unread,
Jan 12, 2008, 8:24:38 AM1/12/08
to Google Web Toolkit
It's a MouseListenerAdaptor problem. I have the following cursors set
on the various mouse adaptor functions (as well as various other
code):
onMouseEnter openHand
onMouseDown closedHand
onMouseMove -
onMouseUp openHand
onMouseExit default

So it should switch to closed when you press the mousebutton. This
works for IE perfectly. In FF the closed hand happens but immediately
switches back to the openHand.

Peter Blazejewicz

unread,
Jan 13, 2008, 8:12:32 PM1/13/08
to Google Web Toolkit
hi Graham,
I would look into GWT tookit PushButton implementation at least to see
how they done that (mouse event implementation) for that kind of
widget,

regards,
Peter

graham.reeds

unread,
Jan 18, 2008, 7:38:08 PM1/18/08
to Google Web Toolkit
I looked but I can't find anything of any relevance. I followed it
through CustomButton, and the MOUSEEVENT functions but it seems to
tail off into a mass of twiddling functions. Maybe I was looking for
the wrong function call or something. I guess it isn't a deal-
breaker, just a low priority.


On Jan 14, 1:12 am, Peter Blazejewicz <peter.blazejew...@gmail.com>
Reply all
Reply to author
Forward
0 new messages