...
And I've upload a new sample here:
http://foo-wsh-panel-mod.googlecode.com/hg...rop%20Basic.txt
one remark: to add item in the target playlist, we have to activate it in the on_drag_drop() function, then items are copied automatically. I think that the target playlist to fill should be user defined, and not forced by default to the active playlist, because when i want to copy a track from my active playlist to another one (from my wsh playlist manager) with drag'n'drop method, the target playlist became the active playlist and i lost my source playlist in my playlist viewer
could you consider that point and maybe let us filling the target playlist by coding it ourselves like done in my example below, with GetSelections and a loop on each metadb pointer selected, but it's requiring a method to add items to an existing playlist (for now i use a context command provided by foo_utils to add or send items to a 'named' playlist)
function on_drag_drop(test, x, y, mask) {
var glist = fb.GetSelections();
var pl_name;
// grab the target playlist id from the y pos in the wsh playlist manager panel (not shared here)
var target_pl_id = GetIDfromYpos(y);
// get the name of the target playlist (in order to use the run context command that will do the add item to it!)
pl_name = fb.GetPlaylistName(target_pl_id);
// -- by passed -- Switch to the target playlist (on drag_drop, dragged item are copied to the active playlist by default...)
// -- by passed -- fb.ActivePlaylist = target_pl_id;
// for each item dragged, we add it to the target playlist
for(i=0;i<glist.Count;i++) {
fb.RunContextCommandWithMetadb(pl_name, glist.Item(i));
}
dragging = false;
window.Repaint();
}
using the run context command is not adapted because it could exist playlists with same name , so a method to add items to a playlist(idx) would be required.
all other idea are welcomed ... btw, the actual works perfectly, so don't break it if my suggestion is to hard to provide.