当前位置: 首页>>代码示例>>C++>>正文


C++ ContextMenu类代码示例

本文整理汇总了C++中ContextMenu的典型用法代码示例。如果您正苦于以下问题:C++ ContextMenu类的具体用法?C++ ContextMenu怎么用?C++ ContextMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ContextMenu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

void CustomContextMenuProvider::populateContextMenuItems(const HTMLMenuElement& menu, ContextMenu& contextMenu)
{
    HTMLElement* nextElement = Traversal<HTMLElement>::firstWithin(menu);
    while (nextElement) {
        if (isHTMLHRElement(*nextElement)) {
            appendSeparator(contextMenu);
            nextElement = Traversal<HTMLElement>::next(*nextElement, &menu);
        } else if (isHTMLMenuElement(*nextElement)) {
            ContextMenu subMenu;
            String labelString = nextElement->fastGetAttribute(labelAttr);
            if (labelString.isNull()) {
                appendSeparator(contextMenu);
                populateContextMenuItems(*toHTMLMenuElement(nextElement), contextMenu);
                appendSeparator(contextMenu);
            } else if (!labelString.isEmpty()) {
                populateContextMenuItems(*toHTMLMenuElement(nextElement), subMenu);
                contextMenu.appendItem(ContextMenuItem(SubmenuType, ContextMenuItemCustomTagNoAction, labelString, String(), &subMenu));
            }
            nextElement = Traversal<HTMLElement>::nextSibling(*nextElement);
        } else if (isHTMLMenuItemElement(*nextElement)) {
            appendMenuItem(toHTMLMenuItemElement(nextElement), contextMenu);
            if (ContextMenuItemBaseCustomTag + m_menuItems.size() >= ContextMenuItemLastCustomTag)
                break;
            nextElement = Traversal<HTMLElement>::next(*nextElement, &menu);
        } else {
            nextElement = Traversal<HTMLElement>::next(*nextElement, &menu);
        }
    }

    // Remove separators at the end of the menu and any submenus.
    while (contextMenu.items().size() && contextMenu.items().last().type() == SeparatorType)
        contextMenu.removeLastItem();
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:33,代码来源:CustomContextMenuProvider.cpp

示例2: populateContextMenuItems

static bool populateContextMenuItems(v8::Isolate* isolate,
                                     const v8::Local<v8::Array>& itemArray,
                                     ContextMenu& menu) {
  v8::Local<v8::Context> context = isolate->GetCurrentContext();
  for (size_t i = 0; i < itemArray->Length(); ++i) {
    v8::Local<v8::Object> item =
        itemArray->Get(context, i).ToLocalChecked().As<v8::Object>();
    v8::Local<v8::Value> type;
    v8::Local<v8::Value> id;
    v8::Local<v8::Value> label;
    v8::Local<v8::Value> enabled;
    v8::Local<v8::Value> checked;
    v8::Local<v8::Value> subItems;
    if (!item->Get(context, v8AtomicString(isolate, "type")).ToLocal(&type) ||
        !item->Get(context, v8AtomicString(isolate, "id")).ToLocal(&id) ||
        !item->Get(context, v8AtomicString(isolate, "label")).ToLocal(&label) ||
        !item->Get(context, v8AtomicString(isolate, "enabled"))
             .ToLocal(&enabled) ||
        !item->Get(context, v8AtomicString(isolate, "checked"))
             .ToLocal(&checked) ||
        !item->Get(context, v8AtomicString(isolate, "subItems"))
             .ToLocal(&subItems))
      return false;
    if (!type->IsString())
      continue;
    String typeString = toCoreStringWithNullCheck(type.As<v8::String>());
    if (typeString == "separator") {
      ContextMenuItem item(ContextMenuItem(
          SeparatorType, ContextMenuItemCustomTagNoAction, String(), String()));
      menu.appendItem(item);
    } else if (typeString == "subMenu" && subItems->IsArray()) {
      ContextMenu subMenu;
      v8::Local<v8::Array> subItemsArray = v8::Local<v8::Array>::Cast(subItems);
      if (!populateContextMenuItems(isolate, subItemsArray, subMenu))
        return false;
      TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, labelString,
                       label, false);
      ContextMenuItem item(SubmenuType, ContextMenuItemCustomTagNoAction,
                           labelString, String(), &subMenu);
      menu.appendItem(item);
    } else {
      int32_t int32Id;
      if (!v8Call(id->Int32Value(context), int32Id))
        return false;
      ContextMenuAction typedId = static_cast<ContextMenuAction>(
          ContextMenuItemBaseCustomTag + int32Id);
      TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, labelString,
                       label, false);
      ContextMenuItem menuItem(
          (typeString == "checkbox" ? CheckableActionType : ActionType),
          typedId, labelString, String());
      if (checked->IsBoolean())
        menuItem.setChecked(checked.As<v8::Boolean>()->Value());
      if (enabled->IsBoolean())
        menuItem.setEnabled(enabled.As<v8::Boolean>()->Value());
      menu.appendItem(menuItem);
    }
  }
  return true;
}
开发者ID:mirror,项目名称:chromium,代码行数:60,代码来源:V8DevToolsHostCustom.cpp

