Extension developers: What non-webdialog windows do you use?

I’m curious to lean what alternatives to creating dialogs extension developers might use? Creating via Win32/MFC/Cocoa directly? Using frameworks?

Anyone doing this or knows of any extensions that makes their own dialogs.


Because it is still so difficult to create either WebDialogs or HTMLdialogs, I almost never use either, and have mostly been able to manage with the much simpler InputBox.

If I have ever managed to use Web or HTML dialogs, it’s only been with help from Steve Baumgartner on several plugins we worked on together.

They can be extremely versatile, but I would enormously welcome a simpler pre-packaged solution that wraps them up in something as simple or nearly as simple as an InputBox.

Members: Please, the requested discussion is about non-webdialog window interfaces.
(Please move your web dialog talk to a new topic, so we don’t get two competing talk threads going.)

I recall quite some time ago there was a developer who was using wxRuby for some extension interfaces.
If I remember correctly wxRuby was a wrapper around wxWindows which I think is a dead project.
But wxWindows was a port of wxWidgets which is still very much alive.

It has editions for both Mac Cocoa and MS Windows (among other platforms.)

It has an LGPL license so can be used for commercial products.
There is also professional consultancy help and support available.

Anyway, I remember that wxRuby had to create an invisible wxWindow around the SketchUp application window and set the latter to a child of the former so that the wxMessages would work properly.
The wxRuby AFAIK never got around to implementing the Mac part, so it was always a WIN only framework.

Doing a quick search at Rubygems, I find the newest is the WIN 64bit port …wxruby64

I’m curious too.

But you would like to use something other than inputbox? Can you elaborate on the challenges you find with Web/HtmlDialog? Is it HTML+CSS design? Or JS <-> Ruby communication?

We have used Electron, but it requires Inter-Process Communication, so we try to avoid it and stick with HtmlDialogs when possible.

I think V-Ray is also built with Electron (hence the whole window-parenting mess they took months/years to fix, not fun!).

1 Like

Why choose Electron over HtmlDialog?

Also, aren’t the Fredo tools famous for their non-standard ui? At least they were when I was still using SketchUp as an architecture student.

We use Electron for Transmutr because it can be launched either as a SketchUp extension or as a standalone application.

I think Chaos’ needs for V-Ray are similar: they need a UI framework that can be used regardless of the host application (SketchUp, Rhino, etc).

1 Like

I’m not sure if they use electron any more… I’m sure I asked Noel about this in the past.

Thank you for the context to why you use it.

He uses a lot of in-viewport UIs via his tools, but for dialogs uses Web/HtmlDialogs.

1 Like

If it’s not Electron, it looks very similar.

1 Like

Got my wires crossed, I think they used to use CEF directly, before switching to Electron.

I only use UI::WebDialog and UI::HtmlDialog when I need true dialog boxes. UI::WebDialog is terrible on Mac, but is faster than UI::HtmlDialog, which itself is missing some base methods (some have been provided in SU2021.1).

For some of my interactive tools, I use a openGL-drawn UI based on palettes displayed within the viewport because it does not steel the focus, is more compact and also is easier to program.

As an evolution of UI.inputbox, I think there is space for a ParameterDialog class based on UI::HtmlDialog with a concept of a dialog box with one line by parameter, with a choice of type of input (field, checkbox, combo, etc…) and a callback method to track what is going on. This would of course be rendered with the Trimble styling of choice (modus or so…?). Not very complex to do on top of HtmlDialog and would avoid that developers embark in getting a HTML/CSS/Javascript framework to program standard dialog boxes. Developing a web-based dialog is always a substantial work…

1 Like

I’ve switched to using all html dialogs.

It’s really not that bad. I copy and paste a bit of boiler plate, but for basic stuff it’s not that bad.

Even for simple stuff I use html dialogs.

I’ve dabbled with other methods but they all ended up being hacks that don’t work dependably on both platforms.

I think that Fredo6’s suggestions in post #14 would pretty well match what I’d like to have - a few more input types in an enhanced InputBox, with the silly bug in the Mac version fixed, that needs spaces padding on the right of the input captions so they don’t truncate. (There’s a whole old topic on that subject, here: Inputbox prompt strings are clipped short without apparent reason)

Another advantage of Electron is that it allows us to target a single, recent, Chromium version whereas the built-in HtmlDialog uses old versions that lack modern Javascript API and CSS features (SketchUp 2017 embeds Chrome 52, from 2016, if I’m not mistaken).

I see, that is an advantage indeed.