CADability icon indicating copy to clipboard operation
CADability copied to clipboard

MultipleChoiceInput with variables choices

Open davidebazzi opened this issue 10 months ago • 2 comments

I have the requirement to filter out some of the initial possible choices. This is not yet possible neither with the values from the resources neither with the directValues these values are used during BuildShowProperty and can't be changed during the action use. To avoid having to implement from scratch an input similar to MultipleChoiceInput, I suggest to allow to instantiate a derived MultipleChoiceProperty in a derived MultipleChoiceInput. Then in the derived MultipleChoiceProperty it is easy to change the possible choices through the Choices property

davidebazzi avatar Mar 17 '25 14:03 davidebazzi

@SOFAgh what do you think?

davidebazzi avatar Mar 17 '25 14:03 davidebazzi

I didn't check deeply, but in the code it looks like when you change the Choices property of the MultipleChoiceProperty, next time when you open the dropdown list, there are the modified choices available. MultipleChoiceInput has the IInputObject.GetShowProperty() method, which returns a MultipleChoiceProperty, where you could change the Choices. But I see: the interface IInputObject is private. Maybe we should make it public? Or should we add a method to MultipleChoiceInput like SetChoices? Here we could access multipleChoiceProperty.Choices

SOFAgh avatar Mar 18 '25 14:03 SOFAgh