示例3: populateContextMenuItems

static void populateContextMenuItems(ExecState* exec, JSArray* array, ContextMenu& menu)
{
    for (size_t i = 0; i < array->length(); ++i) {
        JSObject* item = asObject(array->getIndex(exec, i));
        JSValue label = item->get(exec, Identifier::fromString(exec, "label"));
        JSValue type = item->get(exec, Identifier::fromString(exec, "type"));
        JSValue id = item->get(exec, Identifier::fromString(exec, "id"));
        JSValue enabled = item->get(exec, Identifier::fromString(exec, "enabled"));
        JSValue checked = item->get(exec, Identifier::fromString(exec, "checked"));
        JSValue subItems = item->get(exec, Identifier::fromString(exec, "subItems"));
        if (!type.isString())
            continue;

        String typeString = type.toWTFString(exec);
        if (typeString == "separator") {
            ContextMenuItem item(SeparatorType, ContextMenuItemTagNoAction, String());
            menu.appendItem(item);
        } else if (typeString == "subMenu" && subItems.inherits(JSArray::info())) {
            ContextMenu subMenu;
            JSArray* subItemsArray = asArray(subItems);
            populateContextMenuItems(exec, subItemsArray, subMenu);
            ContextMenuItem item(SubmenuType, ContextMenuItemTagNoAction, label.toWTFString(exec), &subMenu);
            menu.appendItem(item);
        } else {
            ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(exec));
            ContextMenuItem menuItem((typeString == "checkbox" ? CheckableActionType : ActionType), typedId, label.toWTFString(exec));
            if (!enabled.isUndefined())
                menuItem.setEnabled(enabled.toBoolean(exec));
            if (!checked.isUndefined())
                menuItem.setChecked(checked.toBoolean(exec));
            menu.appendItem(menuItem);
        }
    }
}
开发者ID:eocanha,项目名称:webkit,代码行数:34,代码来源:JSInspectorFrontendHostCustom.cpp

示例4: KURL

void CustomContextMenuProvider::appendMenuItem(HTMLMenuItemElement* menuItem,
                                               ContextMenu& contextMenu) {
  // Avoid menuitems with no label.
  String labelString = menuItem->fastGetAttribute(labelAttr);
  if (labelString.isEmpty())
    return;

  m_menuItems.append(menuItem);

  bool enabled = !menuItem->fastHasAttribute(disabledAttr);
  String icon = menuItem->fastGetAttribute(iconAttr);
  if (!icon.isEmpty()) {
    // To obtain the absolute URL of the icon when the attribute's value is not
    // the empty string, the attribute's value must be resolved relative to the
    // element.
    KURL iconURL = KURL(menuItem->baseURI(), icon);
    icon = iconURL.getString();
  }
  ContextMenuAction action = static_cast<ContextMenuAction>(
      ContextMenuItemBaseCustomTag + m_menuItems.size() - 1);
  if (equalIgnoringCase(menuItem->fastGetAttribute(typeAttr), "checkbox") ||
      equalIgnoringCase(menuItem->fastGetAttribute(typeAttr), "radio"))
    contextMenu.appendItem(
        ContextMenuItem(CheckableActionType, action, labelString, icon, enabled,
                        menuItem->fastHasAttribute(checkedAttr)));
  else
    contextMenu.appendItem(
        ContextMenuItem(ActionType, action, labelString, icon, enabled, false));
}
开发者ID:mirror,项目名称:chromium,代码行数:29,代码来源:CustomContextMenuProvider.cpp

