Htmldialog-inputbox checkbox (multiple listbox selection)?

Hello,
I was looking at https://github.com/SketchUp/htmldialog-inputbox and need a way to do “checkbox”.
It currently does a “listbox” which allows the user to select one. I am interested in allow the user
to select one or more from a list. Any pointers appreciated.
-Robert

For that you will need to use an HtmlDialog. Unfortunately that requires a bit more effort.

In the meantime, I am using the antiquated WebDialog-based https://github.com/thomthom/SKUI. It allows for multiple selection and is good enough for the time being. Thanks!

SKUI is dated and not mantained any more. It’s also using the deprecated UI::WebDialog class.

I’d recommend spending some time to look into the HtmlDialog examples and explore how you can expand it to your own needs.

Did you also look at the more general HtmlDialog example? SketchUp/htmldialog-examples: Examples of using SketchUp Ruby API’s UI::HtmlDialog class (github.com)

1 Like

Thanks for the suggestions!

I spent all of 30 minutes looking at htmldialog-examples and htmldialog-inputbox but it didn’t have what I wanted “out of the box”. Time is short. I know the SKUI approach is not the way to go for the long term, so I’ll circle back later. I was hoping someone else had already added this feature! But no joy.

I had a quick stab at this: (Needed to refactor some Vue logic to make it easier to add new controls)

thomthom/htmldialog-inputbox at dev/checkbox (github.com)

image

Opened PR to merge into the main repo: (Diff shows the changes I made)
Dev/checkbox by thomthom · Pull Request #4 · SketchUp/htmldialog-inputbox (github.com)

3 Likes

Why does the 3rd example have a default of “Minion” when this value is not in it’s selection list ?
(As shown in your image above.)

Ah. I probably changed the options without updating the default. (:bug:)

It looks like all the edit element types will get an ID with a “Checkbox” prefix. Is this right ?

Opps! Yea. Copy+pasta. (Lets continue this in the GitHub PR)

1 Like

Most excellent! I will migrate from SKUI to htmldialog-inputbox after PR gets approved and merged.
Thank you!!!

2 Likes

It’s checked in now.