Right now, we are doing some WPF hacks to ensure that the Eto.Forms.Form nests within the parent viewport, so it follows the movement and resizing of the viewport. It would be great if the native Eto can provide more support on this front.
As soon as I set wpfwnd.AllowsTransparency = true; , I could no longer update the form’s position easily. The control needs to be destroyed and recreated whenever I need to update the GUI form’s position.
Looks very nice. I am used to WPF, so I have chosen to stick with xeto anyway. Some eto behaviours are different on mac than on Windows, so be aware of that. And if you do not target mac, sticking to WPF only would make your life easier.
Interoperability between Mac & Windows was not the main motivation for us to create this UI from scratch. It was about creating the best user experience possible and the native controls just didn’t seem to offer the right functionality.
Once we went down this rabbit hole, it became a bit of a self-propelling challenge - how far can we push it beyond what is traditionally possible in Rhino. The irony is, that we still haven’t shipped the plugin, but we’ve learned a ton in the process
Hi Mariusz, thanks for sharing your thread, it is amazing.
I tried to learn how to create customized screen widget from it. For now I‘ve successfully drew some curves in display pipeline and been able to select them. But one thing I’m curious is how could you draw custom 2d shapes by draw method?
I only found draw2dLine/ Draw2dRectanglar/ Draw2dText, but there are no 2d circle、2d arc and so on . Did you use xform to force geometries to be parallel to the viewport?or there`s other magic to cast custom shapes and icons to screen?
I think I’ve reached some point, I drew some clickable shapes and force them to face camera, but somehow those shapes rotate by changing the angle of view.
Doc.Views.ActiveView.ActiveViewport.GetFrustumLine(cursor.X, cursor.Y, out var ln);
var centerPoint = ln.PointAt(0.5);
e.Display.Viewport.GetCameraFrame(out var cameraPlane);
cameraPlane.Origin = centerPoint;
// use the scale factor to keep the size of your geometry consistent while zooming in & out
e.Viewport.GetWorldToScreenScale(centerPoint, out var scale);
I’m not sure what you are asking? Eto is all about GUI and has many controls. You can create custom controls with a Drawable. Do you have more specifics of what you mean?
@curtisw it would be great if Eto supported cross-platform transparency and effects such as drop shadows of Forms. Currently, these require platform-specific code from developers. Our lives would be much easier if we could simply set the value and Eto would take care of the rest.