mlmenu.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include <lib/std.mi>
  2. #include "attribs.m"
  3. System.onScriptLoaded() {
  4. initAttribs();
  5. menubar_ml_attrib.onDataChanged();
  6. }
  7. menubar_ml_attrib.onDataChanged() {
  8. Group Player = getscriptgroup().findobject("player.content.ml.dummy.group");
  9. Group MenuBar = getscriptgroup().findobject("wasabi.menubar.ml");
  10. Layout main = getscriptgroup().getParentLayout();
  11. main.beforeRedock();
  12. if (getData() == "1") {
  13. Player.setXmlParam("y","17");
  14. MenuBar.show();
  15. main.snapAdjust(0,0,0,0);
  16. }
  17. else {
  18. Player.setXmlParam("y","0");
  19. MenuBar.hide();
  20. main.snapAdjust(0,0,0,17);
  21. }
  22. main.Redock();
  23. }
  24. System.onAccelerator(String action, String section, String key) {
  25. if (menubar_main_attrib.getData() == "0") return;
  26. Layout l = getScriptGroup().getParentLayout();
  27. if (!l.isActive()) return;
  28. // we use the general accelerators otherwise use specific ones
  29. // will allow the skin to cope with variations in localisations
  30. if (action == "MENUHOTKEY_FILE" || action == "ML_MENUHOTKEY_FILE")
  31. {
  32. getScriptGroup().findObject("ML_File.menu").sendAction("open", "", 0, 0, 0, 0);
  33. complete;
  34. }
  35. if (action == "MENUHOTKEY_VIEW" || action == "ML_MENUHOTKEY_VIEW")
  36. {
  37. getScriptGroup().findObject("ML_View.menu").sendAction("open", "", 0, 0, 0, 0);
  38. complete;
  39. }
  40. if (action == "MENUHOTKEY_HELP" || action == "ML_MENUHOTKEY_HELP")
  41. {
  42. getScriptGroup().findObject("ML_Help.menu").sendAction("open", "", 0, 0, 0, 0);
  43. complete;
  44. }
  45. }