PDA

View Full Version : dragCallback Buggy / not Functioning


claudiof
04-03-2009, 06:27 PM
I am testing dragCallback skill of controls.
but unfortunately the targets says this is not working in Windows OS.

Just wantto learn If I can get which text is dragged into my scrolllist.
for example I wantto get the dragged text (middle mouse click and drag)
from shelf button to my own control ?

impossible ?


global proc string[] MyDropCallBack(string $dragControl, string $dropControl, string $msgs[], int $x, int $y, int $type)

{

print "hellooOOo Why This Print Doesn't Working ?.why no triggering ?";
string $myArray[]={ "an empty array" };
return $myArray;
}
window;
paneLayout;

textScrollList -numberOfRows 8 -allowMultiSelection true
-dropCallback MyDropCallBack
-append "one" -append "two" -append "three"
-append "four" -append "five" -append "six"
-append "seven" -append "eight" -append "nine"
-append "ten" -append "eleven" -append "twelve"
-append "thirteen" -append "fourteen" -append "fifteen"
showWindow;

A-OC
04-03-2009, 08:19 PM
It looks like it needs a drag callback as well.

Try this:

global proc TestDropCB( string $dragControl, string $dropControl, string $msg[], int $x, int $y, int $type)
{
print "Testing drop callback\n";
}

global proc string[] TestDragCB(string $dragControl, int $x, int $y, int $mods)
{
print "Testing drag callback\n";
return{" an empty array "};
}

window;
paneLayout;
textScrollList
-numberOfRows 8
-allowMultiSelection true
-dragCallback TestDragCB
-dropCallback TestDropCB
-append "one" -append "two" -append "three"
-append "four" -append "five" -append "six"
-append "seven" -append "eight" -append "nine"
-append "ten" -append "eleven" -append "twelve"
-append "thirteen" -append "fourteen" -append "fifteen";
showWindow;

claudiof
04-04-2009, 01:53 AM
it works if you drag from the own items of same textScrollList.
or from any other control which have callbacks.

and problem starts here.

prints Testing drag callback.
but
never prints "Testing drop callback".



try to middle mouse drag a shelf button to our textScrollList.
TestDropCB never triggers.


simply I wantto get the dropped text (a shelf button via middle mouse click) into
textScrollList.

the documents says if the source has no callback procedures it doesnt work.
thus getting a text via mdidle mouse button from any shelff button to own control wont work so shelf buttons have no callbacks by default.
(this is default working for a textfield control).
:scream:

A-OC
04-04-2009, 04:23 AM
prints Testing drag callback.
but
never prints "Testing drop callback".
It does execute both callbacks in my clean scene.

Other than that I have to agree with you.

So it seems like you just have to add a drag callback to that shelf button of yours.

BTW do you reside in Santiago?

CGTalk Moderation
04-04-2009, 04:23 AM
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.