Overview
Many Rhino controls are contained in tabbed, dockable panels.
You can create tabbed panels in a plug-in using WinForms(Windows), WPF (Windows) or Eto (Windows and Mac).
You can find a sample that demonstrate how to create tabbed panels in the Developer Samples repository on GitHub.
Details
The tabbed panel systems work differently Rhino 6 (and later) than it did in Rhino 5 and earlier.
Old Rhino 5 for Windows Behavior
- The registered panel class must be a
publicclass and contain a default constructor that takes no parameters. - A panel instance is created the first time it is referenced by a visible host container and will survive for the length of a Rhino session.
- When a panel is moved to a different host container, the panels parent is changed to the new host and the same panel instance is used.
Current Rhino for Windows Behavior (Per-Document Panels)
- The registered panel class must be a
publicclass and registered as aPanelType.PerDocpanel (the default PanelType). - Rhino looks for public constructors in the following order:
- Constructor taking a
RhinoDoc. - Constructor taking a
uintrepresenting the documents runtime serial number. - Constructor with no arguments.
- Constructor taking a
- A panel instance is created each time a new document is created, if the panel is in a visible host container, and disposed of when the document closes.
- When a panel is moved to a different host container, the panels parent is changed to the new host and the same panel instance is used.
Current Rhino for Windows Behavior (System Panels)
- The registered panel class must be a
publicclass and registered as aPanelType.Systempanel. - Rhino looks for public constructors in the following order:
- Constructor taking a
RhinoDoc. - Constructor taking a
uintrepresenting the documents runtime serial number. - Constructor with no arguments.
- Constructor taking a
- A panel instance is created the first time it is referenced by a visible host container and will survive for the length of a Rhino session.
- When a panel is moved to a different host container, the panels parent is changed to the new host and the same panel instance is used.
Current Rhino for Mac Behavior
Rhino for Mac works the same as Rhino for Windows, with the exception that there will be a panel instance per inspector panel that includes the plug-in panel.
More Information
Rhino includes a IPanel interface which can be implemented to determine when a panel is shown, hidden or closed.
Static events on RhinoDoc should be hooked by your panel class when created and unhooked when disposed of in Rhino.
