View Single Post
Old 27th March 2003, 16:58   #5
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
Thanks a lot jimmy

Here is one other quastion for U:

I wrote this script and every time i press on my button winamp crashed down. Can you say me why???

#include "../../../lib/std.mi"
#include "../../../lib/config.mi"


Function setTempText(String txt);
Function emptyTempText();
Function setSuperText(String txt);

Class ToggleButton HintToggleButton;
Class ConfigAttribute ToggleConfigAttribute;


Global HintToggleButton ToggleXFade, ToggleShuffle, ToggleRepeat;
Global ToggleConfigAttribute attr_repeat, attr_shuffle, attr_crossfade;
Global Container MainContainer;
Global Layout layoutNormal;
Global Group displayGroup ;

System.onScriptLoaded() {
//Main Layout
MainContainer= getContainer("main");
layoutNormal=MainContainer.getLayout("normal");

displayGroup = layoutNormal.getObject("player.main.buttons");



ToggleXFade = displayGroup.getObject("Crossfade");
ToggleShuffle = displayGroup.getObject("Shuffle");
ToggleRepeat = displayGroup.getObject("Repeat");

if (ToggleXFade != NULL && attr_crossfade != NULL) ToggleXFade.setActivated(StringToInteger(attr_crossfade.getData()));
if (ToggleShuffle != NULL && attr_shuffle != NULL) ToggleShuffle.setActivated(StringToInteger(attr_shuffle.getData()));
if (ToggleRepeat != NULL && attr_repeat != NULL) ToggleRepeat.setActivated(StringToInteger(attr_repeat.getData()));

}

HintToggleButton.onLeftButtonDown(int x, int y) {
if (HintToggleButton == ToggleXFade) setSuperText("Crossfade");
else if (HintToggleButton == ToggleRepeat) setSuperText("Repeat");
else if (HintToggleButton == ToggleShuffle) setSuperText("Shuffle");
}

HintToggleButton.onToggle(int onoff) {
String cmd, txt;
txt="none";
if (HintToggleButton == ToggleXFade) {
txt = "Crossfade";
} else if (HintToggleButton == ToggleRepeat) {
txt = "Repeat";
} else if (HintToggleButton == ToggleShuffle) {
txt = "Shuffle";
}
if (txt != "none") {
String s;
if (onoff) s = "on"; else s = "off";
setSuperText(txt + " now " + s);
}
}


Thanx a lot.
carlosp is offline   Reply With Quote