// guarantee that no more events will be delivered to either // this widget or any of the widgets in its hierarchy // this includes both screen (XEvent) and Model events. void MSWidget::decoupleAllWidgets(void) { MSWidgetCursor aCursor(this,MSBreadthFirst); for (aCursor.setToFirst();aCursor.isValid();aCursor.setToNext()) { MSWidget *pWidget=aCursor.widget(); Window aWindow=pWidget->_window; // decouple from possible model pWidget->decoupleWidget(); // disable X event dispatching to the widget if (aWindow!=0) _server->widgetHashTable()->remove(aWindow); } }
//******************************************************************* // menuShowing() //******************************************************************* bool CnrPopupMenuHandler::menuShowing(IMenuEvent& menuEvent, ISubmenu& popupAboutToShow) { IContainerObject* popupObject = popupMenuObject(); unsigned long menuItemId; IFUNCTRACE_DEVELOP(); if (popupObject) //a popup menu was requested for a container object { /* delete all the menu items that apply to the container */ IVSequence<unsigned long>::Cursor aCursor(*iCnrMenuItemList); forCursor(aCursor) { menuItemId = iCnrMenuItemList->elementAt(aCursor); popupAboutToShow.deleteItem(menuItemId); } } else //a popup menu was requested for the container itself {