Simple pop up menu for Tool

Discussions concerning programming of SOFTIMAGE©
Post Reply
Bravlin Pechatnik
Posts: 19
Joined: 03 Nov 2013, 07:02

Simple pop up menu for Tool

Post by Bravlin Pechatnik » 02 Oct 2015, 14:57

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.
Last edited by Bravlin Pechatnik on 24 Oct 2015, 21:18, edited 1 time in total.

Bravlin Pechatnik
Posts: 19
Joined: 03 Nov 2013, 07:02

Re: pywin debug

Post by Bravlin Pechatnik » 02 Oct 2015, 17:05

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

Post Reply

Who is online

Users browsing this forum: trendiction [Bot] and 29 guests