本文整理汇总了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 );
}
示例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 );
}
}
示例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" ) );
}
}
}
}
}
示例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;
}
示例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);
}
示例6: SetScore
void SetScore(const char* format, float value)
{
char buffer[64];
snprintf(buffer, sizeof(buffer), format, value);
score->SetText(buffer);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例10: SetToolTip
void Base::SetToolTip( const UnicodeString& strText )
{
Label* tooltip = new Label( this );
tooltip->SetText( strText );
tooltip->SizeToContents();
SetToolTip( tooltip );
}
示例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);
}
}
示例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);
}
}
示例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() );
}
}
示例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 );
}
示例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);
}