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


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

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


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

示例1: OnShaderNameChanged

void CEditorRoot::OnShaderNameChanged()
{
	CNodeView *pView = GetSafeFlowgraph();
	const char *pszShaderName = pView->GetShadername();

	m_pMBut_File->GetMenu()->SetItemEnabled( 2, pszShaderName != NULL );

	Label *pTab = (Label*)pNodeSheet->GetActiveTab();
	Assert( pTab && GetActiveFlowgraphPage() );

	if ( pszShaderName == NULL )
	{
		//m_pLabel_CurrentFileName->SetText( "-" );
		//pView->SetShadername( NULL );

		pTab->SetText( GetDefaultTabName( pView ) );
		//GetActiveFlowgraphPage()->sett
	}
	else
	{
		char tmp[MAX_PATH];
		Q_FileBase( pszShaderName, tmp, sizeof( tmp ) );

		//m_pLabel_CurrentFileName->SetText( tmp );
		pTab->SetText( tmp );
	}

	for ( int i = 0; i < pNodeSheet->GetNumPages(); i++ )
		((Panel*)pNodeSheet->GetTab(i))->InvalidateLayout(true);

	pNodeSheet->InvalidateLayout( true, true );
}
开发者ID:Biohazard90,项目名称:source-shader-editor,代码行数:32,代码来源:veditorroot.cpp

示例2: OnTick

void CDODTeamMenu::OnTick( void )
{
	C_DODTeam *pAllies = dynamic_cast<C_DODTeam *>( GetGlobalTeam(TEAM_ALLIES) );
	C_DODTeam *pAxis = dynamic_cast<C_DODTeam *>( GetGlobalTeam(TEAM_AXIS) );

	if ( !pAllies || !pAxis )
		return;

	static int iLastAlliesCount = -1;
	static int iLastAxisCount = -1;

	int iNumAllies = pAllies->Get_Number_Players();
	int iNumAxis = pAxis->Get_Number_Players();

	if ( iNumAllies != iLastAlliesCount )
	{
		iLastAlliesCount = iNumAllies;

		wchar_t wbuf[128];

		if ( iNumAllies == 1 )
		{
			g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), g_pVGuiLocalize->Find("#teammenu_numAllies_1"), 0 );		
		}
		else
		{
			wchar_t wnum[6];
			_snwprintf( wnum, sizeof(wnum), L"%d", iNumAllies );
			g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), g_pVGuiLocalize->Find("#teammenu_numAllies"), 1, wnum );
		}

		Label *pLabel = dynamic_cast<Label *>( FindChildByName("num_allies") );

		if ( pLabel )
			pLabel->SetText( wbuf );
	}

	if ( iNumAxis != iLastAxisCount )
	{
		iLastAxisCount = iNumAxis;

		wchar_t wbuf[128];

		if ( iNumAxis == 1 )
		{
			g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), g_pVGuiLocalize->Find("#teammenu_numAxis_1"), 0 );		
		}
		else
		{
			wchar_t wnum[6];
			_snwprintf( wnum, sizeof(wnum), L"%d", iNumAxis );
			g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), g_pVGuiLocalize->Find("#teammenu_numAxis"), 1, wnum );
		}

		Label *pLabel = dynamic_cast<Label *>( FindChildByName("num_axis") );

		if ( pLabel )
			pLabel->SetText( wbuf );
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:60,代码来源:dodteammenu.cpp

