ObjectPropertiesPage

References
public abstract class ObjectPropertiesPage
Base class used to add object property user interface panels

Properties

AllObjectsMustBeSupported

#Since v6.7
[CLSCompliant(false)] public virtual bool AllObjectsMustBeSupported { get; }
Returns false which only requires a single item of SupportedTypes to be selected. Override if you wish to change the above behavior.

EnglishPageTitle

#Since v5.0
public abstract string EnglishPageTitle { get; }
English string used to describe this page

Icon

#Since v5.0
public virtual Icon Icon { get; }
obsoleteOverride PageIcon instead
(OBSOLETE - Override PageIcon instead) Icon to display in the object properties tab control

Index

#Since v7.0
public virtual int Index { get; }
The page navigation control adds buttons in the order the pages are processed, override this method and return a sort index to move the button to the beginning of the list. By default this returns -1 which puts the button at the end of the list.

LocalPageTitle

#Since v5.0
public virtual string LocalPageTitle { get; }
Localized page description string, returns the EnglishPageTitle by default.

PageControl

#Since v5.0
public virtual object PageControl { get; }
The control that represents this page. Rhino Windows supports classes that implement the IWin32Windows interface, are derived from System.Windows.FrameworkElement or Eto.Forms.Control. Mac Rhino supports controls that are derived from NSview or Eto.Forms.Control.

PageIconEmbeddedResourceString

#Since v6.4
public virtual string PageIconEmbeddedResourceString { get; }
Resource string for a embedded icon resource in the assembly containing the page instance. If this returns a valid resource and Rhino can load the icon the loaded icon will get used directly otherwise; the PageIcon method will get called.
The page icon embedded resource string.

PageType

#Since v5.11
public virtual PropertyPageType PageType { get; }
Override this and return the page you want to replace a specific object properties page.

SelectedObjects

#Since v5.11
public RhinoObject[] SelectedObjects { get; }
Return a list of Rhino objects to be processed by this object properties page

SupportedTypes

#Since v6.0
[CLSCompliant(false)] public virtual ObjectType SupportedTypes { get; }
Override to specify which objects this page supports

SupportsSubObjects

#Since v6.0
public virtual bool SupportsSubObjects { get; }
If your object properties page supports sub-object selection, you should override this method and return true. This is ignored for view pages. The default implementation returns false.

Methods

AnySelectedObject<T>

#Since v6.0
public bool AnySelectedObject<T>()
Return true if any of the selected objects match the given type

AnySelectedObject<T>

#Since v6.7
public bool AnySelectedObject<T>(bool allMustMatch)
Return true if any of the selected objects match the given type
allMustMatch (bool)If true then every selected object must match the object type otherwise; only a single object has to be of the specified type

GetSelectedObjects

#Since v6.0
[CLSCompliant(false)] public RhinoObject[] GetSelectedObjects(ObjectType filter)
Get selected objects that match a given filter
filter (ObjectType)

GetSelectedObjects<T>

#Since v6.0
public T[] GetSelectedObjects<T>()
Get selected objects of a given type

InitializeControls

#Since v5.0 Obsolete v6.0
public virtual void InitializeControls(RhinoObject rhObj)
obsoleteInitializeControls is obsolete, override UpdatePage instead
Called on the active page after the selected objects list has changed to notify the page to initialize its content to reflect the new object list.
rhObj (RhinoObject)

ModifyPage

#Since v6.0
public void ModifyPage(Action<ObjectPropertiesPageEventArgs> callbackAction)
Call this method when the page is ready to modify the selected objects list. Rhino will suspend UpdatePageNotfictaion, call the passed action then restore UpdatePageNotfictaion.
callbackAction (Action<ObjectPropertiesPageEventArgs>)Called when it is safe to modify objects.

OnActivate

#Since v5.0
public virtual bool OnActivate(bool active)
Called when this page is activated/deactivated.
active (bool)If true then this page is on top otherwise it is about to be hidden.
If true then the page is hidden and the requested page is not activated otherwise will not allow you to change the current page. Default returns true. The return value is currently ignored.

OnCreateParent

#Since v5.0
public virtual void OnCreateParent(nint hwndParent)
Called when the parent container is initially created.
hwndParent (nint)

OnHelp

#Since v5.0
public virtual void OnHelp()
Called when the F1 key or help button is pressed, override to display plug-in specific help for this page.

OnSizeParent

#Since v5.0
public virtual void OnSizeParent(int width, int height)
Called when the parent containers client rectangle size has changed and the PageControl has been resized.
width (int)
height (int)

PageIcon

#Since v6.0
public virtual Icon PageIcon(Size sizeInPixels)
Icon to display in the object properties tab control. Will not get called if PageIconEmbeddedResourceString is overridden and provides a string for a successfully loaded icon resource.
sizeInPixels (Size)The requested icon size in pixels, DPI scaling has been applied. The default value is 24 X DPI scale.

RunScript

#Since v6.0
public virtual Result RunScript(ObjectPropertiesPageEventArgs e)
This method is called when scripting the Rhino Properties command and choosing this page.
e (ObjectPropertiesPageEventArgs)Provides access to the selected object list and document.

RunScript

#Since v6.0 Obsolete v6.0
public virtual Result RunScript(RhinoDoc doc, RhinoObject[] objectList)
obsoleteRunScript(RhinoDoc doc, RhinoObject[] objectList) is obsolete, override RunScript(ObjectPropertiesPageEventArgs e) instead
This method is called when scripting the Rhino Properties command and choosing this page.
doc (RhinoDoc)Active RhinoDoc
objectList (RhinoObject[])List of objects selected by the Properties command.

ShouldDisplay

#Since v6.0
public virtual bool ShouldDisplay(ObjectPropertiesPageEventArgs e)
Called when the selected objects list changes, return true if the object list contains one or more object the page can modify.

ShouldDisplay

#Since v5.0 Obsolete v6.0
public virtual bool ShouldDisplay(RhinoObject rhObj)
obsoleteShouldDisplay(RhinoObject rhObj) is obsolete, override ShouldDisplay(ObjectPropertiesPageEventArgs e) instead
Called when the selected objects list changes, return true if the object list contains one or more object the page can modify.
rhObj (RhinoObject)

UpdatePage

#Since v6.0
public virtual void UpdatePage(ObjectPropertiesPageEventArgs e)
Called on the active page after the selected objects list has changed to notify the page to initialize its content to reflect the new object list.