infoline.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: infoline.m
  4. Version: 1.0
  5. Type: maki
  6. Date: 06. Nov. 2007 - 22:40
  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 Text txt;
  15. Global Text label;
  16. Global Layer link;
  17. Global Group sg;
  18. Global Int shift = 0;
  19. System.onScriptLoaded ()
  20. {
  21. sg = getScriptGroup();
  22. txt = sg.getObject("text");
  23. label = sg.getObject("label");
  24. link = sg.getObject("link");
  25. }
  26. System.onSetXuiParam (String param, String value)
  27. {
  28. if (strlower(param) == "shift") shift = stringToInteger(value);
  29. if (strlower(param) == "label") label.setText(value);
  30. if (strlower(param) == "link") link.setXmlparam("tooltip", value);
  31. }
  32. label.onTextChanged (String newtxt)
  33. {
  34. int w = label.getAutoWidth() + shift;
  35. txt.setXmlParam("x", integerToString(w));
  36. txt.setXmlParam("w", integerToString(-w));
  37. }