will try to use the new method. thank you.
EDIT: AppendTo method used for creating Popup, but popup still appears to the left
any idea or any sample that work, i can't figure out what's wrong, example below:
function sort_group_menu(x, y) {
var idx;
var _menu = window.CreatePopupMenu();
var _sort = window.CreatePopupMenu();
var _groupby = window.CreatePopupMenu();
_sort.AppendTo(_menu, MF_STRING, "Sort");
_sort.AppendMenuItem(MF_STRING, 100, "Sort by album");
_sort.AppendMenuItem(MF_STRING, 110, "Sort by file path");
_sort.AppendMenuItem(MF_STRING, 120, "Sort by artist");
_groupby.AppendTo(_menu, MF_STRING, "Group by");
_groupby.AppendMenuItem(MF_STRING, 200, "Group by album");
_groupby.AppendMenuItem(MF_STRING, 210, "Group by file path");
_groupby.AppendMenuItem(MF_STRING, 220, "Group by artist");
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 100:
fb.RunMainMenuCommand("Edit/Sort/Sort by album");
break;
case 110:
fb.RunMainMenuCommand("Edit/Sort/Sort by file path");
break;
case 120:
fb.RunMainMenuCommand("Edit/Sort/Sort by artist");
break;
case 200:
panel.sort_group_mode = 0;
window.SetProperty("SYSTEM.sortgroup.mode", panel.sort_group_mode);
var new_group_key = "%album artist%%album%%discnumber%";
window.SetProperty("SYSTEM.group Key", new_group_key);
tf_group_key = fb.TitleFormat(new_group_key);
break;
case 210:
panel.sort_group_mode = 1;
window.SetProperty("SYSTEM.sortgroup.mode", panel.sort_group_mode);
var new_group_key = "$replace(%path%,%filename_ext%,)";
window.SetProperty("SYSTEM.group Key", new_group_key);
tf_group_key = fb.TitleFormat(new_group_key);
break;
case 220:
panel.sort_group_mode = 2;
window.SetProperty("SYSTEM.sortgroup.mode", panel.sort_group_mode);
var new_group_key = "$replace(%path%,%filename_ext%,)";
window.SetProperty("SYSTEM.group Key", new_group_key);
tf_group_key = fb.TitleFormat(new_group_key);
break;
};
_sort.Dispose();
_groupby.Dispose();
_menu.Dispose();
return true;
};
thanx by advance
EDIT 2:
hmm weird, just tested on another PC (my laptop), and it's working on it! will try again on my desktop PC tomorrow...