Radio Buttons Tab Controls || Tabs overlapping on INIT.
-
@d-healey too many things watching the states of these buttons. I'd have to chase down every mention of these.
They dont have functions in callbacks but I have features with if statements watching these like...
if (btnArpEnable)....
if (btnStrumEnable)....
and all of that works fine so I dont want to change it. Im already done with the project. this is the last stupid bug I have to fix. panels overlapping.
-
@Chazrox said in Radio Buttons Tab Controls || Tabs overlapping on INIT.:
I'd have to chase down every mention of these.
Find/replace can do this.
But it's not going to hurt your project to do it manually as you are, it's just more work, and harder to maintain in the future - or as you've found out, right now ;)
-
@d-healey idk how to use FindReplace in that way. I tried something like that before but it didnt go well.
So are you saying theres no other way to just write an array manually with my buttons and panels with their unique names?
i REALLY dont want to change their names.
-
@Chazrox Yeah with the names you're using you'll need to write them manually, but the code you posted above looks fine.
-
@d-healey ok. I got them scripted, only two of them are working properly and the others are giving '.setValue' errors. They are declared above so they should be seen. Can you look at this please.
Excuse my comments, im not deleting anything until I get this working.
//! SWITCH PANEL CONTROLS const var pnlFeatureStrum = Content.getComponent("pnlFeatureStrum"); const var switchPanelsList = [ pnlFeatureStrum, PnlFeaturePluck, pnlFeatureArp, pnlEditMode ]; const var switchButtonsList = [ btnStrumEnable, btnPluckEnable, btnArpEnable, btnNormal ]; inline function switchPanel(button) { for (sb = 0; sb < switchButtonsList.length; sb++) { switchButtonsList[sb].setValue(switchButtonsList[sb] == button); switchPanelsList[sb].showControl(switchButtonsList[sb] == button); } } //! EDIT MODE ENABLE BUTTON CONTROLS inline function onbtnNormalControl(component, value) { // if (value) // { // pnlEditMode.showControl(true); // } // else // { // pnlEditMode.showControl(false); // } //Console.print(switchPanelsList[1] + "PANEL LIST"); switchPanel(component); }; Content.getComponent("btnNormal").setControlCallback(onbtnNormalControl); //! PLUCK ENABLE BUTTON CONTROLS; inline function onbtnPluckEnableControl(component, value) { // if (value) // { // PnlFeaturePluck.showControl(true); // } // else // { // PnlFeaturePluck.showControl(false); // } switchPanel(component); }; Content.getComponent("btnPluckEnable").setControlCallback(onbtnPluckEnableControl); //! STRUM ENABLE BUTTON CONTROLS inline function onbtnStrumEnableControl(component, value) { // if (value) // { // //btnStrumNatural.setValue(1); // //btnStrumNatural.changed(); // // btnStrumNatural.set("enabled", 1); // //btnStrumReleaseMode.set("enabled", 1); // pnlFeatureStrum.showControl(true); // } // // else // { // //btnStrumNatural.setValue(0); // //btnStrumNatural.changed(); // //btnStrumNatural.set("enabled", 0); // //btnStrumReleaseMode.set("enabled", 0); // // // pnlFeatureStrum.showControl(false); // } switchPanel(component); }; Content.getComponent("btnStrumEnable").setControlCallback(onbtnStrumEnableControl); //! ARP ENABLE BUTTON CONTROLS inline function onbtnArpEnableControl(component, value) { switchPanel(component); if (value) { Arpeggiator1.setBypassed(false); // pnlFeatureArp.showControl(true); knbStepRepeat.changed(); SliderPack1.sendRepaintMessage(); SliderPack3.sendRepaintMessage(); } else { Arpeggiator1.setBypassed(true); //cmbArpType.setValue(1); cmbArpType.changed(); // pnlFeatureArp.showControl(false); } }; Content.getComponent("btnArpEnable").setControlCallback(onbtnArpEnableControl);
-
C Chazrox has marked this topic as unsolved
-
@Chazrox I don't know which lines those errors are referring to in the script you posted.
-
errors here @ .setValue
for (sb = 0; sb < switchButtonsList.length; sb++) { switchButtonsList[sb].setValue(switchButtonsList[sb] == button); switchPanelsList[sb].showControl(switchButtonsList[sb] == button); }
The other paired error on each call is the swithPanel(); function in each button. No other errors showing.
-
@Chazrox So that means one of the buttons in your array isn't actually a button
-
-
@Chazrox It would work if they are knobs. That error is saying that it's not a valid component. Are you sure you have a reference to all of those buttons in your script?
You can
Console.print(switchButtonsList[sb].getId())
within the loop and see at which point the error occurs. -
I got it,
one of the declarations was further down the script.....BIG FOREHEAD SLAP!
Slap me please. lolOk, now I have to do it for another set of 4 buttons
here we go! lol.Thank you for sticking it out with me!
//! LEARNED SOMETHING HERE
-
@d-healey I got the other group working too. Thank You!
That was a doozie. Im gonna name related panels and buttons for these use cases accordingly. I like doing this this way instead of radio button feature. That thing always glitches.
-
C Chazrox marked this topic as a regular topic