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


C++ BMenu::Open方法代码示例

本文整理汇总了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

}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:42,代码来源:main.cpp


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