syncbutton.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: syncbutton.m
  4. Version: 1.0
  5. Type: maki
  6. Date: 25. Jun. 2007 - 14:04
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. -----------------------------------------------------
  12. ---------------------------------------------------*/
  13. #include <lib/std.mi>
  14. Global GuiObject mainButton, activeOverlay;
  15. Global Boolean mouseDown;
  16. Global Int activeOverlay_Y;
  17. System.onScriptLoaded ()
  18. {
  19. mainButton = getScriptGroup().findObject(getToken(getParam(), ";", 0));
  20. activeOverlay = getScriptGroup().findObject(getToken(getParam(), ";", 1));
  21. activeOverlay_Y = activeOverlay.getGuiY();
  22. mainButton.onsetvisible(mainButton.isvIsible());
  23. }
  24. mainButton.onLeftButtonDown (int x, int y)
  25. {
  26. mouseDown = 1;
  27. activeOverlay.setXmlParam("y", integerToString(activeOverlay_Y+1));
  28. }
  29. mainButton.onLeftButtonUp (int x, int y)
  30. {
  31. mouseDown = 0;
  32. activeOverlay.setXmlParam("y", integerToString(activeOverlay_Y));
  33. }
  34. mainButton.onleaveArea ()
  35. {
  36. activeOverlay.setXmlParam("y", integerToString(activeOverlay_Y));
  37. }
  38. mainButton.onEnterArea ()
  39. {
  40. if (mouseDown) activeOverlay.setXmlParam("y", integerToString(activeOverlay_Y+1));
  41. }
  42. mainButton.onSetVisible (Boolean onoff)
  43. {
  44. if (onoff) activeOverlay.show();
  45. else activeOverlay.hide();
  46. }