A couple of expansion questions
-
@rzrsharpeprod said in A couple of expansion questions:
I don't really understand child panels.
Baby steps.
I modified your first snippet, study it, play with the constants at the top.
HiseSnippet 1237.3ocsVssaaaCFlJIZq1aEXoXW1KHB1.ji8RrShSJP1vbhygZrXGi3zzdW.MEUDQjHEjnSrQQ2dQ1E8QbuAa+TGrjcb2JLV8EBl+G+9OR1OTRYQQxPjQ4qmDvPFeq4fIBkaaWBWf5bBx3kl8IBlGNfDxDJLQXiotbOa7a6zGc7j.RTDyFYXr54ZMLJsFJ92e8qGS7HBJKmDBcijSYWv84pbp8a8abOuyH1rq49EjduVcnRQaombDftUMqiBHz6I2w5QzhshI50jHWjwlljcZv1wt4vcO3flNr5MaVm0rwA0I66TeOamWseycGNrgMaejwWcpMWICGnHJVDxXsik1SF3JeTj3fa3Q7gdL8gFnAfmSHelzyVGhZpn15XueVZKBAVoedRb0jj32a1kaymROOY9cwLv4ZTLAZrxrva0YfWihvqdA3s.HYT.Rqk.o0MGPC4ApbNZ77MlcDJVnCApSEgRhrnU93ZlskfDB0V9j6YmEBGlpg090qWCCepbX4xPsJRg68lt2d565eTuActr2.7u.bODu813qc4Q3Gg5LdHCqbYXwH+grPrzAyFGPDQbP8B1n8kWn0duXk6MUVpzaj+TA6dzUm2oGHViDmL.ZPXfCTOxXhLYiaXCkOFkAwGHg3.g24gbaP0rn6NlpszOPJfCVajxeCcfs81Is6A5ofxbgGWvvNiDTEfYLMjAEqjJfVfHqJkeOF9UV+wSRIdPbaqbAeYkZVsydqllUE7OkFEUvamG3YDOrfQfD1UPT.loKQ4tEkw8rlKamagJE0zkwuyUAJFiiC0XKlqiLDawA5P1ii+44pc.spUqDK36i+laPZ.nTVrPrsyidqTGmKKWXyFqicN9GKBuRkR3q4kVGqBBEK8lIHsRQJoYobEmjkIb7jxPv7EhdPdqznt5z7a0YRpkR9RC1Jho5Ki35po03Z3I0R7dsz7l1kenboxkxBXPdqMR3sQsDH3SFm5uZSqSahmCAZPkwrJtQkJfk+P4m1P4wHgwYTXcqtYpbo3B0XHUhKz.kmzufGorpTAxLi2Jj4KePOl52OdcsUhSlynwSKWEKJLe.CkE5vggqm1Re3T3IE8jJ1koHCrMddVNNKjmdPKT54wBWHa8t+v+MEsR1XTCle8FwlJHrea1klle5klE2oSSl6KHnTzQvUWFvDepM8nzkE5EronBDUEud8EoqWY12vYOFHCUHNrIsj4CAJcICEC6h2EhdSmSHJRlw.6B9JfEp35vv3D1CvckI6tKYdBK5dkLHV1zsTHiu9yz0iycamVSJdHtSeJgV+Qqjd1hThn5p1wjPXEN8dAjKxMvOzZQ344Y2znadRgRZiaQnfP.TLMVG9yrv3i+97v30+YqjWeTvY4gG5oW1AWyJsG4QTyd2q9EJoLfdqYtvSeoFbKjZRwWv7+1ExetPbcy9bE0cwXbkEfQn64KAFSeFyyMO0wgQU4.bMyyd2Wl2rftRNRwE2AKTC4PahIbq+.3oeTXSDQnWCo6VVQOElbtt9rNCLfIriO72vuTlMzmMRY1HiIxm.cy2RSlc0OT5YwT.LIheTYIyt5y3FOcb0Gd21sT5rl5IJtyxp3tKqh6srJ1bYUb+kUwCVVEe0+sh5mUezHkzOYrAg51+z30qFFmJHPGXb2J5e.62gmW.
@rzrsharpeprod said in A couple of expansion questions:
Ultimately will these be 'clickable' and be able to load the expansions as well as have their own individual images?
Yes, child panels are just like a normal panel. You can add mouse callbacks and paint routines to them.
-
@d-healey ok thankyou. I have modified it to reflect how it should look in the project by messing with the constants as you suggested.
The formation is now starting to make some sense at least.
Here is the modified version:
HiseSnippet 1215.3ocsV0saaaCElJwZaxaEXcXO.DAa.x0tN1cIsaHqXIw4GXrDGi3zzd0BXjniIhDo.EchMJ5tZOF6185rWiMrqF1Kv1gTRVzItEEFq5BAPd9gemuyOj8kh.ZZpPhb7NaZBE47YtClxUi5Lhv3nt6gbp5dnjEheY29ncmlPRSogHGmUOTK2wqBx782+vtjHBOfVtEBctfEPOhEyTk61e6ejEEc.IjdFK1R6M1taff2QDIFCXYU2VnDRv0jqn8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e7qo+7urchoL15vJCKz8uoCtiUDNNhnl+hW8qMxE.0Tycam9FM3FH0T6Wi7+1swuuP7gt8YpfQKFiqr.LBUMeHvX9aXdf69CGRCTk.rh6Au5CyCVPmJFqX7qfAoRFTl3B23O.dFW.LAhv0iezEGqn69xV2RuVy.Cn7Pyh+E9xE1Vu1IWX6BgnXBTMeQPVOq9URehYG.SbyCD8bOVuF2tnM00sUyVnX3AaWDDnC+GCCDVrMOYIr4aVBa1XIrYykvlmtD17rkvlu8cZi9sx6LVIhyZGfM5uuYboiy9bBTYYpBQ+GPYZYGZ
-
@rzrsharpeprod I wouldn't hard code the number of expansions, because more might be added in the future, or your users might delete some. You should get the number of currently installed expansions using the expansion handler - but don't do this in the demo (at least not yet). For now just play with child panels and get used to how they work.
Try adding a paint routine to them and draw an image on them. Then change the image or write some text or something when the mouse is hovering over the child or when it's clicked.
-
@d-healey I shall give this a go thankyou. Will it not just repeat the same image for each child instance?
At this stage I can't see how they are distinguished from one another? But maybe that is what you are trying to teach me?I just adjusted that number down as part of my testing to see if it did what I expected but I left it in as 15.
I was imagining that the number of child panels would ultimately come from the number of installed expansions so that's good. I'm not completely clueless...just mostly haha -
@rzrsharpeprod said in A couple of expansion questions:
But maybe that is what you are trying to teach me?
A child panel is a panel. All panels have a data object and you can store values or identifiers in there.
Also the main panel
pnlGrid
holds all the child panels in an array, that means each child panel has a unique index in that array that you can use to identify them. -
@d-healey Ok I messed around a bit this morning with paint routines and then attempted to add images. I added one at first and then I tried to implement a similar loop to the one drawing the panels.
I am at work right now so don't have access to everything so don't have a project with expansions etc setup but I think this will be the same image called for each panel.
HiseSnippet 1330.3ocsW80aaaCDmJIpaxaEXcXe.HBv.jabcr6ZZ2P1vb9agwZbLha6JvvVAqDcLQjHEnnSrQP6S68sWGvdXeh1Wi859FrcGkjkbpSQm6p.hB3w6N96N9S2ctuVEvSSUZhi2imlvINer6foRyn8FwDRR28QAOTKB6FyNkeWxtSSXoo7PhiypOD0vwaMh84u+1cYQL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MyCxp2WQQkrqTXNNgKutV7j7lDXm0bTApZr8U+z79p7vmJ3WjnzFh.Zg54ddhAuyHVXWclFxS5tOyvJbF3W3rR3Zi.CCm84mCy7j0z1yced5YFUhU27tSDmO3s7nmTdr+TmoUWXIoyD7q+RmL55LI+wq5jFf2Z6xzPq6fyjPt.lexscqlsVHXtYw7EHyIGG4z1p3fPpfi1WAGcphi+7q9qeO8U+bmDKgtxAVFejWeLGX.KU33HlY9otvQMy2.HWyMpCNNCL9gYZ0QQ+eaTr2VHdK29BSvnEiwUV.FA5y6CLlO.6McOX3PdfoDfq4d3yd+LsJIq61oPQZs.nJtv3dCfY3CfRQLIVGBj4rB9YX15V3ZLCLfKCsK9G3Iey13Zm7MaWrIIlAz4mGj8wKNh7GZk.XRZ+0AdtGgqosK9d00EY5wvz5OOH.C+6.UFVrM2cIr4KVBat2RXyVKgM2eIr4AKgMe4azF7GJsyXiJN6yAPP+Cr0McbNPx.lkkER9W.U2c+LB
As you said, babysteps but feels like some progress is being made.
Long term would I need to call individual images to separate child panels or would a loop that is linked to the exp handler read the images inside the expansions in a similar ay to the image based preset browser uses the icon.png inside each expansion?
-
@rzrsharpeprod said in A couple of expansion questions:
would a loop that is linked to the exp handler read the images inside the expansions
That's exactly what you should do. Loop over the expansions when you create the child panels and load the image into each one
-
@d-healey Ok so I am getting somewhere. I can try it in my actual project later - albeit using a new preset so as not to ruin anything. That has expansions and the icon.png in each images folder of the expansions.
-
@d-healey ok this is where it starts to get confusing again.
I tried to implement the load Icon.png from my other project and your tutorial but I just get error messages
Image {EXP::ExpansionName}Icon.png not found
I have edited the error to say ExpansionName as it is doing for each expansion.
Each expansion has Icon.png in it's folder correctly.
I just created a presetbrowser quickly and copied the code in exactly from my other project and it worked for the preset browser so I know that the Icon.png files are ok as they loaded fine in the preset browser.Here is my updated snippet, what do I need to do to get the Icon.png files to populate the child panels please?
HiseSnippet 1520.3ocsW0saaaCElJIpq1aEXcXO.bFXExMdN1IN0MvqXN+3zZrDGi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xow8wykXEVlpbcb0hEg.q4Scg1jRbfXjTQajBrS.4J8UkHhX9LoNx1S0lZMkgYMHhPotu9gPmT9+elLob5i.UREl2MEQocIHHJ29vnGCJ2GdkdWWWqJi086glC8gjEd.sObD3Xkzp3krWUDeu6gyJ.+UOBWn.rEUQRcpF0baFeJge4BHcfX3IlJwccJ1.GQTZyAVJwk8iz7Y6TB8qudGF.pWqOjpGZjQPWOKcgO5DZrpYZFBSZfhakBafwkCndhKUuE50kDndDK9lwbgsAFP5oQ1Fhg9gyzmbgHMAfBdGgjdBW2eDtcfmWU+9KTm5M1.gazicKPsZBqfaxQ0EyyoAkfm7bGQSLDlhX1QSLe2iljcxIa8S9YLTvUmcm3S4uq4oPwyInFiIFUfoxngX9h3gXnNmwnW4KBjHFLuRNyK8kpyLTDryNwI5YsOfHISCFDWHW9z.ISsMLNfdILQpdBoblGPCuPJ7irMd.Ejwm7dl5woo8GZNI6hHBchfe4mapo1IR9sepYns5TaORvSGxrufC0BXXUypUJWYgf4NSGlSwbhwQLsMKNPnL3n5b3nYVb7m+Z3eryuSa5GQnyjvz8G55yTBSyJbF4RjyNhq5CAhU.jqYlqTM6HLZhbR1OTX94dW68at2adr72W3dWytLo8vEi2UV.dApz+23M9qHtiYq98o1xTvtl4gu3F+jgONPQ+r5.30h.FPmL6LxqG7UX1P6JBW0qBjYrh5ppdcE0ZUkoGk6Ds3ugehUVUs1HVY0oJQdDfx+Za8Eb02rb6HI.l3QeeWNyiUqwUu9cZO3Sndss8rg5ZNt4x53VKqi0VVG2dYc7AKqi0WVGe3+tipuvc2QRgm95DBcb2VQ8fMLZwI.aLh4h9GrTa0NN
-
for (e in expHandler.getExpansionList())
You've already saved the expansion list in a const on line 9, so no need to call the function again, just use the variable name
expList
.I would combine the creation of the child panels and the loading of the images.
for (i = 0; i < expList.length; i++) { local e = expList[i]; // Create the child panel local img = e.getWildcardReference("Icon.png"); cp.loadImage(img, "icon"); // Load the image into the child panel }