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


C++ TextEntry::SetText方法代码示例

本文整理汇总了C++中TextEntry::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEntry::SetText方法的具体用法?C++ TextEntry::SetText怎么用?C++ TextEntry::SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextEntry的用法示例。


在下文中一共展示了TextEntry::SetText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetControlText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CDialogGameInfo::SetControlText(const char *textEntryName, const char *text)
{
	TextEntry *entry = dynamic_cast<TextEntry *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:11,代码来源:DialogGameInfo.cpp

示例2: SetControlText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CConfigPanel::SetControlText(const char *textEntryName, const char *text)
{
	TextEntry *entry = dynamic_cast<TextEntry *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:11,代码来源:ConfigPanel.cpp

示例3:

//-----------------------------------------------------------------------------
// Purpose: When the enter key is pressed we clear the textentry.
//  To add a newline use ctrl-return.
//-----------------------------------------------------------------------------
void TextEntryDemo5::OnKeyCodeTyped(KeyCode code)
{
	if (code == KEY_ENTER)
	{
		m_pTextEntry->SetText("");
	}

	DemoPage::OnKeyCodeTyped(code);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:13,代码来源:TextEntryDemo5.cpp

示例4: l_set_text

	static int l_set_text(lua_State *l)
	{
		TextEntry *te = LuaObject<UI::TextEntry>::CheckFromLua(1);
		std::string new_text;
		pi_lua_generic_pull(l, 2, new_text);
		te->SetText(new_text);
		lua_pushvalue(l, 1);
		return 1;
	}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:9,代码来源:LuaTextEntry.cpp

示例5: 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() );
		}
	}
开发者ID:hekar,项目名称:luminousforts-2013,代码行数:10,代码来源:replayyoutubeapi.cpp

