Panels

public static class Panels
Access to Rhino panels and register custom panels

Properties

EtoPanelStyleName

#Since v6.15
Style applied to Eto controls hosted by the Rhino.UI.Panels and Rhino.UI.ObjectProperties systems.
public static string EtoPanelStyleName { get; }
The name of the Eto panel style.

IconSize

#Since v6.12
Gets the panel icon size in logical units.
public static Size IconSize { get; }
The size of the panel icon in logical units.

IconSizeInPixels

#Since v8.0
Gets the panel icon size in pixels.
public static Size IconSizeInPixels { get; }
The size of the panel icon in pixels.

ScaledIconSize

#Since v6.12
Gets the panel icon size in pixels with DPI scaling applied.
public static Size ScaledIconSize { get; }
IconSize times DPI scale

Methods

ChangePanelIcon

#Since v6.0
Update the icon used for a panel tab.
public static void ChangePanelIcon(
panelType,
icon
New icon to use
)

ChangePanelIcon

#Since v6.0
Update the icon used for a panel tab.
public static void ChangePanelIcon(
panelType,
fullPathToResource
Full path to the new icon resource
)

ClosePanel

#Since v7.3
Will close or hide the specified panel type, in Windows Rhino, if it is the only visible tab the tab dock bar will be closed as well. In Mac Rhino it will always close the modeless dialog hosting the panel.
public static void ClosePanel(
panelId,
Class type Id of the panel to close.
doc
Document associated with panel you wish to close.
)

ClosePanel

#Since v5.0
Will close or hide the specified panel type, in Windows Rhino, if it is the only visible tab the tab dock bar will be closed as well. In Mac Rhino it will always close the modeless dialog hosting the panel.
public static void ClosePanel(
panelId
Class type Id of the panel to close.
)

ClosePanel

#Since v7.3
Will close or hide the specified panel type, in Windows Rhino, if it is the only visible tab the tab dock bar will be closed as well. In Mac Rhino it will always close the modeless dialog hosting the panel.
public static void ClosePanel(
panelType,
Class type of the panel to close.
doc
Document associated with panel you wish to close.
)

ClosePanel

#Since v5.0
Will close or hide the specified panel type, in Windows Rhino, if it is the only visible tab the tab dock bar will be closed as well. In Mac Rhino it will always close the modeless dialog hosting the panel.
public static void ClosePanel(
panelType
Class type of the panel to close.
)

DockBarIdInUse

#Since v8.0
For internal use, call this method to see if a dock bar Id is currently being used by any Rhino dock bar. Rhino
public static bool DockBarIdInUse(
dockBarId
)

FloatPanel

#Since v6.2
Mac support: Display the specified panel in a floating window on Mac, the floating window will only contain the specified panel. Windows support: On Windows this will show or hide the floating container containing the specified panel. If the tab is docked with other tabs it will be floated in a new container.
public static bool FloatPanel(
panelTypeId,
Guid for the panel type to show/hide.
mode
Show, hide or toggle the visibility state of the specified panel
)
Return true if the panel visibility state was changed, false otherwise.

FloatPanel

#Since v6.2
Mac support: Display the specified panel in a floating window on Mac, the floating window will only contain the specified panel. Windows support: On Windows this will show or hide the floating container containing the specified panel. If the tab is docked with other tabs it will be floated in a new container.
public static bool FloatPanel(
panelType,
Panel type to show/hide.
mode
Show, hide or toggle the visibility state of the specified panel
)
Return true if the panel visibility state was changed, false otherwise.

GetOpenPanelIds

#Since v5.0
Get a list of the currently open panel tabs in Windows Rhino, on Mac Rhino it will be a list of the currently visible modeless panel dialogs.
public static Guid[] GetOpenPanelIds()
Returns an array of panel class Id's for the currently open panels, if there are no open panels it will be an empty array.

GetPanel

