Disable an option in a combobox
-
Hi guys!
How can I make an item not selectable or disabled on a combo box?
Meaning it still visible (grayed usually) but not selectable.
Couldn’t find any reference to this anywhere.
Thanks in advance -
@hisefilo I wondered the same recently but also found nothing in the docs. I don't know if it's possible.
For my project I'm using several cBox with the same choices. I ended up using a "if user selects a cBox value which is already used by another one, change the value of the other one" system -
does this work?
if (value == optionIDidntActuallyWant) return; else doNormalCBThings();
-
@iamlamprey this should work for that purpose but there's no laf function to grey the value out AFAIK
-
@Matt_SF You can draw individual items in a combo box, so just draw it with a grey colour.
-
yeh im trying to write up a quick snippet but i can't remember how to push the combobox values into an array... brain too sleepy
Edit: there actually is one issue with using return; the value of the ComboBox still changes, despite it ignoring whatever code you put after the return call.
You might have to use a panel if you depend on the value of the combobox not changing, unless there's some sneaky way to ignore the value update before the actual control callback, which would kill 2 birds with 1 function
-
@iamlamprey
local items = ComboBox.get("items).split("\n");
the value of the ComboBox still changes,
So change it back ;)
-
HiseSnippet 1002.3ocsV01aaaCDlxIpaR6EzBre.B9Sx.dF1MIsCqHnMwIdvXIoFyYA6aELRms4BEo.EkSLJx+49OX6HkrjxhQZqAl+PBOd2C4ycG4C0DkLBxxjJhi2kqRAhy26NckPuX3BJSPFeBw4GcOmloAUPwTGuJklkAwDGmc9MyDNd6Rr+9zaOlxohHndJB4JIKBNikvz0yN4c+NiyGQigKYIMhd+2MNRJFJ4xbjO631mjRitgNGtfZBqkKw4YmFyzR0TMUCYXLGKiWMcg7VQQ7WwxXWyAiw.xTbgJllLbAiGOYctlQHN6NoNy2oHy+I2yYwrp4qq.O25HnFQyZfSqmhRC9JnjSCJsaAkdg6zHEKUW6wvmuycr.aHynXotIUJhkzJYG2gRLBgtWB8FXjBMpPD9p986Ff+oya78Uv7.N1cuhxyg2XMiYYTjuwAGFzdu1XLXKISGDIStVdr7tynyPOqW9HEfY8YxHJ+Lo7liDwi.fG1wBqBPObcYliPixEQZlTD1NVQuchLMO8bPjOVCIs6FLas24cCjW+2c7+nu27dYft3DQXw+x5cKSu3Hd5BZ8LKXZvBpmFtSGb3g0owaC526ffeMXPu9cPdgqnYuOhylKf3KwnCWCqXAnXJ0MnMGloaiweuIWJqAKo3kfxzZPipvbCESRkBzHrcUDF3UFl73Q0oF0Hy1vDbl.ppCAl6BkvMakRZQTrOcQ1f8LaQhMKn1ggMlBpM05zrTzw2CC1qNRjR1FeX0Q.SAxSA5bk.GcummuGvyfBfHGxjbnWphg44xp3qPikjkEGjrPuGSoOaIpn+ZStgTN+Z7Be3iyabeZTUtPpg2KBs4t+89A+WWylsQekqEGTazsQKR8T.CE4IWCplUdSf3k0Gp.7ruLEfnhRSi.khwBl98oPo8HIO1by1L9w5EjxZKN5OGeBUSMRHkygwkBJMyPGmSfknFbgfhm6IP1MZYpM1xFBw4azVuOuTtYc4mvhMpMUcCxcDGWm43NtxLXDNHgZmyEGh2ASxLwOv+k964uu+AjL5RXrXhBvtrQgh7XINTbUFmyo5Gp3ZdZozA1DdfLmQJSjwzqZ9zyWgLb+mTF9KkhuvcBSGsXybr0F3H1d9+fikOd8CtmNaFDoqI3tti9qs8kpOy1+GxbMSL+bpVwLs+KxSlhBwQ.t6BApXXNRzxbDsvtuw1TAlBhXqw+f+JcNvX6T5bvZm3AqHk7CQEW8LOO9s1YPNIreMfG9YIncv.h85Hhyseu9jD7k5ODEYR+ed.grYLubKvr2VfY+s.yAaAlWsEXd8Vf4WdRLlOR5nbsLo35.NwjSs5RNNmJru.Yk.9WvLHXeU
-
@d-healey said in Disable an option in a combobox:
@Matt_SF You can draw individual items in a combo box, so just draw it with a grey colour.
oh my! Thanks David I have completely overlooked this
.
Where are you on your "I'm being stupid" tee-shirts idea ? I might require a dozen of them... -
-
@d-healey said in Disable an option in a combobox:
So change it back ;)
That's all I needed! You rock man!
Also I'll need some t-shirts too!! (not a bad idea at all: 400 members * $49,95) -
@hisefilo said in Disable an option in a combobox:
@d-healey said in Disable an option in a combobox:
So change it back ;)
That's all I needed! You rock man!
Also I'll need some t-shirts too!! (not a bad idea at all: 400 members * $49,95)@d-healey my lawyers will be in contact with you over the use of my intellectual property..if anybody here is stupid its me....and I will vigorously defend my ownership of stupidity...:beaming_face_with_smiling_eyes:
-
-
@d-healey said in Disable an option in a combobox:
yeah I think "...2022" is actually a bit narrower than the time frame I've been stupid in....