shadesize.m 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: shadesize.m
  4. Version: 2.1
  5. Type: maki
  6. Date: 23. Jul. 2007 - 17:24
  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. #include attribs/init_appearance.m
  15. Function updateObjectPosition(int w);
  16. Global Group scriptGroup;
  17. //Global Group g_cbuttons, g_sysbuttons, g_display, g_volume, g_seek, g_vis, g_links;
  18. Global Group g_cbuttons, g_sysbuttons, g_display, g_volume, g_seek, g_vis;
  19. //Global Int minumim_w, x_cbuttons, w_cbuttons, w_sysbuttons, w_volume, w_display, w_seek, w_vis, x_seek, w_links, w_links_, x_links, x_links_;
  20. Global Int minumim_w, x_cbuttons, w_cbuttons, w_sysbuttons, w_volume, w_display, w_seek, w_vis, x_seek;
  21. System.onScriptLoaded ()
  22. {
  23. initAttribs_Appearance();
  24. scriptGroup = getScriptGroup();
  25. g_cbuttons = scriptGroup.findObject("shade.cbuttons");
  26. x_cbuttons = stringToInteger(g_cbuttons.getXmlParam("x"));
  27. w_cbuttons = stringToInteger(g_cbuttons.getXmlParam("w"));
  28. g_seek = scriptGroup.findObject("shade.seek");
  29. w_seek = stringToInteger(g_seek.getXmlParam("w"));
  30. x_seek = stringToInteger(g_seek.getXmlParam("x"));
  31. g_vis = scriptGroup.findObject("shade.vis");
  32. w_vis = stringToInteger(g_vis.getXmlParam("w"));
  33. /*
  34. g_links = scriptGroup.findObject("shade.links");
  35. w_links_ = stringToInteger(g_links.getXmlParam("w"));
  36. x_links_ = stringToInteger(g_links.getXmlParam("x"));
  37. */
  38. w_sysbuttons = stringToInteger(getParam());
  39. g_display = scriptGroup.findObject("shade.display");
  40. w_display = stringToInteger(g_display.getXmlParam("w"));
  41. g_volume = scriptGroup.findObject("shade.volume");
  42. w_volume = stringToInteger(g_volume.getXmlParam("w"));
  43. }
  44. scriptGroup.onResize (int x, int y, int w, int h)
  45. {
  46. updateObjectPosition(w);
  47. }
  48. scriptGroup.onSetVisible (Boolean onoff)
  49. {
  50. if (onoff)
  51. {
  52. updateObjectPosition(scriptGroup.getWidth());
  53. }
  54. }
  55. /*
  56. artist_info_buttons_attrib.onDataChanged ()
  57. {
  58. updateObjectPosition(scriptGroup.getWidth());
  59. }
  60. */
  61. updateObjectPosition (int w)
  62. {
  63. /* if (artist_info_buttons_attrib.getData() == "1")
  64. {
  65. w_links = w_links_;
  66. x_links = x_links_;
  67. }
  68. else
  69. {
  70. w_links = x_links = 0;
  71. }
  72. */
  73. // if (w >= x_cbuttons + w_cbuttons + 2 * w_display + w_volume + w_sysbuttons + 3.5 * w_seek + w_vis + w_links)
  74. if (w >= x_cbuttons + w_cbuttons + 2 * w_display + w_volume + w_sysbuttons + 3.5 * w_seek + w_vis)
  75. {
  76. // if(g_links != null) g_links.setXmlParam("x", integerToString(x_seek - 2*w_seek - w_links));
  77. g_seek.setXmlParam("x", integerToString(x_seek - 2*w_seek));
  78. g_seek.setXmlParam("w", integerToString(3 * w_seek));
  79. g_cbuttons.setXmlParam("x", integerToString(2 + x_cbuttons + w_vis));
  80. g_volume.setXmlParam("x", integerToString(2 + x_cbuttons + w_vis + w_cbuttons));
  81. g_display.setXmlParam("x", integerToString(2 + x_cbuttons + w_cbuttons + w_volume + w_vis));
  82. // g_display.setXmlParam("w", integerToString(0 - 1 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - 3 * w_seek - w_vis - w_links));
  83. g_display.setXmlParam("w", integerToString(0 - 1 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - 3 * w_seek - w_vis));
  84. g_display.setXmlParam("relatw", "1");
  85. g_display.show();
  86. g_volume.show();
  87. g_seek.show();
  88. g_vis.show();
  89. /* if(w_links != 0) g_links.show();
  90. else g_links.hide();
  91. */
  92. }
  93. // else if (w >= x_cbuttons + w_cbuttons + 2 * w_display + w_volume + w_sysbuttons + 2 * w_seek + w_vis + w_links)
  94. else if (w >= x_cbuttons + w_cbuttons + 2 * w_display + w_volume + w_sysbuttons + 2 * w_seek + w_vis)
  95. {
  96. // if(g_links != null) g_links.setXmlParam("x", integerToString(x_seek - w_seek - w_links));
  97. g_seek.setXmlParam("x", integerToString(x_seek - w_seek));
  98. g_seek.setXmlParam("w", integerToString(2 * w_seek));
  99. g_cbuttons.setXmlParam("x", integerToString(2 + x_cbuttons + w_vis));
  100. g_volume.setXmlParam("x", integerToString(2 + x_cbuttons + w_vis + w_cbuttons));
  101. g_display.setXmlParam("x", integerToString(2 + x_cbuttons + w_cbuttons + w_volume + w_vis));
  102. // g_display.setXmlParam("w", integerToString(0 - 1 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - 2 * w_seek - w_vis - w_links));
  103. g_display.setXmlParam("w", integerToString(0 - 1 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - 2 * w_seek - w_vis));
  104. g_display.setXmlParam("relatw", "1");
  105. g_display.show();
  106. g_volume.show();
  107. g_seek.show();
  108. g_vis.show();
  109. /* if(w_links != 0) g_links.show();
  110. else g_links.hide();
  111. */
  112. }
  113. // else if (w >= x_cbuttons + w_cbuttons + w_display + w_volume + w_sysbuttons + w_seek + w_vis + w_links)
  114. else if (w >= x_cbuttons + w_cbuttons + w_display + w_volume + w_sysbuttons + w_seek + w_vis)
  115. {
  116. // if(g_links != null) g_links.setXmlParam("x", integerToString(x_seek - w_links));
  117. g_seek.setXmlParam("x", integerToString(x_seek));
  118. g_seek.setXmlParam("w", integerToString(w_seek));
  119. g_cbuttons.setXmlParam("x", integerToString(2 + x_cbuttons + w_vis));
  120. g_volume.setXmlParam("x", integerToString(2 + x_cbuttons + w_vis + w_cbuttons));
  121. g_display.setXmlParam("x", integerToString(2 + x_cbuttons + w_cbuttons + w_volume + w_vis));
  122. // g_display.setXmlParam("w", integerToString(0 - 1 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - w_seek - w_vis - w_links));
  123. g_display.setXmlParam("w", integerToString(0 - 1 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - w_seek - w_vis));
  124. g_display.setXmlParam("relatw", "1");
  125. g_display.show();
  126. g_volume.show();
  127. g_seek.show();
  128. g_vis.show();
  129. /* if(w_links != 0) g_links.show();
  130. else g_links.hide();
  131. */
  132. }
  133. // else if (w >= x_cbuttons + w_cbuttons + w_display + w_volume + w_sysbuttons + w_seek + w_links)
  134. else if (w >= x_cbuttons + w_cbuttons + w_display + w_volume + w_sysbuttons + w_seek)
  135. {
  136. // if(g_links != null) g_links.setXmlParam("x", integerToString(x_seek - w_links));
  137. g_seek.setXmlParam("x", integerToString(x_seek));
  138. g_seek.setXmlParam("w", integerToString(w_seek));
  139. g_volume.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons));
  140. g_cbuttons.setXmlParam("x", integerToString(x_cbuttons));
  141. g_display.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons + w_volume));
  142. // g_display.setXmlParam("w", integerToString(0 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - w_seek - w_links));
  143. g_display.setXmlParam("w", integerToString(0 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - w_seek));
  144. g_display.setXmlParam("relatw", "1");
  145. g_display.show();
  146. g_volume.show();
  147. g_seek.show();
  148. g_vis.hide();
  149. /* if(w_links != 0) g_links.show();
  150. else g_links.hide();
  151. */
  152. }
  153. else if (w >= x_cbuttons + w_cbuttons + w_display + w_volume + w_sysbuttons + w_seek)
  154. {
  155. g_seek.setXmlParam("x", integerToString(x_seek));
  156. g_seek.setXmlParam("w", integerToString(w_seek));
  157. g_volume.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons));
  158. g_cbuttons.setXmlParam("x", integerToString(x_cbuttons));
  159. g_display.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons + w_volume));
  160. g_display.setXmlParam("w", integerToString(0 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume - w_seek));
  161. g_display.setXmlParam("relatw", "1");
  162. g_display.show();
  163. g_volume.show();
  164. g_seek.show();
  165. g_vis.hide();
  166. // g_links.hide();
  167. }
  168. else if (w >= x_cbuttons + w_cbuttons + w_display + w_volume + w_sysbuttons)
  169. {
  170. g_cbuttons.setXmlParam("x", integerToString(x_cbuttons));
  171. g_volume.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons));
  172. g_display.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons + w_volume));
  173. g_display.setXmlParam("w", integerToString(0 - x_cbuttons - w_cbuttons - w_sysbuttons - w_volume));
  174. g_display.setXmlParam("relatw", "1");
  175. g_display.show();
  176. g_volume.show();
  177. g_seek.hide();
  178. g_vis.hide();
  179. // g_links.hide();
  180. }
  181. else if (w >= x_cbuttons + w_cbuttons + w_display + w_sysbuttons)
  182. {
  183. g_cbuttons.setXmlParam("x", integerToString(x_cbuttons));
  184. g_volume.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons));
  185. g_display.setXmlParam("x", integerToString(x_cbuttons + w_cbuttons));
  186. g_display.setXmlParam("w", integerToString(0 - x_cbuttons - w_cbuttons - w_sysbuttons));
  187. g_display.setXmlParam("relatw", "1");
  188. g_display.show();
  189. g_volume.hide();
  190. g_seek.hide();
  191. g_vis.hide();
  192. // g_links.hide();
  193. }
  194. else
  195. {
  196. g_cbuttons.setXmlParam("x", integerToString(x_cbuttons));
  197. g_volume.hide();
  198. g_display.hide();
  199. g_seek.hide();
  200. g_vis.hide();
  201. // g_links.hide();
  202. }
  203. }