HISE Logo Forum
    • Categories
    • Register
    • Login

    Radio Buttons Tab Controls || Tabs overlapping on INIT.

    Scheduled Pinned Locked Moved Scripting
    22 Posts 2 Posters 901 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ChazroxC
      Chazrox @d.healey
      last edited by Chazrox

      @d-healey if I type the panels and buttons list manually, is this correct?

      //! SWITCH PANEL CONTROLS 
      
      const var switchPanelsList = [
      
      
      "pnlFeatureStrum"
      , "pnlFeaturePluck", 
      "pnlFeatureArp", 
      "pnlEditMode"
      ];
      const var switchButtonList = ["btnStrumEnable", "btnPluckEnable", "btnArpEnable", "btnNormal"];
      
      
      inline function switchPanel(button)
      {
      	for (i = 0; i < switchButtonList.length; i++)
      	{
      		switchButtonList[i].setValue(switchButtonList[i] == button);
      		switchPanelsList[i].showControl(switchPanelsList[i] == button);
      	}
      }
      
      //! EDIT MODE ENABLE BUTTON CONTROLS
      inline function onbtnNormalControl(component, value)
      {
      //	if (value)
      //	{
      //		pnlEditMode.showControl(true);		
      //	}
      //	 else
      //	{
      //		pnlEditMode.showControl(false);
      //	}
      
      	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);
      
      const var pnlFeatureStrum = Content.getComponent("pnlFeatureStrum");
      //! 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)
      {
      	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);
      	}
      	
      	switchPanel(component);
      };
      
      Content.getComponent("btnArpEnable").setControlCallback(onbtnArpEnableControl);
      
      

      if im passing 'button' in the switchPanel function, is it conflicting that the button callbacks are sending 'component'?

      Im getting no action.

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Chazrox
        last edited by

        @Chazrox said in Radio Buttons Tab Controls || Tabs overlapping on INIT.:

        if I type the panels and buttons list manually

        Yeah, but it's better to name them in a way so you don't have to do that.

        @Chazrox said in Radio Buttons Tab Controls || Tabs overlapping on INIT.:

        if im passing 'button'

        button is the name of the variable that the function uses, it doesn't matter that the variable in the callback is called component.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        ChazroxC 1 Reply Last reply Reply Quote 0
        • ChazroxC
          Chazrox @d.healey
          last edited by

          @d-healey said in Radio Buttons Tab Controls || Tabs overlapping on INIT.:

          Yeah, but it's better to name them in a way so you don't have to do that.

          What do you suggest since I cant change that now?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Chazrox
            last edited by

            @Chazrox said in Radio Buttons Tab Controls || Tabs overlapping on INIT.:

            I cant change that now?

            Why not?

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            ChazroxC 1 Reply Last reply Reply Quote 0
            • ChazroxC
              Chazrox @d.healey
              last edited by Chazrox

              @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.

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @Chazrox
                last edited by

                @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 ;)

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                ChazroxC 1 Reply Last reply Reply Quote 0
                • ChazroxC
                  Chazrox @d.healey
                  last edited by Chazrox

                  @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.

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @Chazrox
                    last edited by

                    @Chazrox Yeah with the names you're using you'll need to write them manually, but the code you posted above looks fine.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    ChazroxC 1 Reply Last reply Reply Quote 0
                    • ChazroxC
                      Chazrox @d.healey
                      last edited by Chazrox

                      @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);
                      
                      
                      

                      pnl Tabs Not Working.gif

                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • ChazroxC Chazrox has marked this topic as unsolved
                      • d.healeyD
                        d.healey @Chazrox
                        last edited by

                        @Chazrox I don't know which lines those errors are referring to in the script you posted.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        ChazroxC 1 Reply Last reply Reply Quote 0
                        • ChazroxC
                          Chazrox @d.healey
                          last edited by Chazrox

                          @d-healey

                          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.

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @Chazrox
                            last edited by

                            @Chazrox So that means one of the buttons in your array isn't actually a button

                            Libre Wave - Freedom respecting instruments and effects
                            My Patreon - HISE tutorials
                            YouTube Channel - Public HISE tutorials

                            ChazroxC 1 Reply Last reply Reply Quote 0
                            • ChazroxC
                              Chazrox @d.healey
                              last edited by Chazrox

                              @d-healey

                              They definitely are tho...

                              Screenshot 2025-09-04 at 1.12.59 PM.png

                              Screenshot 2025-09-04 at 1.12.51 PM.png

                              Screenshot 2025-09-04 at 1.12.46 PM.png

                              Screenshot 2025-09-04 at 1.12.42 PM.png

                              They arent a knob or a slider for sure.

                              d.healeyD 1 Reply Last reply Reply Quote 0
                              • d.healeyD
                                d.healey @Chazrox
                                last edited by

                                @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.

                                Libre Wave - Freedom respecting instruments and effects
                                My Patreon - HISE tutorials
                                YouTube Channel - Public HISE tutorials

                                ChazroxC 2 Replies Last reply Reply Quote 0
                                • ChazroxC
                                  Chazrox @d.healey
                                  last edited by Chazrox

                                  @d-healey

                                  I got it,

                                  one of the declarations was further down the script.....BIG FOREHEAD SLAP!
                                  Slap me please. lol

                                  Ok, 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

                                  1 Reply Last reply Reply Quote 1
                                  • ChazroxC
                                    Chazrox @d.healey
                                    last edited by

                                    @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.

                                    🙏

                                    1 Reply Last reply Reply Quote 0
                                    • ChazroxC Chazrox marked this topic as a regular topic
                                    • First post
                                      Last post

                                    30

                                    Online

                                    1.9k

                                    Users

                                    12.5k

                                    Topics

                                    108.6k

                                    Posts