r4inm4ker
03-04-2011, 05:38 AM
Hi all,
I've tried using drapCallback & dropCallback flag from textScrollList but it it seems that the drapCallback is not working. Consider this example (this code snippets are mostly taken from http://www.naughtynathan.co.uk/?p=308):
{
string $win = "dragDropTestWindow";
if (`window -exists $win`) deleteUI -window $win;
window -title "Drag/Drop Window" $win;
columnLayout -adj 1 -rs 5;
button -h 50 -l "Drag Me!" -dgc "dragCallBack";
button -h 50 -l "Drag/Drop Here!" -dgc "dragCallBack" -dpc "dropCallBack";
separator -h 20;
textScrollList -h 80 -dgc "dragCallBack" -dpc "dropCallBack";
setParent ..;
window -e -wh 200 300 $win;
showWindow $win;
}
global proc string[] dragCallBack(string $dragCtrl,int $x, int $y, int $mods)
{
print ("dragCallBack - Drag control: "+$dragCtrl+"\n");
return {"A","B","C"};
}
global proc dropCallBack(string $dragCtrl, string $dropCtrl, string $msgs[],
int $x, int $y, int $type)
{
string $text = "dropCallBack:\n";
$text += (" Drag control: "+$dragCtrl+"\n");
$text += (" Drop control: "+$dropCtrl+"\n");
$text += (" messages: ");
$text += `stringArrayToString $msgs ", "`;
confirmDialog -m $text;
}
the textScrollList successfully received dragged messages from buttons above, but failed if I tried to drag from the TSL. Am I using it wrong or this is a bug?
nb : Tested in Maya2009 & 2011 Linux.
Thanks,
Jefri.
I've tried using drapCallback & dropCallback flag from textScrollList but it it seems that the drapCallback is not working. Consider this example (this code snippets are mostly taken from http://www.naughtynathan.co.uk/?p=308):
{
string $win = "dragDropTestWindow";
if (`window -exists $win`) deleteUI -window $win;
window -title "Drag/Drop Window" $win;
columnLayout -adj 1 -rs 5;
button -h 50 -l "Drag Me!" -dgc "dragCallBack";
button -h 50 -l "Drag/Drop Here!" -dgc "dragCallBack" -dpc "dropCallBack";
separator -h 20;
textScrollList -h 80 -dgc "dragCallBack" -dpc "dropCallBack";
setParent ..;
window -e -wh 200 300 $win;
showWindow $win;
}
global proc string[] dragCallBack(string $dragCtrl,int $x, int $y, int $mods)
{
print ("dragCallBack - Drag control: "+$dragCtrl+"\n");
return {"A","B","C"};
}
global proc dropCallBack(string $dragCtrl, string $dropCtrl, string $msgs[],
int $x, int $y, int $type)
{
string $text = "dropCallBack:\n";
$text += (" Drag control: "+$dragCtrl+"\n");
$text += (" Drop control: "+$dropCtrl+"\n");
$text += (" messages: ");
$text += `stringArrayToString $msgs ", "`;
confirmDialog -m $text;
}
the textScrollList successfully received dragged messages from buttons above, but failed if I tried to drag from the TSL. Am I using it wrong or this is a bug?
nb : Tested in Maya2009 & 2011 Linux.
Thanks,
Jefri.
