SetMousePointer() will not "stick" in GeDialog
-
Hey guys,
Sorry in advance for not providing any code. I guess this question is more about the general implementation of "SetMousePointer" as opposed to my specific code.
Context: In my GeDialog plugin are some GeUserArea-s. Each GeUserArea contains buttons (i.e. custom "DrawRectangle"-s), all of which all have a "hover" effect upon the mouse-over and mouse-out events of the user's cursor. That's all working well.
Goal: As a way to wrap up the UX for the buttons, I would like to have the mouse cursor change into a "MOUSE_POINT_HAND" (int 19) when hovering over the buttons and revert back to "MOUSE_NORMAL" (int 2) when hovering out.
Problem: Upon moving my mouse within the GeDialog/GeUserArea-s, my mouse cursor will constantly be flickering/oscillating between the "MOUSE_POINT_HAND" cursor and the default cursor.
Hypothesis: I'm wondering if the problem could be due to the few "Redraw()" calls and one "OffScreenOn()" call on my GeUserArea-s, but even after commenting them out, the mouse cursor still flickers between its "MOUSE_POINT_HAND" and default state anywhere within my GeDialog.
Question: Is my hypothesis above correct, or is there some part of the built-in GeDialog or GeUserArea modules that overwrite the cursor state?
That is all. Any guidance or help would be greatly appreciated.
Thank you very much!
-
Hello @justinleduc,
Sorry for the delayed answer.
You have a point that the discussion on some abstract questions doesn't require any code. However, you have a very specific question, namely you're struggling from your cursor constantly flickering between cursor states. This is your exact code that produces this undesirable result, so this is not an abstract question.
According to my observations there's no issues with flickering cursor in GeUserArea in C4D 2024.2. You can find some good examples in our C++ repository. for example you can start with C++ SDK - Example Dialog. Please also make sure you familiarized yourself with the following manual pages:
Especially the GeUserArea::Message() would be something of your interest.
If you're still observing the issue please provide a minimal code snippet that gives context to our discussion.
Cheers,
Ilia