I haven’t looked into the ViewportControl, but from it you can get the RhinoViewport, which you can manipulate via code.
I’d go with the Eto sample app. There the ViewportControl is derived from Eto.Forms.Control, which has all the regular input events as one would expect from a control.
So you’ll have to handle that yourself, and drive the underlying RhinoViewport yourself via code.
Note that I haven’t tried this myself, this is all just an educated guess.
https://github.com/mcneel/rhino-developer-samples/tree/7/rhino.inside/dotnet/SampleEtoApp
the API documentation isn’t enough to implement a better Rhino-like viewport behavior.
the behavior of the Eto example is same as the WinForms one, i.e. no rotation of the model with right-click.
UPDATE:
To clarify what I mean by “thorough”.
An example that has:
Rhino Toolbar with some icons. linked to rhino commands
A dockable panel
command terminal
pan, rotate, zoom with the mouse
nathanletwory
(Nathan 'jesterKing' Letwory)
October 11, 2021, 12:23pm
2
The class is not in the RhinoCommon documentation, as it does not exist in the RhinoCommon.dl.
The ViewportControl is a Eto.Forms.Control, so look at that documentation for the input events.
The ViewportControl has one property: Viewport
, which gives you a RhinoViewport
. Eto documentation is linked to from the API page
Anyway, I’ve logged RH-65901 Publish Rhino.UI.ViewportControl documentation.
I also checked Eto documentation. No controls there either:
unless you mean this:
nathanletwory
(Nathan 'jesterKing' Letwory)
October 11, 2021, 12:27pm
4
When I say it is a Eto.Forms.Control
it means the control derives from the class Eto.Forms.Control
. Look at the documentation of that class. Rhino.UI.ViewportControl
inherits the public API of the control it inherits.
if only there was Rhino.UI.Viewport… in the documentation. I was looking for it as well. no V* classes
Unfortunately, that goes beyond my “script-kiddie in transition” skills. I need a working example to build on top of it. In the example there isn’t even the left-click-pan implementation. Feels like there is a hidden implementation.
nathanletwory
(Nathan 'jesterKing' Letwory)
October 11, 2021, 12:40pm
6
If you are looking for RhinoViewport
it is under Rhino.Display
: RhinoViewport Class
Anyway, you will want to learn a bit more C# if you want to tackle this sort of tasks.
I am not sure why you drill into ICallback interface, I said Eto.Forms.Control
. The events it exposes are Control Events , from Control Class .
now I’m more confused…anyways, not your fault.
I’ll wait for a better example as the title of the thread states.