#Since v6.0
Will return an instance of a .Net panel if the panel has been displayed at least once. Panel instances are not created until a panel is displayed.
[CLSCompliant(false)] public static object GetPanel(
panelId,
Class Id of the panel to search for.
rhinoDoc
Runtime document Id associated with the requested panel.
)
Returns the one and only instance of a panel if it has been properly registered and displayed at least once. If the panel has never been displayed then null will be returned even if the panel is properly registered.

GetPanel

#Since v6.0
Will return an instance of a .Net panel if the panel has been displayed at least once. Panel instances are not created until a panel is displayed.
[CLSCompliant(false)] public static object GetPanel(
panelId,
Class Id of the panel to search for.
documentSerialNumber
Runtime document Id associated with the requested panel.
)
Returns the one and only instance of a panel if it has been properly registered and displayed at least once. If the panel has never been displayed then null will be returned even if the panel is properly registered.

GetPanel

#Since v5.0 Obsolete v6.0
Will return an instance of a .Net panel if the panel has been displayed at least once. Panel instances are not created until a panel is displayed.
public static object GetPanel(
panelId
Class Id of the panel to search for.
)
obsoleteObsolete method, use GetPanel<MyClass>(RhinoDoc)
Returns the one and only instance of a panel if it has been properly registered and displayed at least once. If the panel has never been displayed then null will be returned even if the panel is properly registered.

GetPanel<T>

#Since v6.0 Obsolete v6.0
Return an instance of a .Net panel
public static T GetPanel<T>()
obsoleteObsolete method, use GetPanel<MyClass>(RhinoDoc)

GetPanel<T>

#Since v6.0
Return an instance of a .Net panel
[CLSCompliant(false)] public static T GetPanel<T>(
rhinoDoc
Runtime document Id associated with the requested panel.
)

GetPanel<T>

#Since v6.0
Return an instance of a .Net panel
[CLSCompliant(false)] public static T GetPanel<T>(
documentSerialNumber
Runtime document Id associated with the requested panel.
)

GetPanels

#Since v6.3
Gets the panels.
public static object[] GetPanels(
panelId,
Panel identifier.
doc
Document.
)
The panels.

GetPanels

#Since v6.3
Gets the panels.
[CLSCompliant(false)] public static object[] GetPanels(
panelId,
Panel identifier.
documentRuntimeSerialNumber
Document runtime serial number.
)
The panels.

GetPanels<T>

#Since v6.3
public static T[] GetPanels<T>()

GetPanels<T>

#Since v6.3
Gets the panels.
[CLSCompliant(false)] public static T[] GetPanels<T>(
documentRuntimeSerialNumber
Document runtime serial number.
)
The panels.

IsHiding

#Since v6.0
Check to see if reason is equal to any of the show events
public static bool IsHiding()

IsPanelVisible

#Since v6.0
Check to see if a panel is currently visible, if isSelectedTab is true then the tab must be the active tab as well.
public static bool IsPanelVisible(
panelId,
Class Id for the panel to check.
isSelectedTab
This parameter is ignored on Mac. If Windows and true the panel must be visible in a container and if it is a tabbed container it must be the active tab to be true.
)
On Windows: The return value is dependent on the isSelectedTab value. If isSelectedTab is true then the panel must be included in a visible tabbed container and must also be the active tab to be true. If isSelectedTab is false then the panel only has to be included in a visible tabbed container to be true. On Mac: isSelected is ignored and true is returned if the panel appears in any inspector panel.

IsPanelVisible

#Since v5.0
Check to see if a panel is currently visible, on Windows this means you can see the tab, it does not necessarily mean it is the current tab.
public static bool IsPanelVisible(
panelId
Class Id for the panel to check.
)
Returns true if the tab is visible otherwise it returns false.

IsPanelVisible

#Since v6.0
Check to see if a panel is currently visible, if isSelectedTab is true then the tab must be the active tab as well.
public static bool IsPanelVisible(
panelType,
Type of panel to check for, this type must include a GUID attribute.
isSelectedTab
This parameter is ignored on Mac. If Windows and true the panel must be visible in a container and if it is a tabbed container it must be the active tab to be true.
)
On Windows: The return value is dependent on the isSelectedTab value. If isSelectedTab is true then the panel must be included in a visible tabbed container and must also be the active tab to be true. If isSelectedTab is false then the panel only has to be included in a visible tabbed container to be true. On Mac: isSelected is ignored and true is returned if the panel appears in any inspector panel.