示例5: ContextMenuItem

//! Insert a menu item at specified position.
ContextMenuItem* ContextMenu::insertItem(unsigned int idx, const std::string& text, int commandId, bool enabled,
    bool hasSubMenu, bool checked, bool autoChecking)
{
  ContextMenuItem* newItem = new ContextMenuItem( this, text );
  newItem->setEnabled( enabled );
  newItem->setSubElement( true );
  newItem->setChecked( checked );
  newItem->setAutoChecking( autoChecking );
  newItem->setText( text );
  newItem->setFlag( ContextMenuItem::drawSubmenuSprite );
  newItem->setIsSeparator( text.empty() );
  newItem->setCommandId( commandId );
  sendChildToBack( newItem );

  if (hasSubMenu)
  {
    ContextMenu* subMenu = newItem->addSubMenu( commandId );
    subMenu->setVisible( false );
  }

  if ( idx < _d->items.size() )
  {
    _d->items.insert( _d->items.begin() + idx, newItem );
  }
  else
  {
    _d->items.push_back( newItem );
  }

  return newItem;
}
开发者ID:andrelago13,项目名称:caesaria-game,代码行数:32,代码来源:contextmenu.cpp

示例6: MainWindow

MainWindow :: MainWindow(HINSTANCE instance, const wchar_t* caption, _Controller* controller, Model* model)
   : SDIWindow(instance, caption), _windowList(10, IDM_WINDOW_WINDOWS), _recentFiles(10, IDM_FILE_FILES), _recentProjects(10, IDM_FILE_PROJECTS), _contextBrowser(model)
{
   _controller = controller;
   _model = model;
   _tabTTHandle = NULL;

   _controlCount = 14;
   _controls = (_BaseControl**)malloc(_controlCount << 2);

   _controls[0] = NULL;
   _controls[CTRL_MENU] = new Menu(instance, IDR_IDE_ACCELERATORS, ::GetMenu(getHandle()));
   _controls[CTRL_CONTEXTMENU] = new ContextMenu();

   _windowList.assign((Menu*)_controls[CTRL_MENU]);
   _recentFiles.assign((Menu*)_controls[CTRL_MENU]);
   _recentProjects.assign((Menu*)_controls[CTRL_MENU]);

   ContextMenu* contextMenu = (ContextMenu*)_controls[CTRL_CONTEXTMENU];

   contextMenu->create(8, contextMenuInfo);

   _controls[CTRL_STATUSBAR] = new StatusBar(this, 5, StatusBarWidths);
   _controls[CTRL_TOOLBAR] = new ToolBar(this, 16, AppToolBarButtonNumber, AppToolBarButtons);
   _controls[CTRL_EDITFRAME] = new EditFrame(this, true, contextMenu, model);
   _controls[CTRL_TABBAR] = new TabBar(this, _model->tabWithAboveScore);
   _controls[CTRL_OUTPUT] = new Output((Control*)_controls[CTRL_TABBAR], this);
   _controls[CTRL_MESSAGELIST] = new MessageLog((Control*)_controls[CTRL_TABBAR]);
   _controls[CTRL_CALLLIST] = new CallStackLog((Control*)_controls[CTRL_TABBAR]);
   _controls[CTRL_BSPLITTER] = new Splitter(this, (Control*)_controls[CTRL_TABBAR], false, IDM_LAYOUT_CHANGED);
   _controls[CTRL_CONTEXTBOWSER] = new TreeView((Control*)_controls[CTRL_TABBAR], true);
   _controls[CTRL_PROJECTVIEW] = new TreeView(this, false);
   _controls[CTRL_HSPLITTER] = new Splitter(this, (Control*)_controls[CTRL_PROJECTVIEW], true, IDM_LAYOUT_CHANGED);

   ((Control*)_controls[CTRL_TABBAR])->_setHeight(120);
   ((Control*)_controls[CTRL_BSPLITTER])->_setConstraint(60, 100);
   ((Control*)_controls[CTRL_PROJECTVIEW])->_setWidth(200);

   _statusBar = (StatusBar*)_controls[CTRL_STATUSBAR];

   EditFrame* frame = (EditFrame*)_controls[CTRL_EDITFRAME];
   TextView* textView = new TextView(frame, 5, 28, 400, 400);
   frame->populate(textView);
   textView->setReceptor(this);
   _contextBrowser.assign((Control*)_controls[CTRL_CONTEXTBOWSER]);
   
   setLeft(CTRL_HSPLITTER);
   setTop(CTRL_TOOLBAR);
   setClient(CTRL_EDITFRAME);
   setBottom(CTRL_BSPLITTER);

   frame->init(model);

   showControls(CTRL_STATUSBAR, CTRL_EDITFRAME);

   showControls(CTRL_PROJECTVIEW, CTRL_PROJECTVIEW);
}
开发者ID:bencz,项目名称:cpu-simulator,代码行数:57,代码来源:winide.cpp

