1
0

vis.m 895 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include <lib/std.mi>
  2. #include "attribs.m"
  3. Function updateVisCmd();
  4. Global Button btnVisReattach;
  5. Global Layout thislayout;
  6. Global Int evershown;
  7. System.onScriptLoaded() {
  8. initAttribs();
  9. thislayout = getScriptGroup().getParentLayout();
  10. BtnVisReattach = getScriptGroup().findObject("button.vis.reattach");
  11. }
  12. thisLayout.onSetVisible(int show) {
  13. if (!evershown) {
  14. evershown = 1;
  15. updateVisCmd();
  16. }
  17. }
  18. BtnVisReattach.onLeftClick() {
  19. Container c = getContainer("main");
  20. if (c.getLayout("shade").isVisible()) c.switchToLayout("normal");
  21. vis_detach_attrib.setData("0");
  22. }
  23. viscmd_menu_attrib.onDataChanged() {
  24. updateVisCmd();
  25. }
  26. updateVisCmd() {
  27. Button btn = getScriptGroup().findObject("button.vis.misc");
  28. if (btn) {
  29. if (viscmd_menu_attrib.getData() == "1") {
  30. btn.setXmlParam("action", "Vis_Menu");
  31. } else {
  32. btn.setXmlParam("action", "Vis_Cfg");
  33. }
  34. }
  35. }