On 13/01/2015 at 04:51, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13+
Platform: Windows ;
Language(s) : C++ ;
---------
I don't know how to catch BFM_INPUT_DOUBLECLICK in a GeUserArea using GetParameter(DescLevel)) , here is the code:
Bool nodeUserArea::InputEvent(const BaseContainer& msg)
{
GeData data;
// check if mouse event
msg.GetParameter(DescLevel(BFM_INPUT_DEVICE), data);
if (data.GetInt32() == BFM_INPUT_MOUSE)
{
// check if left mouse button
msg.GetParameter(DescLevel(BFM_INPUT_CHANNEL), data);
if (data.GetInt32() == BFM_INPUT_MOUSELEFT)
{
// now get the coordinates
msg.GetParameter(DescLevel(BFM_INPUT_X), data);
const Int32 xCoordiante = data.GetInt32();
msg.GetParameter(DescLevel(BFM_INPUT_Y), data);
const Int32 yCoordiante = data.GetInt32();
GePrint("UserArea hit at " + String::IntToString(xCoordiante) + " : " + String::IntToString(yCoordiante));
}
msg.GetParameter(DescLevel(BFM_INPUT_CHANNEL), data);
if (data.GetBool() == BFM_INPUT_DOUBLECLICK)
{
// now get the coordinates
msg.GetParameter(DescLevel(BFM_INPUT_X), data);
const Int32 xCoordiante = data.GetInt32();
msg.GetParameter(DescLevel(BFM_INPUT_Y), data);
const Int32 yCoordiante = data.GetInt32();
GePrint("UserArea double click at " + String::IntToString(xCoordiante) + " : " + String::IntToString(yCoordiante));
addNode(xCoordiante, yCoordiante);
Redraw();
}
}
return true;
};