home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 November / CDVD1105.ISO / Util / Winamp / Skins / Anime_Shogo.wal / scripts / checkbox.m < prev    next >
Text File  |  2004-08-15  |  1KB  |  33 lines

  1. #include "../../../lib/std.mi"
  2.  
  3. Global Text textBox;
  4. Global Togglebutton buttonCheckBox;
  5. Global String strItem = "";
  6. Global String strSection = "";
  7. Global int intDefaultValue = 999;
  8.  
  9. System.onScriptLoaded() {
  10.     textBox = System.getScriptGroup().getObject("checkbox.text");
  11.     buttonCheckBox = System.getScriptGroup().getObject("checkbox.toggle");
  12. }
  13.  
  14. System.onSetXuiParam(String strParam, String strValue) {
  15.     if (strUpper(strParam) == "USETEXT") textBox.setText(strValue);
  16.     if (strUpper(strParam) == "PRIVATEINTITEM") strItem = strValue;
  17.     if (strUpper(strParam) == "DEFAULT") intDefaultValue = System.stringToInteger(strValue);
  18.     if (strItem != "" && strSection != "" && intDefaultValue != 999) {
  19.         buttonCheckBox.setActivated(System.getPrivateInt(getSkinName(), strItem, intDefaultValue));
  20.     }
  21. }
  22.  
  23. buttonCheckBox.onLeftClick() {
  24.     buttonCheckBox.setActivated(!buttonCheckBox.getActivated());
  25. }
  26.  
  27. textBox.onLeftButtonUp(Int intPosX, Int intPosY) {
  28.     buttonCheckBox.setActivated(!buttonCheckBox.getActivated());
  29. }
  30.  
  31. buttonCheckBox.onActivate(Int intActivated) {
  32.     System.setPrivateInt(getSkinName(), strItem, intActivated);
  33. }