示例7: polishSessionExplorerContextMenu

void TimelineWidget::polishSessionExplorerContextMenu(Subject &subject, const std::string &signal, const boost::any &v)
{
   SessionExplorer &ses = dynamic_cast<SessionExplorer&>(subject);
   if(ses.getItemViewType() == SessionExplorer::ANIMATION_ITEMS)
   {
      ContextMenu *pMenu = boost::any_cast<ContextMenu*>(v);
      VERIFYNRV(pMenu);
      pMenu->addAction(mpNewAnimationAction, "TIMELINEWIDGET_NEW_ANIMATION_ACTION");
   }
}
开发者ID:Siddharthk,项目名称:coan,代码行数:10,代码来源:TimelineWidget.cpp

示例8: contextMenuEvent

void SceneGraphExplorerPanel::contextMenuEvent (QContextMenuEvent* event) {

	QPoint globalPoint = event->globalPos();
	QListWidgetItem* selectedItem = m_listWidget->itemAt(m_listWidget->mapFromGlobal(globalPoint));
	GUIStateNode_ptr selectedGUIStateNode = m_guiStateNodesByItem[selectedItem];

	if(selectedGUIStateNode != NULL && selectedGUIStateNode->getContextMenu() != NULL ) {
		ContextMenu* contextMenu = selectedGUIStateNode->getContextMenu();
		QAction* action = contextMenu->exec(globalPoint);
	}
}
开发者ID:jenseh,项目名称:happah,代码行数:11,代码来源:SceneGraphExplorerPanel.cpp

示例9: String

void CustomContextMenuProvider::appendSeparator(ContextMenu& contextMenu)
{
    // Avoid separators at the start of any menu and submenu.
    if (!contextMenu.items().size())
        return;

    // Collapse all sequences of two or more adjacent separators in the menu or
    // any submenus to a single separator.
    ContextMenuItem lastItem = contextMenu.items().last();
    if (lastItem.type() == SeparatorType)
        return;

    contextMenu.appendItem(ContextMenuItem(SeparatorType, ContextMenuItemCustomTagNoAction, String(), String()));
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:14,代码来源:CustomContextMenuProvider.cpp

示例10: exceptionState

void V8DevToolsHost::showContextMenuAtPointMethodCustom(
    const v8::FunctionCallbackInfo<v8::Value>& info) {
  if (info.Length() < 3)
    return;

  ExceptionState exceptionState(ExceptionState::ExecutionContext,
                                "showContextMenuAtPoint", "DevToolsHost",
                                info.Holder(), info.GetIsolate());
  v8::Isolate* isolate = info.GetIsolate();

  float x = toRestrictedFloat(isolate, info[0], exceptionState);
  if (exceptionState.hadException())
    return;
  float y = toRestrictedFloat(isolate, info[1], exceptionState);
  if (exceptionState.hadException())
    return;

  v8::Local<v8::Value> array = v8::Local<v8::Value>::Cast(info[2]);
  if (!array->IsArray())
    return;
  ContextMenu menu;
  if (!populateContextMenuItems(isolate, v8::Local<v8::Array>::Cast(array),
                                menu))
    return;

  Document* document = nullptr;
  if (info.Length() >= 4 && v8::Local<v8::Value>::Cast(info[3])->IsObject()) {
    v8::Local<v8::Object> documentWrapper =
        v8::Local<v8::Object>::Cast(info[3]);
    if (!V8HTMLDocument::wrapperTypeInfo.equals(
            toWrapperTypeInfo(documentWrapper)))
      return;
    document = V8HTMLDocument::toImpl(documentWrapper);
  } else {
    v8::Local<v8::Object> windowWrapper =
        V8Window::findInstanceInPrototypeChain(
            isolate->GetEnteredContext()->Global(), isolate);
    if (windowWrapper.IsEmpty())
      return;
    DOMWindow* window = V8Window::toImpl(windowWrapper);
    document = window ? toLocalDOMWindow(window)->document() : nullptr;
  }
  if (!document || !document->frame())
    return;

  DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder());
  Vector<ContextMenuItem> items = menu.items();
  devtoolsHost->showContextMenu(document->frame(), x, y, items);
}
开发者ID:mirror,项目名称:chromium,代码行数:49,代码来源:V8DevToolsHostCustom.cpp

