GUI without decorations
-
Hi guys, I'm guessing how to build a GUI without any decorations (frame, toolbar, statusbas, etc) like Fredo's Toposhaper does. Any ideas?
-
GUI like TopoShaper and my other plugins' are drawn in the viewport and constantly refreshed (at each
view.invalidate
). So this is a very different technique compared with HTML dialogs.Benefits:
- you can use a state driven approach, since the refresh is permanent
- you do not have problems of focus between the Sketchup window and the dialog box
Drawbacks
- you have to draw everything with the OpenGL methods (i.e.
view.draw2d()
), and manage the interactivity withonLButtonDown
,onLButtonDown
andonMouseMove
()). - The GUI takes some real-estate on the Sketchup viewport. And also, it disappears when you Orbit or pan
- Some users don't like it, as it is 'non standard' (by the way, when looking at Web Sites, this difficult to say that there are standard in HTML too!)
Note that HTML / JavaScript / CSS, you can make the programming state driven by using frameworks like Vue and Bootstrap. There is a learning curve but overall it's working fine. For the focus, this is more complex to handle, but there is a technique to force Sketchup to give back focus to itself.
Fredo
Advertisement