Page 1 of 1

Simple pop up menu for Tool

Posted: 02 Oct 2015, 14:57
by Bravlin Pechatnik
Hi guys.
I am trying to make my tool open up pop up menu by RMBClick in viewport.
Is there any ways to do that via C++ API etc ?
A know that RCTools have it in .js files.
But i think that maybe there is something more native for XSI ?

Simple "RegisterMenu" add menus to already exist custom menus and as i understand can not be invoked in custom Tool by RMBClick.

Re: pywin debug

Posted: 02 Oct 2015, 17:05
by Bravlin Pechatnik
since its a Tool callback this context menu available only for Tools

Code: Select all

        CStatus MenuInit( ToolContext &in_ctxt )
        {
            Menu oMenu;
            oMenu = in_ctxt.GetSource();
            MenuItem oNewItem;
            oMenu.AddCommandItem(L"MX_Roundish",L"Applymx_Roundish",oNewItem);

            return CStatus::OK;
        }
        #define DECLARE_TOOL_CALLBACK(TOOL,CALLBACK) \
        SICALLBACK TOOL##_##CALLBACK( ToolContext& in_ctxt ) { \
            TOOL *l_pTool = (TOOL *)(CValue::siPtrType)in_ctxt.GetUserData(); \
            return ( l_pTool ? l_pTool->CALLBACK( in_ctxt ) : CStatus::Fail ); }
        DECLARE_TOOL_CALLBACK( mxRoundishTool, MenuInit );
more universal context menu can be created via WINAPI as in XSI Xpop plugin