本文整理汇总了C++中CefRefPtr::AddSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ CefRefPtr::AddSeparator方法的具体用法?C++ CefRefPtr::AddSeparator怎么用?C++ CefRefPtr::AddSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CefRefPtr
的用法示例。
在下文中一共展示了CefRefPtr::AddSeparator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBeforeContextMenu
void CWebClient::OnBeforeContextMenu(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model) {
CEF_REQUIRE_UI_THREAD();
if ((params->GetTypeFlags() & (CM_TYPEFLAG_PAGE | CM_TYPEFLAG_FRAME)) != 0) {
// Add a separator if the menu already has items.
if (model->GetCount() > 0)
model->AddSeparator();
// Add DevTools items to all context menus.
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
model->AddItem(CLIENT_ID_CLOSE_DEVTOOLS, "Close DevTools");
model->AddSeparator();
model->AddItem(CLIENT_ID_INSPECT_ELEMENT, "Inspect Element");
// Test context menu features.
//BuildTestMenu(model);
model->AddSeparator();
model->AddItem(CLIENT_ID_RELOAD, "&Reload");
}
}
示例2: OnBeforeContextMenu
void ClientHandler::OnBeforeContextMenu(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model) {
if ((params->GetTypeFlags() & (CM_TYPEFLAG_PAGE | CM_TYPEFLAG_FRAME)) != 0) {
// Add a separator if the menu already has items.
if (model->GetCount() > 0)
model->AddSeparator();
// Add a "Show DevTools" item to all context menus.
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
CefString devtools_url = browser->GetHost()->GetDevToolsURL(true);
if (devtools_url.empty() ||
m_OpenDevToolsURLs.find(devtools_url) != m_OpenDevToolsURLs.end()) {
// Disable the menu option if DevTools isn't enabled or if a window is
// already open for the current URL.
model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false);
}
// Test context menu features.
BuildTestMenu(model);
}
}
示例3: OnBeforeContextMenu
void ClientHandler::OnBeforeContextMenu(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model)
{
if ((params->GetTypeFlags() & (CM_TYPEFLAG_PAGE | CM_TYPEFLAG_FRAME)) != 0) {
// Add a separator if the menu already has items.
if (model->GetCount() > 0)
model->AddSeparator();
}
}
示例4: BuildTestMenu
void ClientHandler::BuildTestMenu(CefRefPtr<CefMenuModel> model) {
// Henry, do not build testmenu
return;
if (model->GetCount() > 0)
model->AddSeparator();
// Build the sub menu.
CefRefPtr<CefMenuModel> submenu =
model->AddSubMenu(CLIENT_ID_TESTMENU_SUBMENU, "Context Menu Test");
submenu->AddCheckItem(CLIENT_ID_TESTMENU_CHECKITEM, "Check Item");
submenu->AddRadioItem(CLIENT_ID_TESTMENU_RADIOITEM1, "Radio Item 1", 0);
submenu->AddRadioItem(CLIENT_ID_TESTMENU_RADIOITEM2, "Radio Item 2", 0);
submenu->AddRadioItem(CLIENT_ID_TESTMENU_RADIOITEM3, "Radio Item 3", 0);
// Check the check item.
if (m_TestMenuState.check_item)
submenu->SetChecked(CLIENT_ID_TESTMENU_CHECKITEM, true);
// Check the selected radio item.
submenu->SetChecked(
CLIENT_ID_TESTMENU_RADIOITEM1 + m_TestMenuState.radio_item, true);
}