panel value privacy?
-
Stop what you're doing and go watch this video - go to around 1:44.
https://youtu.be/xU8dLVISM-A?t=6285
You should be using a single panel for this kind of thing. In the video I did a similar thing to you, I was adding lots of buttons, Christoph was there in the chat and showed me a better way using a single panel.
-
@d-healey hahahah ok thank you
-
Yeah sorry but I don't think that method will help me, I need individual panels for each button because they're placed all over in different parent panels (hence the giant switch statement):
https://i.gyazo.com/a7de01a23927188fa2fcacf9b3da8164.mp4
Here you can see each button is correctly printing its own value, I just can't access it elsewhere
I'm obviously missing something basic like some control callback or something to make the X.getValue() be visible to other functions, I just don't have enough experience with panels to identify it
-
I see what you're doing now. Use buttons instead of panels and create them in the interface designer. If you want to position them algorithmically you can do that in a loop, but using the interface designer is simpler than using factory functions (especially when they are not being placed in a logical pattern like a grid).
-
@d-healey damn okay, that was actually going to be my first plan but I decided i'd try and be smart and do it in a script :face_with_tears_of_joy:
-
can you use paintroutines with buttons? i need vectors
-
@iamlamprey Yes, via custom look and feel.
-
Ok figured out the panel situation
Since I can use getValue within the factory method, I use this.data.name to find the index of the button array, then push that value into a new array buttonValues[] at the same index, which can be accessed anywhere :)
-
@iamlamprey I'm going to keep pushing you to buttons and LAF. It's a pita when you first start with it but once you get the hang of it you'll find it much easier to work with than panels.
-
Here's a really simple example
HiseSnippet 943.3ocsV8taaaCDmxwJnVatXEnO.B4S1.dBxIocCHXXN+wNvXMoFyYE6aczRmj4LEoGEcRMJ56xdT1ivdT1av1QIYK4M2fD2N8Iw6te79cGOdGGojAPZpTQrZbyx4.w5KsGuTnmd9TJSPFdAw5o1WQS0fxMWzYKmSSSgPhk0dWZDX0nNI66u99ynbpH.JEQHuQxBfWwRX5Roi58CLNe.MDtgkTw5i6MLPJNWxkKP9rmsOYNMXFMFtlZLqlMwZ+9gLsTMVS0PJZyYxvkimJuSja+aXorIbvrnKYLtQ4hImOkwCGsJVSIDq5iJi78xi7maeEKjsVdYF3qxT3VhnZNvp1lTp9FTp6GiRCj7PyF7QnmUE5UOmdOydbfhMWWpwvsuvdn.ObhnXZuJsxskT6jZ1mKQKDZuD5LXfBWrFQqW562w8E99sOooSSGL4mpc4zH2uysuHlI.u.Efg0kb4DJOeKekTN6TQ3..3sxgg.7TPLyTjLXgHPyjhVGDpn2ciLNlCmsPqkhC53FsRYbGW4jescSm22zwE+XQtsPAdxaAU6bQluXuHrN4TNuUdMQpWHUMKVAKMN1XAvSg6y9Ibr.pv3McUHd.cutppabWAO1KEz4Vr1v6lxzPgkwdlv9TNKV.g2.uSm4KM9SVD6QwzYG2CBviCEDdP6Sb9P6SVkVbkhqkZ30hVscduSCmO339uUEEsUclSXkjyA0VUatkotOfsDKRl.pNt2R4Kf0FhkdaVau+Cq1NHufqhgRwPAS+54Pw5xp+tao5mTTwZtlVvPzTc1sfmVbKHunhvvMogc9htjL5WsgD4Q.+vOM3G8oA+3s.+mFdAUSMcCJRHXRZNnzLyYg0EvsXq07dCMru.RmokyyxXIykBS5yZ+GPN6ckt7xdKq1j9NVndZofg8lBr3o5pRHOJmcXEm0Kohy98e4yuyNpZj0qZj8ae9c1wUb1eTMx9yzGjy9uc6wYNxvEbpdyAQlItEJvavazw2zUWjxzKqVC8HlN4u0oSa894CjtOydDSGLc67s1V3KVp++MeKl02zteTDDnKIac6A+7tNX+QPkeTtPyDwWQ0JFVyXe8hjw3Xj..YhPfyyPYV0L8.yW6aVaxLiAQX1h+F+JT10r1pPY2UJIIz.k7sA4MeLul3IYRPNIxdHUC7Ec3Z20MLss887II3ibdaPfIU70H22NlC2ALGsCXNdGv7hc.yK2ALeyNf4auWLl2Wd5BsLI+ZBJXT+rd+VV8ETrJKqhj7O.8o4CHB
-
@d-healey Cheers, I still have some png sliders so it'll still come in handy for that :)
-
This was all just so I don't have to individually make factory presets
-
@d-healey Going off your snippet, how would I separate elements for different L&F? Not all of my UI Buttons look the same
-
Ah just saw your post: https://forum.hise.audio/topic/2761/custom-look-and-feel-per-component/2
was this ever implemented?
-
@iamlamprey This is the PITA when you first start that I warned you about :p You can use the text property of the control to differentiate them. But what if I want to use the text property to show some text I hear you ask... then you have to get clever with substrings.
-
@d-healey buttons can't have .data can they? sheesh
-
@iamlamprey Nope that's just a thing for panels.
-
You don't just have to rely on the text property. Think outside the box, what other aspects can you use to distinguish one control from another...
Do you have some really thin sliders and some wider ones, then all you need is an if statement to check the width and you can now tell them apart. I'm doing this in a script right at this moment ;)
-
@d-healey Yeh nice, doesn't seem too bad :)
-
This post is deleted!