Cursors (again) HELP!

Cursors (again) HELP!

Anonymous
Not applicable
535 Views
5 Replies
Message 1 of 6

Cursors (again) HELP!

Anonymous
Not applicable
This is really driving me insane. I can disable the AutoCAD cursor by
simply using a call like this (from the article "Input Point Filter and
Monitor Example" in the Developer's Guide):

curDoc()->inputPointManager()->disableSystemCursorGraphics();

That's nice, but now i don't know how to actually enable a new, custom
cursor. There's lots of places in the developer guide where it talks about
the fact that it is POSSIBLE to add a custom cursor, but i can't find any
documentation on HOW to actually do this. Some of my commands would make a
LOT more sense if i could change the cursor. Can anyone tell me how to
display a custom cursor, or even point me in the right direction? None of
the examples that come with the ObjectARX SDK have anything about enabling a
new cursor. Even the example that has this line above just disables it and
doesn't do anything! Help!
0 Likes
536 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Well, i've decided that i'm just going to manually draw a cursor using the
Point Monitor and AutoCAD's AcGiViewportDraw->draw( ) function. This sorta
(edited), since i have to manually figure out the size of the window, then
adjust the size of my faked out cursor, but at least it will work
temporarily...
0 Likes
Message 3 of 6

Anonymous
Not applicable
OK, i think i found another way to do this that's a little closer to the
functionality i would expect, and i thought i'd share.

If you disable the cursor graphics by using
curDoc()->inputPointManager()->disableSystemCursorGraphics(), i figured you
should just be able to use SetCursor( ) to provide your own cursor. When i
originally tried this, however, it didn't work. I found out (sorta) why.
It actually DOES change the cursor, but only until the cursor moves. Then
it goes back to being blank, thanks to the disableSystemCursorGraphics.
Since it only disappears when the cursor moves, i thought about the
AcEdInputPointMonitor and Filter - both of those functions are called
anytime the cursor is moved. So, my solution was to put a SetCursor( ) call
in my point monitor (or in the filter). This way the cursor gets set
anytime the user moves the mouse, and this seems to work. I kinda figure
this has got to be a work-around though, and it seems that calling that
SetCursor function all the time is sorta inefficient - but hey, it works...
0 Likes
Message 4 of 6

Anonymous
Not applicable
Like you, I was trying to change the cursor shape and I found
this in VS6 help|SetCursor():

 

If your application must set the cursor while it is in a
window, make sure the class cursor for the specified window's class is set to
NULL. If the class cursor is not NULL, the system restores the class cursor
each time the mouse is moved.

 

I didn't try it yet.

 

alex

0 Likes
Message 5 of 6

Anonymous
Not applicable
Hi Justavian,

I been going around here in the discussion group for weeks now for the same task you looking for. Changing the autocad cursor image.

Can you please give me some of your tips or sample code to begin with.

Thaks in Advance
Ajustin
0 Likes
Message 6 of 6

Anonymous
Not applicable
To change the cursor, you need to first disable the standard crosshairs -
then you can set it to what you like.

There are two types of cursors you can set it to. The first is a cursor
that is drawn using AutoCAD primitives. This can be done using either
AcEdInputPointMonitor::monitorInputPoint( ) or
AcEdInputPointFilter::processInputPoint( ) (that's the easiest way, though
there are other things you could do). Those two functions pass in
AcGiViewportDraw pointer, which you can then use to draw whatever type of
AutoCAD cursor you want.

The other option is to just use a standard windows cursor. To do this, you
need to register a hook to catch all the WM_MOUSEMOVE messages. Then call
setcursor to force it to use your windows cursor.


So, in summary:
1) Call curDoc()->inputPointManager()->disableSystemCursorGraphics() to
tell AutoCAD to stop drawing the cross hairs.
2a) If you want an AutoCAD entity type cursor, derive from
AcEdInputPointMonitor, and implement monitorInputPoint. Using the
AcGiViewportDraw, draw the cursor.
2b) To use a normal cursor, register a hook function with
acedRegisterFilterWinMsg. Catch all the WM_MOUSEMOVE, and simply call
::SetCursor() as you would in any Windows app.
3) When you're done, don't forget to turn the AutoCAD cursor back on
curDoc()->inputPointManager()->enableSystemCursorGraphics()

If you have problems implementing it, let me know...

-Rich



wrote in message news:4919345@discussion.autodesk.com...
Hi Justavian,

I been going around here in the discussion group for weeks now for the same
task you looking for. Changing the autocad cursor image.

Can you please give me some of your tips or sample code to begin with.

Thaks in Advance
Ajustin
0 Likes