IsPanelVisible

#Since v5.0
Check to see if a panel is currently visible, on Windows this means you can see the tab, it does not necessarily mean it is the current tab.
public static bool IsPanelVisible(
panelType
Type of panel to check for, this type must include a GUID attribute.
)
Returns true if panelType is non null and the tab is visible otherwise it returns false.

IsShowing

#Since v6.0
Check to see if reason is equal to any of the hide events
public static bool IsShowing()

OnClosePanel

#Since v6.0
Call this method to raise the Closed event
[CLSCompliant(false)] public static void OnClosePanel(
panelId,
Panel identifier.
documentSerialNumber
The document associated with the closed panel.
)

OnShowPanel

#Since v6.0
Call this method to raise the Show event
[CLSCompliant(false)] public static void OnShowPanel(
panelId,
documentSerialNumber,
The document associated with the shown/hidden panel.
show
)

OpenPanel

#Since v6.0
In Mac Rhino this will just call the version of OpenPanel that takes a class type Id. In Windows Rhino this will look for a dock bar with the specified Id and open or move the specified panel to that dock bar.
public static Guid OpenPanel(
dockBarId,
Id of the dock bar hosting one or more panels.
panelId,
Class type Id for the panel to open.
makeSelectedPanel
If true then the panel is set as the active tab after opening it otherwise; the panel is opened but not set as the active tab.
)
Returns true if the

OpenPanel

#Since v5.12
In Mac Rhino this will just call the version of OpenPanel that takes a class type Id. In Windows Rhino this will look for a dock bar with the specified Id and open or move the specified panel to that dock bar.
public static Guid OpenPanel(
dockBarId,
Id of the dock bar hosting one or more panels.
panelId
Class type Id for the panel to open.
)
Returns true if the

OpenPanel

#Since v6.0
In Mac Rhino this will just call the version of OpenPanel that takes a class type Id. In Windows Rhino this will look for a dock bar with the specified Id and open or move the specified panel to that dock bar.
public static Guid OpenPanel(
dockBarId,
Id of the dock bar hosting one or more panels.
panelType,
Class type for the panel to open.
makeSelectedPanel
If true then the panel is set as the active tab after opening it otherwise; the panel is opened but not set as the active tab.
)
Returns true if the

OpenPanel

#Since v5.12
In Mac Rhino this will just call the version of OpenPanel that takes a class type Id. In Windows Rhino this will look for a dock bar with the specified Id and open or move the specified panel to that dock bar.
public static Guid OpenPanel(
dockBarId,
Id of the dock bar hosting one or more panels.
panelType
Class type for the panel to open.
)
Returns true if the

OpenPanel

#Since v6.0
Open the specified panel in its current or default location and if it is in a dock bar containing more than one tab, make it the current tab.
public static void OpenPanel(
panelId,
Class type Id for the panel to open.
makeSelectedPanel
If true then the panel is set as the active tab after opening it otherwise; the panel is opened but not set as the active tab.
)

OpenPanel

#Since v5.0
Open the specified panel in its current or default location and if it is in a dock bar containing more than one tab, make it the current tab.
public static void OpenPanel(
panelId
Class type Id for the panel to open.
)

OpenPanel

#Since v6.0
Open the specified panel in its current or default location and if it is in a dock bar containing more than one tab, make it the current tab.
public static void OpenPanel(
panelType,
Class type of the panel to open.
makeSelectedPanel
If true then the panel is set as the active tab after opening it otherwise; the panel is opened but not set as the active tab.
)

OpenPanel

#Since v5.0
Open the specified panel in its current or default location and if it is in a dock bar containing more than one tab, make it the current tab.
public static void OpenPanel(
panelType
Class type of the panel to open.
)