示例11: ENABLE

JSValue JSInspectorFrontendHost::showContextMenu(ExecState& state)
{
#if ENABLE(CONTEXT_MENUS)
    if (state.argumentCount() < 2)
        return jsUndefined();
    Event* event = JSEvent::toWrapped(state.argument(0));

    JSArray* array = asArray(state.argument(1));
    ContextMenu menu;
    populateContextMenuItems(&state, array, menu);

    wrapped().showContextMenu(event, menu.items());
#else
    UNUSED_PARAM(state);
#endif
    return jsUndefined();
}
开发者ID:eocanha,项目名称:webkit,代码行数:17,代码来源:JSInspectorFrontendHostCustom.cpp

示例12: updateContextMenu

void RangeProfilePlotManager::updateContextMenu(Subject& subject, const std::string& signal, const boost::any& value)
{
   ContextMenu* pMenu = boost::any_cast<ContextMenu*>(value);
   if (pMenu == NULL)
   {
      return;
   }
   QAction* pDiffAction = new QAction("Calculate Difference", pMenu->getActionParent());
   VERIFYNRV(mpView);
   int numSelectedObjects = mpView->getNumSelectedObjects(true);

   if (numSelectedObjects != 2)
   {
      pDiffAction->setEnabled(false);
   }
   else
   {
      std::list<PlotObject*> objects;
      mpView->getSelectedObjects(objects, true);
      for (std::list<PlotObject*>::const_iterator obj = objects.begin(); obj != objects.end(); ++obj)
      {
         std::string name;
         (*obj)->getObjectName(name);
         if (name == "Difference")
         {
            pDiffAction->setEnabled(false);
            break;
         }
      }
   }

   VERIFYNR(connect(pDiffAction, SIGNAL(triggered()), this, SLOT(calculateDifferences())));
   pMenu->addActionBefore(pDiffAction, "SPECTRAL_RANGEPROFILEPLOT_DIFFERENCE_ACTION", APP_PLOTWIDGET_PRINT_ACTION);

   QAction* pDelAction = new QAction(
      (numSelectedObjects > 1) ? "Delete Plots" : "Delete Plot", pMenu->getActionParent());
   if (mpView != NULL && numSelectedObjects == 0)
   {
      pDelAction->setEnabled(false);
   }
   VERIFYNR(connect(pDelAction, SIGNAL(triggered()), this, SLOT(deleteSelectedPlots())));
   pMenu->addActionAfter(pDelAction, "SPECTRAL_RANGEPROFILEPLOT_DELETE_ACTION",
      "SPECTRAL_RANGEPROFILEPLOT_DIFFERENCE_ACTION");
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:44,代码来源:RangeProfilePlotManager.cpp

示例13: populateContextMenuItems

static bool populateContextMenuItems(v8::Local<v8::Array>& itemArray, ContextMenu& menu, v8::Isolate* isolate)
{
    for (size_t i = 0; i < itemArray->Length(); ++i) {
        v8::Local<v8::Object> item = v8::Local<v8::Object>::Cast(itemArray->Get(i));
        v8::Local<v8::Value> type = item->Get(v8AtomicString(isolate, "type"));
        v8::Local<v8::Value> id = item->Get(v8AtomicString(isolate, "id"));
        v8::Local<v8::Value> label = item->Get(v8AtomicString(isolate, "label"));
        v8::Local<v8::Value> enabled = item->Get(v8AtomicString(isolate, "enabled"));
        v8::Local<v8::Value> checked = item->Get(v8AtomicString(isolate, "checked"));
        v8::Local<v8::Value> subItems = item->Get(v8AtomicString(isolate, "subItems"));
        if (!type->IsString())
            continue;
        String typeString = toCoreStringWithNullCheck(type.As<v8::String>());
        if (typeString == "separator") {
            ContextMenuItem item(ContextMenuItem(SeparatorType,
                                 ContextMenuItemCustomTagNoAction,
                                 String()));
            menu.appendItem(item);
        } else if (typeString == "subMenu" && subItems->IsArray()) {
            ContextMenu subMenu;
            v8::Local<v8::Array> subItemsArray = v8::Local<v8::Array>::Cast(subItems);
            if (!populateContextMenuItems(subItemsArray, subMenu, isolate))
                return false;
            V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<WithNullCheck>, labelString, label, false);
            ContextMenuItem item(SubmenuType,
                ContextMenuItemCustomTagNoAction,
                labelString,
                &subMenu);
            menu.appendItem(item);
        } else {
            ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id->ToInt32()->Value());
            V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<WithNullCheck>, labelString, label, false);
            ContextMenuItem menuItem((typeString == "checkbox" ? CheckableActionType : ActionType), typedId, labelString);
            if (checked->IsBoolean())
                menuItem.setChecked(checked->ToBoolean()->Value());
            if (enabled->IsBoolean())
                menuItem.setEnabled(enabled->ToBoolean()->Value());
            menu.appendItem(menuItem);
        }
    }
    return true;
}
开发者ID:Mihiri,项目名称:blink,代码行数:42,代码来源:V8InspectorFrontendHostCustom.cpp

