本文整理汇总了C++中TextEntry::InsertString方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEntry::InsertString方法的具体用法?C++ TextEntry::InsertString怎么用?C++ TextEntry::InsertString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEntry
的用法示例。
在下文中一共展示了TextEntry::InsertString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplySchemeSettings
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
TextEntry *pTextEntryUserName = dynamic_cast< TextEntry * >( FindChildByName( "UserNameTextEntry" ) );
if ( pTextEntryUserName )
{
pTextEntryUserName->SetText( "" );
pTextEntryUserName->InsertString( youtube_username.GetString() );
}
}
示例2: LoadGameOptionsList
//-----------------------------------------------------------------------------
// Purpose: Creates all the controls in the game options list
//-----------------------------------------------------------------------------
void CCreateMultiplayerGameGameplayPage::LoadGameOptionsList()
{
// destroy any existing controls
mpcontrol_t *p, *n;
p = m_pList;
while ( p )
{
n = p->next;
//
delete p->pControl;
delete p->pPrompt;
delete p;
p = n;
}
m_pList = NULL;
// Go through desciption creating controls
CScriptObject *pObj;
pObj = m_pDescription->pObjList;
mpcontrol_t *pCtrl;
CheckButton *pBox;
TextEntry *pEdit;
ComboBox *pCombo;
CScriptListItem *pListItem;
Panel *objParent = m_pOptionsList;
while ( pObj )
{
pCtrl = new mpcontrol_t( objParent, "mpcontrol_t" );
pCtrl->type = pObj->type;
switch ( pCtrl->type )
{
case O_BOOL:
pBox = new CheckButton( pCtrl, "DescCheckButton", pObj->prompt );
pBox->SetSelected( pObj->fdefValue != 0.0f ? true : false );
pCtrl->pControl = (Panel *)pBox;
break;
case O_STRING:
case O_NUMBER:
pEdit = new TextEntry( pCtrl, "DescTextEntry");
pEdit->InsertString(pObj->defValue);
pCtrl->pControl = (Panel *)pEdit;
break;
case O_LIST:
pCombo = new ComboBox( pCtrl, "DescComboBox", 5, false );
pListItem = pObj->pListItems;
while ( pListItem )
{
pCombo->AddItem(pListItem->szItemText, NULL);
pListItem = pListItem->pNext;
}
pCombo->ActivateItemByRow((int)pObj->fdefValue);
pCtrl->pControl = (Panel *)pCombo;
break;
default:
break;
}
if ( pCtrl->type != O_BOOL )
{
pCtrl->pPrompt = new vgui::Label( pCtrl, "DescLabel", "" );
pCtrl->pPrompt->SetContentAlignment( vgui::Label::a_west );
pCtrl->pPrompt->SetTextInset( 5, 0 );
pCtrl->pPrompt->SetText( pObj->prompt );
}
pCtrl->pScrObj = pObj;
pCtrl->SetSize( 100, 28 );
//pCtrl->SetBorder( scheme()->GetBorder(1, "DepressedButtonBorder") );
m_pOptionsList->AddItem( pCtrl );
// Link it in
if ( !m_pList )
{
m_pList = pCtrl;
pCtrl->next = NULL;
}
else
{
mpcontrol_t *p;
p = m_pList;
while ( p )
{
if ( !p->next )
{
//.........这里部分代码省略.........
示例3: CreateControls
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFOptionsAdvancedPanel::CreateControls()
{
BaseClass::CreateControls();
// Go through desciption creating controls
CScriptObject *pObj;
pObj = m_pDescription->pObjList;
mpcontrol_t *pCtrl;
CTFAdvCheckButton *pBox;
TextEntry *pEdit;
ComboBox *pCombo;
CTFAdvSlider *pScroll;
CTFAdvButton *pTitle;
CScriptListItem *pListItem;
Panel *objParent = m_pListPanel;
while (pObj)
{
//Msg("\nAdded: %s %s %f %f %i\n", pObj->prompt, pObj->cvarname, pObj->fcurValue, pObj->fdefValue, pObj->type);
if (pObj->type == O_OBSOLETE)
{
pObj = pObj->pNext;
continue;
}
pCtrl = new mpcontrol_t(objParent, "mpcontrol_t");
pCtrl->type = pObj->type;
switch (pCtrl->type)
{
case O_BOOL:
pBox = new CTFAdvCheckButton(pCtrl, "DescCheckButton", pObj->prompt);
pBox->SetSelected(pObj->fdefValue != 0.0f ? true : false);
pBox->SetCommandString(pObj->cvarname);
pBox->GetButton()->SetFontByString(m_pListPanel->GetFontString());
if (pObj->tooltip[0] != '\0')
{
wchar_t *pText = g_pVGuiLocalize->Find(pObj->tooltip);
if (pText != NULL)
{
char pszToolTipLocal[256];
wcstombs(pszToolTipLocal, pText, sizeof(pszToolTipLocal));
pBox->SetToolTip(pszToolTipLocal);
}
else
{
pBox->SetToolTip(pObj->tooltip);
}
}
pCtrl->pControl = (Panel *)pBox;
break;
case O_STRING:
case O_NUMBER:
pEdit = new TextEntry(pCtrl, "DescTextEntry");
pEdit->InsertString(pObj->defValue);
pCtrl->pControl = (Panel *)pEdit;
break;
case O_SLIDER:
pScroll = new CTFAdvSlider(pCtrl, "DescScrollEntry", pObj->prompt);
pScroll->SetValue(pObj->fdefValue);
pScroll->SetCommandString(pObj->cvarname);
pScroll->SetMinMax(pObj->fMin, pObj->fMax);
pScroll->GetButton()->SetFontByString(m_pListPanel->GetFontString());
pCtrl->pControl = (Panel *)pScroll;
break;
case O_LIST:
pCombo = new ComboBox(pCtrl, "DescComboBox", 5, false);
pListItem = pObj->pListItems;
while (pListItem)
{
pCombo->AddItem(pListItem->szItemText, NULL);
pListItem = pListItem->pNext;
}
pCombo->ActivateItemByRow((int)pObj->fdefValue);
pCtrl->pControl = (Panel *)pCombo;
break;
case O_CATEGORY:
pTitle = new CTFAdvButton(pCtrl, "DescTextTitle", pObj->prompt);
pTitle->SetEnabled(false);
pTitle->SetBorderByString("AdvSettingsTitleBorder");
pTitle->SetBorderVisible(true);
pTitle->GetButton()->SetFontByString("MenuSmallFont");
pCtrl->pControl = (Panel *)pTitle;
break;
default:
break;
}
if (pCtrl->type != O_BOOL && pCtrl->type != O_SLIDER && pCtrl->type != O_CATEGORY)
{
//.........这里部分代码省略.........