On 08/08/2014 at 08:03, xxxxxxxx wrote:
In my CommandPlugin I have a mixed dialog with an userarea and normal dialog fields.
Now I want to know the mouse coordinates, when the mouse is over the userarea.
I can do that with Message() and read out the mouse coordinates.
class Area(gui.GeUserArea) :
def DrawMsg(self, x1, y1, x2, y2, msg) :
global bmpXY
self.DrawSetPen(c4d.COLOR_BG) #Set the Background Color
self.DrawRectangle(x1, y1, x2, y2)
self.DrawBitmap(bmpXY, 0,0, 300,300, 0,0, 300,300, c4d.BMP_NORMAL)
def Message(self, msg, result) :
if msg.GetId() :
self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, msg) #Mouse over UA and left button not clicked
if msg.GetLong(c4d.BFM_INPUT_VALUE)==0:
mouse_x=msg.GetLong(c4d.BFM_INPUT_X)
mouse_y=msg.GetLong(c4d.BFM_INPUT_Y)
#print "x+y: ", mouse_x, mouse_y
return self.Message(msg, result)
#return GeUserArea.Message(self, msg, result)
The manual tells me how to do this, but it is not working for me.
Both return self.Message(msg, result) and return GeUserArea.Message(self, msg, result)
are not working for me.
How should I approach this?
GeUserArea.Message
(self, msg, result)[](file:///D:/Users/pgrooff/Documents/pim/c4d/Python%20Help%20R15/help/modules/c4d.gui/GeUserArea/index.html?highlight=message#GeUserArea.Message)
Override this function if you want to react to more messages than covered by the other functions. Normally this is not necessary. Be sure to include a call the parent version of this function, [Message()
](file:///D:/Users/pgrooff/Documents/pim/c4d/Python%20Help%20R15/help/modules/c4d.gui/GeUserArea/index.html?highlight=message#GeUserArea.Message):
def Message(self, msg, result) :
if msg.GetId() :
pass #do something
return True
return GeUserArea.Message(self, msg, result)