I have a small script that turns various tags on and off (actioned by keyboard shortcuts) including one that toggles between the existing tag and new tag. The script pops up a timed HTMLDialog to say which tag is on - existing or new.
I could look more into HtmlDialog - what I have at the moment is rather clunky and I wasn’t able to figure out how to not have the title bar…
I wondered if I could remove the title bar with HTML or CSS…?
And often I’m toggling fast between existing and new to review what I’m doing and while the HtmlDialog is displayed (briefly) I can’t toggle.
I only need this for when I’m in select mode just perusing and mulling over the model as the select cursor hovers over groups and components.
So if I were to use HtmlDialog I’d want the dialog to be displayed at the cursor briefly (essentially emulating the tooltip) and be something like this…
And then your Ruby dialog object needs a callback named “ready” …
@dlg.add_action_callback("ready") { |dialog, params|
puts "DIALOG CONTENT LOADED" if $VERBOSE
Sketchup::focus if Sketchup.respond_to?(:focus)
}
There is also an old dummy dialog “hack” that only works on Windows.
(You open a tiny temp dialog and close it with a timer, and the main application gets the focus.) How to set Focus to Mainwindow - #14 by indie3d
There is no generic MouseObserver implemented that would enable seeing whats under the cursor during native tools (and then using a PickHelper to read object info.)
Perhaps a SelectionObserver subclass, but then that would require that the objects actually be clicked and added to the selection before the layer (or other info) could be read and then displayed by the plugin.
I have managed to write a custom select tool that displays the tag name as you hover about and also mostly replicates the native select tool which I can now routinely use in my modelling, although there is the Pickhelper crossing bug that is yet to be fixed.
The tooltip margin is larger than I would want but better than the skinny default margin - I’m looking into using the Draw method to create a custom tooltip.
It’s been a frustrating yet enjoyable experience and I now have a much better understanding of the API and Ruby.