本文整理汇总了C++中BMenu::Open方法的典型用法代码示例。如果您正苦于以下问题:C++ BMenu::Open方法的具体用法?C++ BMenu::Open怎么用?C++ BMenu::Open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMenu
的用法示例。
在下文中一共展示了BMenu::Open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopupMenu
void BrowserWindow::PopupMenu( KParts::BrowserExtension* /*pcSource*/, const std::string& cURL )
{
#if 0
m_pcPopupMenu = new os::Menu( Rect( 0, 0, 10, 10 ), "popup", ITEMS_IN_COLUMN );
// Menu* pcSpeedMenu = new os::Menu( Rect( 0, 0, 10, 10 ), "Speed", ITEMS_IN_COLUMN );
// m_pcPopupMenu->AddItem( pcSpeedMenu );
os::Message* pcMsg;
m_pcPopupMenu->AddItem( new os::MenuItem( "New window", new os::Message( ID_NEW_WINDOW ) ) );
m_pcPopupMenu->AddItem( new os::MenuItem( "Reload", new os::Message( ID_RELOAD ) ) );
if ( cURL.empty() == false ) {
m_pcPopupMenu->AddItem( new os::MenuSeparator() );
pcMsg = new os::Message( ID_OPEN_LINK );
pcMsg->AddString( "url", cURL );
m_pcPopupMenu->AddItem( new os::MenuItem( "Open link in new window", pcMsg ) );
pcMsg = new os::Message( ID_SAVE_LINK );
pcMsg->AddString( "url", cURL );
m_pcPopupMenu->AddItem( new os::MenuItem( "Save link as...", pcMsg ) );
pcMsg = new os::Message( ID_COPY_LINK_LOCATION );
pcMsg->AddString( "url", cURL );
m_pcPopupMenu->AddItem( new os::MenuItem( "Copy link location", pcMsg ) );
}
// m_pcPopupMenu->AddItem( new os::MenuItem( "View document source", new os::Message( ID_VIEW_DOC_SRC ) ) );
// pcMsg = new os::Message( ID_VIEW_FRAME_SRC );
// pcMsg->AddPointer( "browser", pcSource );
// m_pcPopupMenu->AddItem( new os::MenuItem( "View frame source", new os::Message( ID_VIEW_FRAME_SRC ) ) );
m_pcPopupMenu->AddItem( new os::MenuSeparator() );
m_pcPopupMenu->AddItem( new os::MenuItem( "Quit", new os::Message( M_QUIT ) ) );
m_pcPopupMenu->SetTargetForItems( this );
os::Point cMousePos;
m_pcStatusBar->GetMouse( &cMousePos, NULL );
m_pcPopupMenu->Open( m_pcStatusBar->ConvertToScreen( cMousePos ) );
#endif
}