Some indications to make small popup





  • @Christoph-Hart how would you go beyond two panels with the example code you provided. i have 16 i have to do lol



  • @mwplugs :
    add 16 panels, 16 buttons (or more or less) and

    1 - solution 1:

    inline function onReverbSetsControl(component, value) // *for one panel (reverbSets in this example). so you must do that for each panel you want to add*
    {
    	Panel2.set("visible", value); // *visible*
    Panel3.set("visible", !value); // *not visible because of "!" before "Value"*
    Panel4.set("visible", !value); // *idem*
    Panel5.set("visible", !value); //*idem*
    etc. ...
    };
    

    for each panel just change the "!" for the visible panel and invisible panels.

    2 - Solution 2 :
    Use the first script that Christoph gave 6 month ago, but don't use the inline function (delete it) and use this in the OnControl:

    function onControl(number, value)
    {
    	switch(number)
    	{
    		case Tab1: //Tab1 is the name of your button, change it with your own name
    		{
    			Panel1.set("visible", value); // visible
    			Panel2.set("visible", !value); //invisible
    			// Insert logic here...
    			break;
    		}
    		case Tab2: // idem of Tab1
    		{
    			Panel1.set("visible", !value); // invisible
    			Panel2.set("visible", value); //visible
    			// Insert logic here...
    			
    			break;
    		}		
    *etc. ...*
    	}
    }
    

    3 - Solution 3:
    if you want to use just 1 button to control all, always in the OnControl:

    switch(number)
    	{
    		case Tab1:
    		{
    			if (number == Tab1)
    	{
    			bg1.set("visible", value);
    			bg2.set("visible", !value);
    			// Insert logic here...
    		}
    		else if (number == Tab1)
    	{
    			bg1.set("visible", !value);
    			bg2.set("visible", value);
    			break;
    		}
    }
    }
    

  • administrators

    The shortest solution is to use an array and the for loop to iterate:

    // Store all pages into one array
    const var pageArray = [Content.getComponent("Page1"),
                           Content.getComponent("Page2"), 
                           // ...
                           ];
    
    // Call this function with the page you want to show
    inline function showPage(page)
    {
        for(p in pageArray)
            p.set("visible", page == p);
    }
    

    page == p will evaluate to true for only the page you want to show, every other panel in the array will be hidden.



  • nice. so im using small edit buttons (x17 actually) to select page of 7 knobs which edit each of the 16+master (quick edit). i like the loop option but what would be an example code linking the buttons to the selection of the pages. also alternatively for the larger full edit popup over nearly the whole gui, i need to put an X to close it.



  • nvrmnd i figured it out. however i do need to know how to add an X to close a popup panel


  • administrators

    Ah, you might also want to check out the native HISE popup system. Check this:

    HiseSnippet 892.3ocsV87iSbCE1NalVRff.odjCi1SYknQy.rPkppJaxxVEA6RTCrp2Pd83jXVO1ir8rKADR8uudi+S3Tu1973YRl.CnMHgODk2O8me9687LQqnLiQoQ3q+hkYLD9FASWJsKFsfvknwGhv2L3XhwxzgdUCWlQLFVBBi24ObJvcZiJVe72GRDDIksVEBcphSYOimxsq0l83mxEhiHIrWvSq48Cd7XpRNRIT4.d1IHBkQnmSlyNg3bqU.5BN6RCBGEb+6MPed7Yu8fAex5x2NB9cNn+BwvXsYeFHhn4ZMSZOEBGgCv+GrvAOIgaU5oVhkA4bmgpjkSWntT525S4F9YBlSHFMEvjWMZzBtHYRUYyfP31SVWD2wWD+ofi4I7U5WWLuUggv0QTubhasIjZuAjh+RP5HkHwkfu.7v0fWaO7tcvTplmYWawgsqGLVB2yyHvMXcX48E05evAiTfGR6fTx4rizfvpH5+vnn6FteTzd+Zut85B2iFa3EDc3DhjIhC+svpXmyriToYJIHzeWu4c8QwkBtjENKWRsbkLTIGlasJYrKVsRzmVE3cgbKxY60q6650sCeV+JwNgvxmzAFnzcfYhJKOq+Lhvvb6RGF7mM8iJTFVkiNedeAZZFvkHZ28FXb5Kv0HhPbFPU6+o.1krZmlSTV1yk82q6651o66+LKyl0joxTIX5lr55fzekv5KySOioqpWk9ALgMoZ+vUipQ8kjZNpjikb6yyXkxqIiwMPFQk0TGsrDffq1BR4MKIk9JHhCIoSPY4DUf95yUPub7gDKoJQPNg8Iiosb2wAeH6BXtims2I3Pl4bqJCFgr5hDNxWgs8MtoEifcao6OP6E5RdhcgS3uAgEL97EVmzcPEGtUI+G8IuWUilinUj6qE3Ic9TOnJ0utdp+2MR8G.Itmb5SCF2B848zvjEURtfX2bbiaDcoAfWrQesq2UZ31k0GguEyfhZbFTiW6WQ3d6fIbKcQy3sUC3Et9+di2xI58BdxrYLpcMXaGbze8sN9dKfxepxsb47iIVM2wYNIOcJ79HkAHQBzAiiizxw97xQNYWkYJSlDU8ZWowXmLtzXbkQTJgpUuh5aHcuYbsBM.ljEu71A9D.PNbUenC2ovCYuhRcEheFPdyQbusNh6u0Q7fsNh825Hd3VGwi15H9kuRDtuZ3fbqJ02VfP+OcGNoJA
    


  • works great. i want to have double click the waveform display open the popup instead of deleting the loaded wav now.


  • administrators

    Thats not possible unfortunately. But you can hide the filename and change the colours in the latest version.


  • administrators

    But you could overlay a transparent panel and use its mouse callback for this. But then you‘ll loose the ability of dragging the sample area.


Log in to reply
 

0
Online

217
Users

565
Topics

3.6k
Posts

Looks like your connection to Forum was lost, please wait while we try to reconnect.