Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CRhinoContextMenuExtension Class Referenceabstract

#include <RhinoSdkContextMenu.h>

Public Member Functions

 CRhinoContextMenuExtension (CRhinoPlugIn &plug_in, AFX_MODULE_STATE &ms, bool bEnable=true)
 
virtual ~CRhinoContextMenuExtension ()
 
bool Enable (bool bEnable=true)
 
virtual void ExtendContextMenu (CRhinoContextMenuContext &context, CRhinoContextMenu &pop_menu)=0
 
bool IsEnabled () const
 Return enabled state for this ojbject. More...
 
virtual LRESULT MenuProc (CRhinoContextMenuContext &context, UINT message, WPARAM wParam, LPARAM lParam, CRhinoContextMenu &context_menu)
 This will be used to extend this class without breaking the SDK, currently not called. More...
 
AFX_MODULE_STATE & ModuleState ()
 Return the module state associated with the plug-in that owns this object. More...
 
virtual void OnCommand (CRhinoContextMenuContext &context, int iAddItemID, UINT nID, CRhinoContextMenu &context_menu)=0
 
virtual void OnInitPopupMenu (CRhinoContextMenuContext &context, HWND hWnd, HMENU hMenuOriginal, HMENU hMenuRuntime, CRhinoContextMenu &context_menu)
 
virtual void OnMenuSelect (CRhinoContextMenuContext &context, HWND hWnd, HMENU hMenuOriginal, HMENU hMenuRuntime, UINT nID, CRhinoContextMenu &context_menu)
 
CRhinoPlugInPlugIn ()
 Return the plug-in that owns this object. More...
 
virtual bool ShouldExtendContextMenu (CRhinoContextMenuContext &context)=0
 

Static Public Member Functions

static UUID UUIDCommandHisory ()
 
static UUID UUIDCommandPrompt ()
 
static UUID UUIDCommandWindow ()
 
static UUID UUIDLayerList ()
 
static UUID UUIDMiddleMouse ()
 
static UUID UUIDMRUCommand ()
 
static UUID UUIDPopupMenu ()
 
static UUID UUIDViewport ()
 
static UUID UUIDViewportCaption ()
 
static UUID UUIDViewportOnGrip ()
 
static UUID UUIDViewportOnObject ()
 

Protected Attributes

bool m_bEnabled
 
AFX_MODULE_STATE & m_ms
 
CRhinoPlugInm_plug_in
 

Constructor & Destructor Documentation

◆ CRhinoContextMenuExtension()

CRhinoContextMenuExtension::CRhinoContextMenuExtension ( CRhinoPlugIn plug_in,
AFX_MODULE_STATE &  ms,
bool  bEnable = true 
)

Description: Class constructor Parameters: plug_in [in] Reference to plug-in that owns this extension ms [in] Reference to the module state for the plug-in bEnable [in] If true then the extension will be enabled, see Enable() method for details

◆ ~CRhinoContextMenuExtension()

virtual CRhinoContextMenuExtension::~CRhinoContextMenuExtension ( )
virtual

Member Function Documentation

◆ Enable()

bool CRhinoContextMenuExtension::Enable ( bool  bEnable = true)

Description: Return enabled state for this ojbject Parameters: bEnable [in] If true ShouldExtendContextMenu() will get called when Rhino is about to display a context menu otherwise it it will not Returns: Returns previously enabled state

◆ ExtendContextMenu()

virtual void CRhinoContextMenuExtension::ExtendContextMenu ( CRhinoContextMenuContext context,
CRhinoContextMenu pop_menu 
)
pure virtual

Description: Required virtual override, this method will only be called if ShouldExtendContextMenu() returns true. This is called by Rhino after a separator has been added to the specified context menu and is the plug-ins opportunity to add items to the context menu. Parameters: context [in] Identifies the context menu to extend and what items are currently selected pop_menu [in] Reference to the context menu object which will display the context menu, call the AddItem() methods on this object to extend the menu

◆ IsEnabled()

bool CRhinoContextMenuExtension::IsEnabled ( ) const

Return enabled state for this ojbject.

Description:

◆ MenuProc()

virtual LRESULT CRhinoContextMenuExtension::MenuProc ( CRhinoContextMenuContext context,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
CRhinoContextMenu context_menu 
)
virtual

This will be used to extend this class without breaking the SDK, currently not called.

Description:

◆ ModuleState()

AFX_MODULE_STATE& CRhinoContextMenuExtension::ModuleState ( )

Return the module state associated with the plug-in that owns this object.

Description:

◆ OnCommand()

virtual void CRhinoContextMenuExtension::OnCommand ( CRhinoContextMenuContext context,
int  iAddItemID,
UINT  nID,
CRhinoContextMenu context_menu 
)
pure virtual

