PanelsRegisterPanel Method (PlugIn, Type, String, Icon) |
You typically register your panel class in your plug-in's OnLoad
function. This will register your custom call with Rhino, Rhino will
create an instance of your class the first time your panel is created
and embed this instance of your class in a panel container.
Namespace:
Rhino.UI
Assembly:
RhinoCommon (in RhinoCommon.dll)
Since: 5.0
Syntax public static void RegisterPanel(
PlugIn plugin,
Type panelType,
string caption,
Icon icon
)
Public Shared Sub RegisterPanel (
plugin As PlugIn,
panelType As Type,
caption As String,
icon As Icon
)
Parameters
- plugin
- Type: Rhino.PlugInsPlugIn
Plug-in this panel is associated with - panelType
- Type: SystemType
Class type to construct when a panel is shown. If your class is
derived from Eto.Forms.Control it will work on both the Mac and
Windows version of Rhino. In addition Windows Rhino will support any
class types that implement the IWin32Window interface or that are
derived from System.Windows.FrameworkElement. Mac Rhino will also
support classes that are derived from NsView. In addition to the
type requirements the class must have a public constructor with no
parameters or a constructor with a single uint that represents the
document serial number and have a GuidAttribute applied with a
unique Id. n Windows there is only one panel created which gets
recycled for each new document. On the Mac a panel will be created
for each open document and destroyed when the document closes. In
certain situations in Mac Rhino a a panel may get created and
destroyed multiple times when opening/closing a panel while editing a
document.
- caption
- Type: SystemString
Displays in the panel tab on Windows or at the top of the modeless
window on Mac.
- icon
- Type: System.DrawingIcon
The panel icon. On Windows the panel may be displayed using the icon,
caption or both. On Mac the icon will be used and the caption will be
the tool-tip.
See Also