本文整理汇总了C++中BTextControl::GetBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ BTextControl::GetBuffer方法的具体用法?C++ BTextControl::GetBuffer怎么用?C++ BTextControl::GetBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTextControl
的用法示例。
在下文中一共展示了BTextControl::GetBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageReceived
void BrowserWindow::MessageReceived( BMessage* pcMsg )
{
switch( pcMsg->what )
{
case ID_URL_CHANGED:
{
std::string cURL = m_pcURLView->Text();
for ( uint i = 0 ; i <= cURL.size() ; ++i ) {
if ( i == cURL.size() || isalnum( cURL[i] ) == false ) {
if ( i == cURL.size() || cURL[i] != ':' ) {
std::string cTmp = cURL;
cURL = "http://";
for ( uint j = 0 ; j < cTmp.size() ; ++j ) {
if ( cTmp[j] != '/' ) {
cURL.insert( cURL.end(), cTmp.begin() + j, cTmp.end() );
break;
}
}
}
break;
}
}
m_pcHTMLPart->view()->MakeFocus();
OpenURL( cURL, KParts::URLArgs() );
//----------------------------------------------
#if 0
uint32 nEvents = 0;
pcMsg->FindInt( "events", &nEvents );
if ( nEvents & os::TextView::EI_ESC_PRESSED ) {
m_pcURLView->Set( m_pcHTMLPart->url().prettyURL().utf8().data() );
m_pcHTMLPart->view()->MakeFocus();
break;
}
if ( nEvents & os::TextView::EI_ENTER_PRESSED ) {
std::string cURL = m_pcURLView->GetBuffer()[0];
for ( uint i = 0 ; i <= cURL.size() ; ++i ) {
if ( i == cURL.size() || isalnum( cURL[i] ) == false ) {
if ( i == cURL.size() || cURL[i] != ':' ) {
std::string cTmp = cURL;
cURL = "http://";
for ( uint j = 0 ; j < cTmp.size() ; ++j ) {
if ( cTmp[j] != '/' ) {
cURL.insert( cURL.end(), cTmp.begin() + j, cTmp.end() );
break;
}
}
}
break;
}
}
UpdateHistory();
AddHistoryEntry();
m_pcHTMLPart->view()->MakeFocus();
OpenURL( cURL, KParts::URLArgs() );
UpdateHistory();
}
#endif
break;
}
case ID_ACTIVATE_URLEDIT:
m_pcURLView->MakeFocus( true );
#if 0
m_pcURLView->SetCursor( -1, 0 );
#endif
m_pcURLView->TextView()->SelectAll();
break;
case ID_RELOAD:
{
KParts::URLArgs cArgs;
cArgs.reload = true;
cArgs.xOffset = m_pcHTMLPart->browserExtension()->xOffset();
cArgs.yOffset = m_pcHTMLPart->browserExtension()->yOffset();
#if 0
OpenURL( m_pcURLView->GetBuffer()[0], cArgs );
#endif
OpenURL( m_pcURLView->Text(), cArgs );
break;
}
case ID_NEW_WINDOW:
{
BrowserWindow* pcNewWindow = new BrowserWindow( Frame().OffsetByCopy( 30.0f, 30.0f ), false );
pcNewWindow->Show();
#if 0
UpdateHistory();
std::vector<HistoryEntry*> cHistory = m_cHistory;
cHistory.resize( m_nCurHistoryPos + 1 );
BrowserWindow* pcNewWindow = new BrowserWindow( GetFrame() + os::Point( 30.0f, 30.0f ), &cHistory, false );
pcNewWindow->GoHistory(0);
pcNewWindow->Show( true );
pcNewWindow->MakeFocus( true );
#endif
break;
}
case ID_OPEN_LINK:
{
BString cURL;
//.........这里部分代码省略.........