示例3: SetupSwitchPanel

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CHudTeamSwitch::SetupSwitchPanel( int iNewTeam )
{
	if ( m_pBalanceLabel )
	{
		C_TFTeam *pNewTeam = GetGlobalTFTeam( iNewTeam );
		if ( pNewTeam )
		{
			int iRole = pNewTeam->GetRole();
			if ( iRole > 0 && iRole < NUM_TEAM_ROLES )
			{
				m_pBalanceLabel->SetText( g_pVGuiLocalize->Find( pszTeamRoleSwitch[iRole] ) );
			}
			else if ( iRole == 0 )
			{
				if ( iNewTeam == TF_TEAM_RED )
				{
					m_pBalanceLabel->SetText( g_pVGuiLocalize->Find( "#TF_teamswitch_red" ) );
				}
				else
				{
					m_pBalanceLabel->SetText( g_pVGuiLocalize->Find( "#TF_teamswitch_blue" ) );
				}
			}
		}
	}
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:29,代码来源:tf_hud_teamswitch.cpp

示例4: SetupUI

bool AboutDlg::SetupUI()
{
	Window wndVer = GetItem(IDC_STATIC_VERSION);
	String version = PNGO_APPNAME;
	version = version + " ";
	version = version + String(PNGO_VERSION);
#if defined(_M_X64)
	version = version + String(" (x64)");
#elif defined(_M_IX86)  
	version = version + String(" (x86)");
#endif
	wndVer.SetText(version);

	Label labelCopyright = GetItem(IDC_STATIC_COPYRIGHT);
	labelCopyright.SetText( String::FromUtf8Z(PNGO_COPYRIGHT) );

	// Make the main text bold
	m_hFont = CreateBoldWindowFont(wndVer); 
	wndVer.SetFont(m_hFont, false);

	Window wnd = GetItem(IDC_STATIC_URL);
	if( m_syslinkUrl.Create(wnd.GetRelativeRect(), this, IDC_STATIC_URL) )
	{
		// Replace the static text with a SysLink
		String strOri = PNGO_WEBSITE;
		String str = "<a href=\"" PNGO_WEBSITE "\">" + strOri + "</a>";
		m_syslinkUrl.SetText(str);
		m_syslinkUrl.SetSameFontThanParent();
		wnd.Hide();
	}
	return true;
}
开发者ID:hadrien-psydk,项目名称:pngoptimizer,代码行数:32,代码来源:AboutDlg.cpp

示例5: Label

TimeMenu::TimeMenu()
{
	Label *label;
	LineSpacer *spacer;

	label = new Label();
	label->SetFont(&MetaWatch_Large_16pt);
	label->SetText("Time & Date");
	label->SetAlignment(caCentre);
	AddControl(label);

	spacer = new LineSpacer(5, 2);
	spacer->SetLeftPadding(10);
	spacer->SetRightPadding(10);
	AddControl(spacer);

	// Time editor
	timeEntry = new NumberEntry();
	timeEntry->SetFont(&MetaWatch_Large_8pt);
	timeEntry->SetFormat("[0-2][0-9]:[0-5][0-9]:[0-5][0-9]"); // TODO: Change with time format?
	timeEntry->SetAlignment(caCentre);
	AddControl(timeEntry);

	// Date editor
	dateEntry = new NumberEntry();
	dateEntry->SetFont(&MetaWatch_Large_8pt);
	dateEntry->SetFormat("[0-3][0-9]:[0-1][0-9]:[0-2][0-9][0-9][0-9]"); // TODO: Change with date format?
	dateEntry->SetAlignment(caCentre);
	AddControl(dateEntry);
}
开发者ID:RAFACG,项目名称:IndependentlySmartWatch,代码行数:30,代码来源:TimeMenu.cpp

示例6: SetScore

  void SetScore(const char* format, float value)
  {
    char buffer[64];

    snprintf(buffer, sizeof(buffer), format, value);
    score->SetText(buffer);
  }
开发者ID:fluxer,项目名称:warmux,代码行数:7,代码来源:benchmark_menu.cpp

示例7: SetLabelText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CFRModdingMenu_Mapping_Mapadd::SetLabelText(const char *textEntryName, const char *text)
{
	Label *entry = dynamic_cast<Label *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:RaraFolf,项目名称:FIREFIGHT-RELOADED-src-sdk-2013,代码行数:11,代码来源:fr_moddingmenu_mapping_mapadd.cpp

示例8: SetLabelText

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

示例9: SetLabelText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CSpectatorGUI::SetLabelText(const char *textEntryName, wchar_t *text)
{
	Label *entry = dynamic_cast<Label *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:11,代码来源:SpectatorGUI.cpp

示例10: SetToolTip

void Base::SetToolTip( const UnicodeString& strText )
{
	Label* tooltip = new Label( this );
	tooltip->SetText( strText );
	tooltip->SizeToContents();

	SetToolTip( tooltip );
}
开发者ID:Ochakko,项目名称:MameBake3D,代码行数:8,代码来源:Base.cpp

示例11: SetLabelText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CFRStoreMenuSupplies::SetLabelText(const char *textEntryName, const char *text)
{
	Label *entry = dynamic_cast<Label *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:RaraFolf,项目名称:FIREFIGHT-RELOADED-src-sdk-2013,代码行数:11,代码来源:fr_storemenu_supplies.cpp

示例12: SetLabelText

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

示例13: SetupForm

void UfopaediaCategory::SetupForm()
{
	if( ViewingEntry == 0 )
	{
		((Graphic*)menuform->FindControl("BACKGROUND_PICTURE"))->SetImage( fw.data->load_image(BackgroundImageFilename) );
		Label* infolabel = ((Label*)menuform->FindControl("TEXT_INFO"));
		infolabel->SetText( fw.gamecore->GetString(BodyInformation) );
		infolabel = ((Label*)menuform->FindControl("TEXT_TITLE_DATA"));
		infolabel->SetText( fw.gamecore->GetString(Title).toUpper() );
	} else {
		std::shared_ptr<UfopaediaEntry> e = Entries.at( ViewingEntry - 1 );
		((Graphic*)menuform->FindControl("BACKGROUND_PICTURE"))->SetImage( fw.data->load_image( e->BackgroundImageFilename ) );
		Label* infolabel = ((Label*)menuform->FindControl("TEXT_INFO"));
		infolabel->SetText( fw.gamecore->GetString( e->BodyInformation ) );
		infolabel = ((Label*)menuform->FindControl("TEXT_TITLE_DATA"));
		infolabel->SetText( fw.gamecore->GetString( e->Title ).toUpper() );
	}
}
开发者ID:PetePete1984,项目名称:OpenApoc,代码行数:18,代码来源:ufopaediacategory.cpp

示例14: SetToolTip

void Base::SetToolTip( const TextObject & strText )
{
	Label* tooltip = new Label( this );
	tooltip->SetText( strText );
	tooltip->SetTextColorOverride( GetSkin()->Colors.TooltipText );
	tooltip->SetPadding( Padding( 5, 3, 5, 3 ) );
	tooltip->SizeToContents();
	SetToolTip( tooltip );
}
开发者ID:darkf,项目名称:gwen,代码行数:9,代码来源:Base.cpp

示例15: Label

void ProjectGiraffeTab1::displayNoGraffiti(){
	Label* noGraffitiLabel = new Label();
	noGraffitiLabel->Construct(Rectangle(0, 80, GetBounds().width, 40), "posts");
	noGraffitiLabel->SetTextConfig(32, LABEL_TEXT_STYLE_BOLD);
	noGraffitiLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
	noGraffitiLabel->SetName("noGraffitiLabel");
	noGraffitiLabel->SetText(L"No nearby graffiti");
	AddControl(*noGraffitiLabel);
}
开发者ID:justinkchen,项目名称:giraffe,代码行数:9,代码来源:ProjectGiraffeTab1.cpp


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