ComboBox Sub Categories
-
@Natan what have you tried so far?
-
@ulrik Check Snippet Above,
I Did This:/// Next Prev const var Next = Content.getComponent("Next"); const var Prev = Content.getComponent("Prev"); // Prev-Button---------------------------------------------------------------------------------------------- inline function onPrevControl(component, value) { if (value) { Panel1.setValue(Panel1.getValue() - 1); Panel1.changed(); } }; Content.getComponent("Prev").setControlCallback(onPrevControl); //-------------------------------------------------------------------------------------------------------- // Next-Button ---------------------------------------------------------------------------------------------- inline function onNextControl(component, value) { if (value) { Panel1.setValue(Panel1.getValue() + 1); Panel1.changed(); } }; Content.getComponent("Next").setControlCallback(onNextControl); //--------------------------------------------------------------------------------------------------------
But It's not Stable
-
@Natan I thought you said you want to get previous and next "submenu" ?
-
@Natan said in ComboBox Sub Categories:
Trying To Add A Pre Next Button To The Sub Menu
Do you mean you want to get to next/prev submenu?
In that case you have to know at which indexes they are located, like in your snippet you have the first appearance of SubMenu1 at index 0 and SubMenu2 at index 5, so you have to work with those indexes to jump between SubMenusSomething like this maybe
// sub menues local subName; local subIdxs = []; local items = Panel1.get("popupMenuItems").split("\n"); // get indexes of first apperance of submenu for (i = 0; i < items.length; i++) { // get sub menu name local sub = items[i].substring(0, items[i].indexOf(":")); // check if sub name is different than the stored one if (sub != subName) { // store indexes of every "new" subMenu subIdxs.push(i); // store current sub name, to be able to compare with the next subName = sub; } }
With this you'll get the first index of all submenus, dynamically
-
@ulrik Thank you Ulrik :folded_hands_medium-light_skin_tone: Will Give it A Go
-
@ulrik Where Should I Place The Code?
It Shows Some Errors Again :/ -
HiseSnippet 2061.3ocyYrsaiabkzq4lH051jh12mpmjfur5xtIE1q2pX6cKbS7kFktI.aL1PQNRZfolQfbnu.CCjOk1+f9IzOo9GzdNC4vahT1V651RCXn4baNy41LyYN0W3PCBD9Fl09tqmQML+kVCtlKmr+DaF23vCLL+0VGaKs4CBGdDkGFXr20yrCBntFllO4OgDYVaUC02+5OtmsmM2glBxv3sBlC8aXSYxTnm1+qYdduw1k9croYn948OzQv2W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n3EyMyqvEyNWffxYx1UKGHqSshKm9ap9VvUYPYpKfTkU7AXMWfUsBqa4V4ps1e.qx7dgkaIW9Rp9hgb6cm0luQHku7qHU5UowEkmX7fyy9+ybo4ceXx0qhRx1byGdB0qxlOs4G27o0+uW9zCM3K490JK6PX+wxNTU5AyFV80LJ+PdPVxsYO6uPROg2rU8apWqNnMEQMZTo3hElG0uTzXij8WDiM4gSGR80myTSng4p4aYqU0srMaGkchN2cFBE7C4L4Iyn7pZjqQ7g0wV5FqU.oRUCc+UwMzcfGyk5avbML+DKUyVLTJrgYsmZp6o9e8vCrk1Zw.RLs+h.rCnWvbnQ8Itl0AzfykhYf3Rte.rHuyI8pjtx2m2+5jAmNq+T6qx1wdiLhsdjXWS2bZLfVI0O0JJ3NiXIyxH19N8Uc+DWktwKxndehPHwPx2xPT8y1xPi7mz1v7uaUnon0KzSzBi6UX7yKL9E0KzOzBiSjWuB36UN9dFy0+Rvynbx465IBUAddOn1TqZ9VroNpQbYM0hLl5+448QSF5oUJYNo9I4iKh5OfRrO0BSvyHzeZbFg9SN8CrufdHVE.pNfu4.K3HAr6kz1GHybEs6MNt4uz+9NsXMkLS6+3hLS6O+XMs0rheDgLy7eyIa.66eXy7O+C26YNtHZkq4kXlm+8i9LqiDtgd1x7OsE9ddwHfhm4dCI7ch3AL40YeuuGk2659ptet0oLoyjx02UJQegBlO15a7qGtl0qgay5HSU1UsdyO73+TgFeqHTBWH+Ha3d4P.j0wgSGHB8cnflvgJv3FblqfkRhF2VWwY.k6pF7uguXjczEdPjczHMlZ63KduSzFX36S9oJHfNwUOSaMqivwjjctrrZuUaioLW16cbPSwlftWNOcWBd5sD777kfmWrD77EKAOe4RvyeXg7fuX8WEJESiRS..m9Z0IHLMeMG6MgJhz3+.kK0y0
Excellent Job @ulrik
So It's Not Possible To Go Throw All Menu items!? Right? -
@Natan This goes through all items
-
@ulrik My Bad
Absolute Genius :) Thanks Man -
@Natan Thanks, this works perfectly. But how do we load the sample maps in the sampler? I understand that we should add a line similar to "YourSampler.asSampler().loadSampleMap()" inside the panel function but I don't know how to do it. Anyone?
-
Oh, after hours of trying I realized it was pretty simple. Just had to add this line inside the "if" of the panel script.
MySampler.loadSampleMap(t2);
I'm not sure why but it works; I think t2 in this context is the name of the sample map (I'm new with Hise)