Is there a way to setup custom mouse icons?
Yes, I have been able to do that with the .NET Framework.
The mouse pointer is represented by the Cursor class, and each Control has a System.Windows.Forms.Control.Cursor property that specifies the pointer for that control. The Cursor class contains properties that describe the pointer, such as the Position and HotSpot properties, and methods that can modify the appearance of the pointer, such as the Show, Hide, and DrawStretched methods.
In the Cursor class, there is a static Current property that represents the current used cursor. You can create a custom mouse cursor by using the constructor Cursor(String) or Cursor(Stream).
c = dotnetclass "System.Windows.Forms.Cursor" c.Current = dotnetobject "System.Windows.Forms.Cursor" "myCursor.ico"
but where and how do you want to show it? you can show this cursor just over dotnet controls
So it won’t work on viewports and standard interface, right? Any solution for that? (SDK apart)
I’m looking to have it just over the tool that I’m developing. I’ll have a look at what you have there. Will it only use ico files?
Hum from what I remember using .net will change the cursor on any “surface”, but as soon as you move the mouse it returns to the “correct” cursor (maybe this only happens if the main thread is not busy however? not sure). On most .net controls you can set the cursor property to whatever cursor you want, which will remain even if you move the mouse, but of course only over that control.
As for the cursors themselves you can use “System.Windows.Forms.Cursors” along with “System.Windows.Forms.Cursor” (notice the S at the end, they are two different classes) to set the current cursor to one of the standard windows cursors. For instance:
cursors = dotNetClass "System.Windows.Forms.Cursors" cursor = dotNetClass "System.Windows.Forms.Cursor" cursor.current = cursors.WaitCursor
will set the cursor to the hourglass in XP and to the twirly circle in Vista.
Maybe this example, can be implemented in max?
Thanks guys, I will be trying this in the next few days and I will post what I get working.
JHN, I think that can be adapted.
cursors = dotNetClass “System.Windows.Forms.Cursors”
hand_move = dotNetObject “System.Windows.Forms.Cursor” “C:\WINDOWS\Cursors\hmove.cur”
cursors.Hand.Current = hand_move
Here is a just a piece of the insanity that I have been working on.
Whoa. Custom tool for a client or public?
Are you trying to use every control type available? =P
Ya I have a goal, I want to use every Max script command possible in one tool;)
Yes this is all Max script. The full tool has, so far, five scripted geometry plugins and this main UI. The UI is now using a createDialog with a main rollout and two sub rollouts that you see on the right side. Those sub rollouts display the rollouts from the scripted geometry objects when they are selected in the treeView. For the left side I have a dotNet flowLayOut as the main panel then I’m loading in tool strips, a label, tabControl and then a splitContainer with treeView and ListView. The tree and list are synced up so they act as one. Part of the syncing is happening via data that is stored in a struct and then converted to a dotNetMxsValue and placed in the tag property of each of the treeNodes and listItems.
Sorry, this will not be for the public but I figure I should share the ideas of how I’m building it.
That’s looks pretty intense! It’s a tool for blending animation clips I presume!?
It’s a lot of work to build all that to have a mousecursor change it’s picture
That is the tool, It allows for non-linear animation of mouse cursors. Then I just capture the mouse cursor to an MOV on the fly. Fastest way to create a TV series ever.
Wicked! The world of mouse cursor animations will never be the same again.
Really like to just see other peoples interfaces, can learn a lot from looking alone! Thanks for sharing!
I’m looking for a custom cursor for my tool too.
Nice and easy to change the cursor using that dotnet line.
How the heck does one go about stopping max from resetting the cursor to one of it’s choice?
I’m trying to avoid using while loops or callbacks here for my ‘pick mode’
Not sure off hand, I only needed them over the UI I was creating. Are you trying to use them over the Max UI and they are changing back on you?
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.