Set Reset button in Inputbox SketchUp ruby


#1

Hi All,

If any possible for creating reset button on inputbox in SketchUp ruby?

Here is my code for review,

visibles = "|Front|Left|Right"
shutters = "|Front|Right"
materialsList=""
prompts = ["Visible Side", "Shutter", "Laminate Code"]
defaults = [vVisible, vShutter, vMaterial]
list = [visibles, shutters, materialsList]
results = UI.inputbox(prompts, defaults, list, "Visible Sides")

if you have any possibility of a set reset button on inputbox, please let me know,

Thanks,
Siva S


#2

What should it do? What should it reset, and how would it look like after having reset?


#3

please see the attached image, I want to set reset button on inputbox, if I click on the reset button, it makes all values should be empty.


#4

Reset buttons are evil: https://www.floriskleijne.com/tech/reset-buttons-are-evil/

Also the inputbox method can’t really do anything more than you are already doing with it. It’s a super simplistic method, often not used in complex plugins.


#5

So “Cancel” is kind of a reset.


#6

Thanks @eneroth3, @Aerilius :slight_smile:


#7

Hah. I knew that post had some readership, but I’m rather proud it’s being quoted as a source :wink:


#8

If you need more control than what UI.inputbox offers then you have to look at webdialogs. There are some examples on our GitHub repositories. One of which is an example of making an inputbox like replacement: https://github.com/SketchUp/htmldialog-inputbox