3 Way Switch



  • Or just make the button from a scriptPanel 🙂



  • HiseSnippet 1000.3ocsV0uaaaCDmxIpnVcdXEXO.DEX.xncFx8ygYLzz3jLXrkDg4tf8eEzTz1DllTPj1oFC4coOZ8QnuAcGEkrTb7RS8vz+ce763Od2w6TblhxzZUFxq4aWkxPdei+vURyz9SIbIZvQHuu0+Th1vxvNUGtJkn0rDjm2d+pUgWy8Q4ee50GRDDIkUoBgtPworemOmapzFevuwEhSHIr2xmWy6mev.pR1WITK.9rmeDJkPmQlvNiXcqgOx6dGmvMprgFhgoQd6enJY0vopKkN+ufq4iDLqPWzPHPN0mnDIVFa0h5OkKRhKu2ZDDk3prvdtrv26eJOguVeU136xMfqPTOe3031nW2uL8h1F87pQu8cz6g9CoY7TSkEK2df+.ITnFSfRPcZ47E0HcO+9JvCooybxL1IYfvZDguLJ5I3WDE0tWPP.TGzF7RRFNlHYht3eAWBcByzWMOUIAgvG4L+n18ZEzJvIzQyLwP9x7GpEFtjENdgjZ3JY3j1A+cq.L7oujanSwglobsMhWPDKXgsa6rV3j8iRzLbzOimzYLzy7FgHz0en6LBPrjqDLS6d3QYLxrda.q61fwkIbhLik7ug5oaCkfOYpYESHTWtFWNrqBZFbEjxZET61epZgl0mHDif92pqOaIjxVmBrI2k1qMja2HMTPofl7wXGpNTAmNCH8MRP4P0kPe7icg7GvOqcuMbhNkHmvRfvWv7qxK0sB3RATlvk7DqjtqhshmoDgzxx8SbDFHAPflfYMj96jlA05PmE3LupW8FghXrNYrQrs.9O+Ui3moLrykgPR1VWBvaZZ73sZqfMBV1VMaGSkca.CkKlOhkUleJcDdud8ABO3tMPf5dpUyQkbfjaNOkUHWehV4stzZDZ8kstpp6Xcs4Wss3VkpaNQBULJvNapvcvUS9joVkSlrUYDGn388cUbTdtAl1euFkKG9yAGQLjxv.QDNkTVlgayUdGAOuoL2.ul9GwzyLpzbeKZGg0AewC88qWu7A9AqVK7wjCH1Gyk8kZaP5aeiowmKEqPZxR1.YbFC5ggyrA5lCggUApjEBh456GrKEKL.8HWaPrcXqTyMqpuz7qXoQzcdm1cktOzO1NHd67swV3KTr9+luEqfa4e73wLpohr66exesq6a+Jnhas0jSIlLNz93e1h4Cgk.TFvDIzTAGjumsGtPNxJayLCYxjbgOCeEF6Zk8JL1szHZNglodG083wtj+94Z.NIy+WmlvOcAx30uZ78i5DglC+6w6nTap3GAtucLOcGv7rc.yy2ALuXGv7xc.yq1AL+zshw9aeuYgQM28LATDeb9zKOuikDnKKuiD8OZKCCIA
    


  • @ustk said in 3 Way Switch:
    Thank you 🙂

    I tried saving and loading these as presets but the colours wouldn't load (the values printed correctly).

    The code looks really helpful though



  • @DanH Probably because I forgot to put component.repaint(); in the panel callback...



  • @ustk That's the one, it's making sense now, thanks both @d-healey



  • @ustk ok this is working great, but my panel needs to have a border radius of '2' 😂 - I'm trying to shove in some drawRoundedRectangle commands but it's not changing anything. Any ideas?!



  • @DanH Instead of fillAll, just setColour, and after the switch draw your RoundedRectangle



  • @DanH You can also draw a text if you want



  • @DanH So rounded rectangle:

    HiseSnippet 1011.3ocsVEtZibCDVqS1iyaqK8f9.HNnvZNWy56tbsTywkFmjhoMIlyWCEJkCYsx1BKKsrRqSME+tz+z2q9Hz2f1Qq10diOmzCWxBFynY9l8SyL5S6fTEko0pTjW82sLgg79T+gKklo8lR3RT+SQdel+EDsgkhcKcxxDhVyhQddG781E7peHJ+4ueyIDAQRYaVBgtVworejOma1r5fi+AtPbNIl8N97JQ+xi6SUxdJgJC3yA9QnDBcFYB6RhMrZ9HuGcVL2nRGZHFlF4c3Ip3kCmptQ5h+ZtlORvrFcPCgD4V9bkH1xX6pndS4h3Ak6aMBxxfMUgCbUguv+BdLe85apFedtC7FDUqGd0tO50oJ8h93omWE5cnidOweHMkmX13wxsOwuuDZTiIPKnJsbwhp8mG32SAQHMsmSlwNOELViH7UQQsvGEE0raPP.zGzF7BRJd.QxDcvuFWBcByzSMOQIAivm5b+zlcaDzHvYzVyLCf5k4spLCWxBGmIoFtRFNo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CNiXR3P4i+4SF0EFoSY.RjPQks4BJHrllRGYosYltLYbJw+BeYBaXo8xD1HWHZDglndK007XeyyiR4.XRl9zuxvaPAZ7htFe+n5QnQvSwdKkZSEeCf80ayS2Bad1VXyy2BaNXKr4EagMe6VXy2sQaruB90SLpQt1DfQmVoSu77ZIIPUVZEI5+.HrdCsA
    


  • @ustk That's brilliant thank you!


Log in to reply
 

11
Online

1.1k
Users

3.6k
Topics

30.8k
Posts