Description: Required virtual override, this method is called when a menu item which was added by this context is selected. Parameters: context [in] CRhinoContextMenuContext passed to CRhinoContextMenu::PopupContextMenu() iAddItemID [in] Will be >= 0 if the selected item was added to the menu as a string and not as a sub menu item. nID [nID] If the item was added as a string this will be the current menu item ID for the item, if the item was cloned from a sub menu this will be the original menu item ID context_menu [in] Item which displayed the menu

◆ OnInitPopupMenu()

virtual void CRhinoContextMenuExtension::OnInitPopupMenu ( CRhinoContextMenuContext context,
HWND  hWnd,
HMENU  hMenuOriginal,
HMENU  hMenuRuntime,
CRhinoContextMenu context_menu 
)
virtual

Optional overrides


Description: This method is called in response to the WM_INITMENU message which is generated when the context menu is about to be displayed. Parameters: context [in] Identifies the context menu to extend and what items are currently selected hWnd [in] Window that owns the menu hMenuOriginal [in/out] If this is non-NULL then this is a sub menu item that was added hMenuRuntime [in/out] If this is non-NULL then this is a sub menu item that was added, use RuntimePopupMenuItemID() to convert original menu item IDs to runtime IDs context_menu [in] Item which displayed the menu

◆ OnMenuSelect()

virtual void CRhinoContextMenuExtension::OnMenuSelect ( CRhinoContextMenuContext context,
HWND  hWnd,
HMENU  hMenuOriginal,
HMENU  hMenuRuntime,
UINT  nID,
CRhinoContextMenu context_menu 
)
virtual

Description: This method is called in response to the WM_MENUSELECT message Parameters: context [in] Identifies the context menu to extend and what items are currently selected hWnd [in] Window that owns the menu hMenuOriginal [in/out] If this is non-NULL then this is a sub menu item that was added hMenuRuntime [in/out] If this is non-NULL then this is a sub menu item that was added, use RuntimePopupMenuItemID() to convert original menu item IDs to runtime IDs context_menu [in] Item which displayed the menu

◆ PlugIn()

CRhinoPlugIn& CRhinoContextMenuExtension::PlugIn ( )

Return the plug-in that owns this object.

Description:

◆ ShouldExtendContextMenu()

virtual bool CRhinoContextMenuExtension::ShouldExtendContextMenu ( CRhinoContextMenuContext context)
pure virtual

Required overrides


Description: Required virtual override. You MUST override this method and return true if you want ExtendContextMenu() to get called. Parameters: uuidContextMenu [in] Identifies the context menu about to be displayed Returns: Return true if you want the context menu specified by ecmt to add a separator then call ExtendContextMenu() allowing this object to add items to the context menu.

◆ UUIDCommandHisory()

static UUID CRhinoContextMenuExtension::UUIDCommandHisory ( )
static

Description: ID for command history window (window above the command prompt) context menu

◆ UUIDCommandPrompt()

static UUID CRhinoContextMenuExtension::UUIDCommandPrompt ( )
static

Description: ID for command prompt window

◆ UUIDCommandWindow()

static UUID CRhinoContextMenuExtension::UUIDCommandWindow ( )
static

Description: ID for command input window

◆ UUIDLayerList()

static UUID CRhinoContextMenuExtension::UUIDLayerList ( )
static

Description: ID for layer list control context menu

◆ UUIDMiddleMouse()

static UUID CRhinoContextMenuExtension::UUIDMiddleMouse ( )
static

Description: ID for menu displayed when the middle mouse goes down on a view

◆ UUIDMRUCommand()

static UUID CRhinoContextMenuExtension::UUIDMRUCommand ( )
static

Description: ID for most recent command list menu

◆ UUIDPopupMenu()

static UUID CRhinoContextMenuExtension::UUIDPopupMenu ( )
static

Description: ID for menu displayed by the PopupMenu command

◆ UUIDViewport()

static UUID CRhinoContextMenuExtension::UUIDViewport ( )
static

Description: ID for viewport context menu, did not click on an object or control point

◆ UUIDViewportCaption()

static UUID CRhinoContextMenuExtension::UUIDViewportCaption ( )
static

Description: ID for viewport caption context menu

◆ UUIDViewportOnGrip()

static UUID CRhinoContextMenuExtension::UUIDViewportOnGrip ( )
static

Description: ID for viewport context menu displays when clicking on one or more control points

◆ UUIDViewportOnObject()

static UUID CRhinoContextMenuExtension::UUIDViewportOnObject ( )
static

Description: Viewport context menu displayed when clicking on one or more ojets

Member Data Documentation

◆ m_bEnabled

bool CRhinoContextMenuExtension::m_bEnabled
protected

◆ m_ms

AFX_MODULE_STATE& CRhinoContextMenuExtension::m_ms
protected

◆ m_plug_in

CRhinoPlugIn& CRhinoContextMenuExtension::m_plug_in
protected