示例14: USE

void WebContextMenu::menuItemsWithUserData(Vector<WebContextMenuItemData> &menuItems, RefPtr<API::Object>& userData) const
{
    ContextMenuController& controller = m_page->corePage()->contextMenuController();

    ContextMenu* menu = controller.contextMenu();
    if (!menu)
        return;

    // Give the bundle client a chance to process the menu.
#if USE(CROSS_PLATFORM_CONTEXT_MENUS)
    const Vector<ContextMenuItem>& coreItems = menu->items();
#else
    Vector<ContextMenuItem> coreItems = contextMenuItemVector(menu->platformDescription());
#endif
    Vector<WebContextMenuItemData> proposedMenu = kitItems(coreItems, menu);
    Vector<WebContextMenuItemData> newMenu;
    RefPtr<InjectedBundleHitTestResult> hitTestResult = InjectedBundleHitTestResult::create(controller.hitTestResult());
    if (m_page->injectedBundleContextMenuClient().getCustomMenuFromDefaultItems(m_page, hitTestResult.get(), proposedMenu, newMenu, userData))
        proposedMenu = newMenu;
    menuItems = proposedMenu;
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:21,代码来源:WebContextMenu.cpp

示例15: ENABLE

JSValue JSInspectorFrontendHost::showContextMenu(ExecState& state)
{
#if ENABLE(CONTEXT_MENUS)
    if (state.argumentCount() < 2)
        return jsUndefined();
    Event* event = JSEvent::toWrapped(state.argument(0));

    JSArray* array = asArray(state.argument(1));
    ContextMenu menu;
    populateContextMenuItems(&state, array, menu);

#if !USE(CROSS_PLATFORM_CONTEXT_MENUS)
    Vector<ContextMenuItem> items = contextMenuItemVector(menu.platformDescription());
#else
    Vector<ContextMenuItem> items = menu.items();
#endif
    wrapped().showContextMenu(event, items);
#else
    UNUSED_PARAM(state);
#endif
    return jsUndefined();
}
开发者ID:hnney,项目名称:webkit,代码行数:22,代码来源:JSInspectorFrontendHostCustom.cpp


注:本文中的ContextMenu类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。