PanelsRegisterPanel Method (PlugIn, Type, String, Assembly, String, PanelType) |
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: 8.0
Syntax public static void RegisterPanel(
PlugIn plugIn,
Type type,
string caption,
Assembly iconAssembly,
string iconResourceId,
PanelType panelType
)
Public Shared Sub RegisterPanel (
plugIn As PlugIn,
type As Type,
caption As String,
iconAssembly As Assembly,
iconResourceId As String,
panelType As PanelType
)
Parameters
- plugIn
- Type: Rhino.PlugInsPlugIn
Plug-in this panel is associated with
- type
- 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.
- iconAssembly
- Type: System.ReflectionAssembly
Assembly conataining the iconResourceId, if null it is assumed the
iconResourceId is a starndard Rhino resource and the Rhino.UI assembly
will be used.
assembly will be used
- iconResourceId
- Type: SystemString
The resource Id string used to load the panel icon from the iconAssembly.
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.
- panelType
- Type: Rhino.UIPanelType
See PanelType
See Also