本文整理汇总了C++中KHTMLView::SetMsgTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ KHTMLView::SetMsgTarget方法的具体用法?C++ KHTMLView::SetMsgTarget怎么用?C++ KHTMLView::SetMsgTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KHTMLView
的用法示例。
在下文中一共展示了KHTMLView::SetMsgTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RootView
//BrowserWindow::BrowserWindow( BRect cFrame, std::vector<HistoryEntry*>* pcHistory, bool bLoadPos ) :
BrowserWindow::BrowserWindow( BRect cFrame, bool /*bLoadPos*/ )
:BWindow( cFrame, "ABrowse", B_TITLED_WINDOW, 0 )
,m_pcHTMLPart( NULL )
,m_pcStatusBar( NULL )
,m_pcURLView( NULL )
{
atomic_add( &s_nWndCount, 1 );
// BAutolock al( GlobalMutex::GetMutex() );
// GlobalMutex::Lock();
RootView *pcRoot = new RootView( Bounds() );
AddChild( pcRoot );
// AddChild( pcRoot );
// AddTimer( this, 1, 100000, false );
// GlobalMutex::Unlock();
//--------------------------------------------------------------------------
#if 0
LayoutView* pcFrame = new LayoutView( cWndBounds, "frame_view" );
VLayoutNode* pcRoot = new VLayoutNode( "root" );
FrameView* pcNavBarFrame = new FrameView( Rect(0,0,0,0), "nav_bar_frame", "" );
HLayoutNode* pcNavBar = new HLayoutNode( "nav_bar" );
m_pcURLView = new TextView( Rect(0,0,0,0), "url_view", ""/*g_pzDefaultURL*/ );
m_pcURLView->SetEventMask( os::TextView::EI_ENTER_PRESSED | os::TextView::EI_ESC_PRESSED );
m_pcURLView->SetMultiLine( false );
m_pcURLView->SetMessage( new Message( ID_URL_CHANGED ) );
m_pcToolBar = new ToolBar( Rect(0,0,0,0), "tool_bar" );
m_pcStatusBar = new StatusBar( Rect(), "status_bar" );
m_pcToolBar->AddButton( "hi16-action-back.png", os::Message( ID_PREV_URL ) );
m_pcToolBar->AddButton( "hi16-action-forward.png", os::Message( ID_NEXT_URL ) );
m_pcToolBar->AddButton( "hi16-action-gohome.png", os::Message( ID_GOHOME ) );
m_pcToolBar->AddButton( "hi16-action-reload.png", os::Message( ID_RELOAD ) );
m_pcToolBar->AddButton( "hi16-action-find.png", os::Message( ID_FIND ) );
m_pcToolBar->AddButton( "hi16-action-editcopy.png", os::Message( ID_COPY ) );
pcNavBar->AddChild( m_pcToolBar )->SetBorders( Rect( 4, 2, 10, 2 ) );
pcNavBar->AddChild( m_pcURLView );
pcNavBarFrame->SetRoot( pcNavBar );
pcRoot->AddChild( pcNavBarFrame );
QWidget* pcTopView = new TopView;
pcTopView->show();
pcTopView->SetResizeMask( CF_FOLLOW_ALL );
pcTopView->SetFrame( cWndBounds.Bounds() );
pcRoot->AddChild( pcTopView );
pcRoot->AddChild( m_pcStatusBar );
pcFrame->SetRoot( pcRoot );
m_pcHTMLPart = new KHTMLPart( pcTopView, "khtmlpart" ); // ### frame name
m_pcHTMLPart->browserExtension()->SetCallback( this );
AddChild( pcFrame );
KHTMLView* pcView = m_pcHTMLPart->view();
pcView->SetResizeMask( CF_FOLLOW_ALL );
pcView->SetFrame( pcTopView->GetBounds() );
pcView->MakeFocus();
pcView->SetMsgTarget( Messenger( this ) );
pcView->show();
m_pcURLView->SetTarget( this );
m_pcToolBar->SetTarget( Messenger( this ) );
m_pcToolBar->EnableButton( BI_BACK, false );
m_pcToolBar->EnableButton( BI_FORWARD, false );
m_pcToolBar->EnableButton( BI_COPY, false );
char* pzHome = getenv( "HOME" );
if ( bLoadPos && NULL != pzHome ) {
FILE* hFile;
char zPath[ 256 ];
strcpy( zPath, pzHome );
strcat( zPath, "/config/abrowse.cfg" );
hFile = fopen( zPath, "rb" );
//.........这里部分代码省略.........