示例6: SetChildText

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *panelName - 
//			*valueName - 
//-----------------------------------------------------------------------------
void CDialogUserInfo::SetChildText(const char *panelName, const char *valueName)
{
	TextEntry *text = dynamic_cast<TextEntry *>(FindChildByName(panelName));
	if (text)
	{
		char buf[512];
		strncpy(buf, GetDoc()->GetBuddy(m_iUserID)->Data()->GetString(valueName, ""), sizeof(buf) - 1);
		buf[511] = 0;
		text->SetText(buf);
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:16,代码来源:DialogUserInfo.cpp

示例7: UpdateArrayBlocks

void CSheet_Array::UpdateArrayBlocks( const int &dest_x, const int &dest_y )
{
	int old_x, old_y;
	old_x = old_y = 0;
	char ***oldEntires = BuildStringSheet( old_x, old_y );

	for ( int y = 0; y < old_y; y++ )
	{
		//for ( int x = 0; x < old_x; x++ )
		m_hArray_Y_Major[y]->Purge();
		delete m_hArray_Y_Major[y];
	}
	m_hArray_Y_Major.Purge();

	int iCurItem = m_pArrayPanel->FirstItem();
	while ( iCurItem != m_pArrayPanel->InvalidItemID() )
	{
		Panel *pA = m_pArrayPanel->GetItemLabel( iCurItem );
		Panel *pB = m_pArrayPanel->GetItemPanel( iCurItem );
		if ( pA != NULL )
			pA->MarkForDeletion();
		if ( pB != NULL )
			pB->MarkForDeletion();
		iCurItem = m_pArrayPanel->NextItem( iCurItem );
	}
	m_pArrayPanel->DeleteAllItems();
	m_pArrayPanel->RemoveAll();

	for ( int y = 0; y < dest_y; y++ )
	{
		CUtlVector< TextEntry* > *cur = new CUtlVector< TextEntry* >;
		m_hArray_Y_Major.AddToTail( cur );
	}

	m_pArrayPanel->SetNumColumns( dest_y );
	for ( int x = 0; x < dest_x; x++ )
	{
		for ( int y = 0; y < dest_y; y++ )
		{
			CUtlVector< TextEntry* > *cur = m_hArray_Y_Major[y];

			TextEntry *pEntry = new TextEntry( m_pArrayPanel, "arrayslot" );
			pEntry->AddActionSignalTarget( this );
			cur->AddToTail( pEntry );

			if ( x < old_x &&
				y < old_y && oldEntires != NULL )
			{
				pEntry->SetText( oldEntires[x][y] );
			}
			else
				pEntry->SetText( "0" );

			Label *pHeader = NULL;
			if ( y == 0 )
				pHeader = new Label( m_pArrayPanel, "", VarArgs( "%i:", x ) );

			m_pArrayPanel->AddItem( pHeader, pEntry );
			pEntry->MakeReadyForUse();
			pEntry->InvalidateLayout( true, true );
			pEntry->SetBgColor( TOKENCHANNELS_SUPPORTED_COLOR );
		}
	}
	m_pArrayPanel->SetFirstColumnWidth( 20 );

	if ( oldEntires != NULL )
		DestroyStringSheet( oldEntires, old_x, old_y );
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:68,代码来源:vsheet_array.cpp

示例8: PopulateShaderParameters

//-----------------------------------------------------------------------------
// Sets up the shader param editbox
//-----------------------------------------------------------------------------
void CMaterialEditorPanel::PopulateShaderParameters()
{
	Assert( m_nShaderIndex >= 0 );
	m_pEditorPanel->RemoveAll();
	int nCount = g_pMaterialSystem->GetNumShaderParams(m_nShaderIndex);
	for (int i = 0; i < nCount; ++i)
	{
		const char *pParamName = g_pMaterialSystem->GetShaderParamName(m_nShaderIndex, i);

		char tempBuf[512];
		Q_strncpy( tempBuf, pParamName, 512 );
		Q_strnlwr( tempBuf, 512 );

		// build a control & label (strip off '$' prefix)
		Label *pLabel = new Label( this, NULL, tempBuf + 1 ); 
		pLabel->SetSize(128, 24);
		
		// Set up the tooltip for this puppy...
		pLabel->SetTooltipText( g_pMaterialSystem->GetShaderParamHelp(m_nShaderIndex, i) );

		// Get at the material var
		bool bFound;
		IMaterialVar *pMaterialVar = m_pMaterial->FindVar( pParamName, &bFound );
		Assert( bFound );

		Panel *pEditPanel;
		switch( g_pMaterialSystem->GetShaderParamType(m_nShaderIndex, i) )
		{
		case SHADER_PARAM_TYPE_TEXTURE:
			pEditPanel = new Label( this, NULL, "texture" ); 
			break;

		case SHADER_PARAM_TYPE_INTEGER:
			{
				TextEntry *pTextEntry = new TextEntry(this, "Shader Param Integer");
				Q_snprintf( tempBuf, 512, "%d", pMaterialVar->GetIntValue() );
				pTextEntry->SetText( tempBuf );
				pTextEntry->SetEditable( true );

				pEditPanel = pTextEntry;
			}
			break;

		case SHADER_PARAM_TYPE_COLOR:
			pEditPanel = new Label( this, NULL, "color" ); 
			break;
		case SHADER_PARAM_TYPE_VEC2:
			pEditPanel = new Label( this, NULL, "vec2" ); 
			break;
		case SHADER_PARAM_TYPE_VEC3:
			pEditPanel = new Label( this, NULL, "vec3" ); 
			break;

		case SHADER_PARAM_TYPE_FLOAT:
			{
				TextEntry *pTextEntry = new TextEntry(this, "Shader Param Float");
				Q_snprintf( tempBuf, 512, "%f", pMaterialVar->GetIntValue() );
				pTextEntry->SetText( tempBuf );
				pTextEntry->SetEditable( true );

				pEditPanel = pTextEntry;
			}
			break;

		default:
			pEditPanel = new Label( this, NULL, "other" ); 
			break;
		}

		pEditPanel->SetSize(128, 24);
//		pEditPanel->SetContentAlignment( Label::a_east );
		m_pEditorPanel->AddItem( pLabel, pEditPanel );
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:77,代码来源:mateditpanel.cpp


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