OpenPanelAsSibling

#Since v6.0
In Mac Rhino this will currently just call OpenPanel, in Windows Rhino this will look for a dock bar which contains the sibling panel and add this panel to that dock bar as necessary, if the panel was in another dock bar it will be moved to this dock bar.
public static bool OpenPanelAsSibling(
panelId,
The class Id of the panel type to open.
siblingPanelId,
The class Id of the sibling panel.
makeSelectedPanel
If true then the panel is set as the active tab after opening it otherwise; the panel is opened but not set as the active tab.
)
Returns true if the panel was successfully opened.

OpenPanelAsSibling

#Since v5.0
In Mac Rhino this will currently just call OpenPanel, in Windows Rhino this will look for a dock bar which contains the sibling panel and add this panel to that dock bar as necessary, if the panel was in another dock bar it will be moved to this dock bar.
public static bool OpenPanelAsSibling(
panelId,
The class Id of the panel type to open.
siblingPanelId
The class Id of the sibling panel.
)
Returns true if the panel was successfully opened.

PanelDockBar

#Since v5.12
Will always return Guid.Empty in Mac Rhino. In Windows Rhino it will look for the dock bar which contains the specified panel class Id and return the dock bar Id.
public static Guid PanelDockBar(
panelId
Panel class Id for of the panel to look for.
)
Always returns Guid.Empty on Mac Rhino. On Windows Rhino it will return the Id for the dock bar which host the specified panel or Guid.Empty if the panel is not currently visible.

PanelDockBar

#Since v5.12
Will always return Guid.Empty in Mac Rhino. In Windows Rhino it will look for the dock bar which contains the specified panel class Id and return the dock bar Id.
public static Guid PanelDockBar(
panelType
Panel class for of the panel to look for.
)
Always returns Guid.Empty on Mac Rhino. On Windows Rhino it will return the Id for the dock bar which host the specified panel or Guid.Empty if the panel is not currently visible.

PanelDockBars

#Since v6.1
Will always return a empty array in Mac Rhino. In Windows Rhino it will look for any panel dock bars that contain the specified panel class Id and return the dock bar Id's.
public static Guid[] PanelDockBars(
panelId
Panel class Id for of the panel to look for.
)
Always returns Guid.Empty on Mac Rhino. On Windows Rhino it will return the Id for the dock bar which host the specified panel or Guid.Empty if the panel is not currently visible.

RegisterPanel

#Since v5.0
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.
public static void RegisterPanel(
plugin,
Plug-in this panel is associated with
panelType,
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 panel may get created and destroyed multiple times when opening/closing a panel while editing a document.
caption,
Displays in the panel tab on Windows or at the top of the modeless window on Mac.
icon
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.
)

RegisterPanel

#Since v8.0
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.
public static void RegisterPanel(
plugIn,
Plug-in this panel is associated with
type,
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 panel may get created and destroyed multiple times when opening/closing a panel while editing a document.
caption,
Displays in the panel tab on Windows or at the top of the modeless window on Mac.
iconAssembly,
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,
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
)

RegisterPanel

#Since v6.1
Call once to register a panel type which will get dynamically created and embedded in a Rhino docking/floating location.
public static void RegisterPanel(
plugIn,
Plug-in restringing the panel
type,
Type of the control object to be displayed in the panel
caption,
Panel caption also used as a tool-tip. 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.
icon,
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.
panelType
)

Events

Closed

#Since v6.0
This event is raised when a panel host is closed
public static event EventHandler<PanelEventArgs> Closed

Show

#Since v6.0
This event is called when a panel is shown or hidden. This event will get raised multipThis times when the active document changes in Mac Rhino. It will called with show equal to false for the previous active document and with show equal to true for the current document. When the event is raised with show equal to false it only means the document instance of the panel is not visible it does not mean the panel host has been closed. If you need to know when the panel host closes then subscribe to the Closed event.
public static event EventHandler<ShowPanelEventArgs> Show