本文整理汇总了C++中XAP_App::rebuildMenus方法的典型用法代码示例。如果您正苦于以下问题:C++ XAP_App::rebuildMenus方法的具体用法?C++ XAP_App::rebuildMenus怎么用?C++ XAP_App::rebuildMenus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XAP_App
的用法示例。
在下文中一共展示了XAP_App::rebuildMenus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
AbiMathView_removeFromMenus ()
{
// First we need to get a pointer to the application itself.
XAP_App *pApp = XAP_App::getApp();
// remove the edit method
EV_EditMethodContainer* pEMC = pApp->getEditMethodContainer() ;
EV_EditMethod * pEM = ev_EditMethod_lookup ( "AbiMathView_FileInsert" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pEM = ev_EditMethod_lookup ( "AbiMathView_LatexInsert" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
// now remove crap from the menus
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
pFact->removeMenuItem("Main",NULL,newEquationID);
pFact->removeMenuItem("Main",NULL,FromFileID);
pFact->removeMenuItem("Main",NULL,FromLatexID);
pFact->removeMenuItem("Main",NULL, endEquationID);
pApp->rebuildMenus();
}
示例2: AbiMathView_addToMenus
//.........这里部分代码省略.........
// on in our for loop. Take a look near the bottom.
EV_Menu_ActionSet* pActionSet = pApp->getMenuActionSet();
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
// Put it after Insert Picture in the Main menu
newEquationID= pFact->addNewMenuAfter("Main",NULL,AP_MENU_ID_INSERT_GRAPHIC,EV_MLF_BeginSubMenu);
UT_DEBUGMSG(("newEquationID %d \n",newEquationID));
pFact->addNewLabel(NULL,newEquationID,AbiMathView_MenuLabelEquation, AbiMathView_MenuTooltipEquation);
// Create the Action that will be called.
EV_Menu_Action* myEquationAction = new EV_Menu_Action(
newEquationID, // id that the layout said we could use
1, // yes, we have a sub menu.
0, // no, we don't raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
NULL, // no callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
// Now what we need to do is add this particular action to the ActionSet
// of the application. This forms the link between our new ID that we
// got for this particular frame with the EditMethod that knows how to
// call our callback function.
pActionSet->addAction(myEquationAction);
FromFileID= pFact->addNewMenuAfter("Main",NULL,newEquationID,EV_MLF_Normal);
UT_DEBUGMSG(("FromFile ID %d \n",FromFileID));
pFact->addNewLabel(NULL,FromFileID,AbiMathView_MenuLabelFileInsert, AbiMathView_MenuTooltipFileInsert);
// Create the Action that will be called.
EV_Menu_Action* myFileAction = new EV_Menu_Action(
FromFileID, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"AbiMathView_FileInsert", // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
// Now what we need to do is add this particular action to the ActionSet
// of the application. This forms the link between our new ID that we
// got for this particular frame with the EditMethod that knows how to
// call our callback function.
pActionSet->addAction(myFileAction);
FromLatexID= pFact->addNewMenuAfter("Main",NULL,FromFileID,EV_MLF_Normal);
UT_DEBUGMSG(("Latex ID %d \n",FromLatexID));
pFact->addNewLabel(NULL,FromLatexID,AbiMathView_MenuLabelLatexInsert, AbiMathView_MenuTooltipLatexInsert);
// Create the Action that will be called.
EV_Menu_Action* myLatexAction = new EV_Menu_Action(
FromLatexID, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"AbiMathView_LatexInsert", // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
pActionSet->addAction(myLatexAction);
endEquationID= pFact->addNewMenuAfter("Main",NULL,AbiMathView_MenuLabelLatexInsert,EV_MLF_EndSubMenu);
UT_DEBUGMSG(("End Equation ID %d \n",endEquationID));
pFact->addNewLabel(NULL,endEquationID,AbiMathView_MenuEndEquation,NULL);
// Create the Action that will be called.
EV_Menu_Action* myEndEquationAction = new EV_Menu_Action(
endEquationID, // id that the layout said we could use
0, // no, we don't have a sub menu.
0, // no, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
NULL, // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
pActionSet->addAction(myEndEquationAction);
pApp->rebuildMenus();
}