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
0
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
0
//-----------------------------------------------------------------------------
// 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
0
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
0
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
0
  void SetScore(const char* format, float value)
  {
    char buffer[64];

    snprintf(buffer, sizeof(buffer), format, value);
    score->SetText(buffer);
  }
//-----------------------------------------------------------------------------
// 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);
	}
}
//-----------------------------------------------------------------------------
// 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
0
//-----------------------------------------------------------------------------
// 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
0
void Base::SetToolTip( const UnicodeString& strText )
{
	Label* tooltip = new Label( this );
	tooltip->SetText( strText );
	tooltip->SizeToContents();

	SetToolTip( tooltip );
}
//-----------------------------------------------------------------------------
// 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
0
//-----------------------------------------------------------------------------
// 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
0
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
0
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
0
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);
}
Пример #16
0
void DisplayMessage::DisplayString(const String& text, unsigned int color, Scriptable *target) const
{
    if (!text.length()) return;

    Label *l = core->GetMessageLabel();
    if (l) {
        const Color fore = { (ieByte)((color >> 16) & 0xFF), (ieByte)((color >> 8) & 0xFF), (ieByte)(color & 0xFF), (ieByte)((color >> 24) & 0xFF)};
        l->SetColor( fore, ColorBlack );
        l->SetText(text);
    }
Пример #17
0
//-----------------------------------------------------------------------------
// Purpose: Setup our scheme
//-----------------------------------------------------------------------------
void CMovieDisplayScreen::ApplySchemeSettings( IScheme *pScheme )
{
    assert( pScheme );

    m_cDefault = Color( 255, 255, 255, 255 );
    m_cInvisible = Color( 0, 0, 0, 0 );

    m_pDisplayTextLabel->SetFgColor( m_cDefault );
    m_pDisplayTextLabel->SetText( "" );
    m_pDisplayTextLabel->SetVisible( false );
}
Пример #18
0
void AboutForm::InitWindow()
{
	SetTaskbarTitle(L"¹ØÓÚÔÆÐÅ");
	m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&AboutForm::OnClicked, this, std::placeholders::_1));

	Label* version = (Label*) FindControl(L"version");
	{
		int ver = 0;
		std::wstring vf;
		nim_ui::UserConfig::GetInstance()->GetAppLocalVersion(ver, vf);
		version->SetText(nbase::StringPrintf(L"°æ±¾: %s.%d", vf.c_str(), ver));
	}
}
Пример #19
0
ListPanel::ListPanel(GHAchievement achievement)
{
	Construct(IDL_PANEL_LISTPANEL);
	isTouchEnable = false;

	id = achievement.getId();
	title = achievement.getTitle();
	imgUrl = achievement.getImgUrl();

	String desc = achievement.getDescription();

	int isHidden	= achievement.getIsHidden();		// hidden 속성 ( 0: hidden, 1: revealed(default))

	int isComplete	= achievement.getIsComplete(); 		// 업적 완료 여부
	int goalPoint	= achievement.getGoalPoint();		// 목표 점수
	int	curPoint	= achievement.getCurPoint();		// 현재 점수

	Label *pLabelTitle	= static_cast< Label* >(GetControl(IDC_LISTPANEL_LABEL_TITLE));
	Label *pLabelDesc	= static_cast< Label* >(GetControl(IDC_LISTPANEL_LABEL_DESC));
	Label *pLabelPoint	= static_cast< Label* >(GetControl(IDC_LISTPANEL_LABEL_POINT));
	Gallery *pImgComplete = static_cast< Gallery* >(GetControl(IDC_LISTPANEL_GALLERY_COMPLETE));
	Panel *pPanelOverlay= static_cast< Panel* >(GetControl(IDC_LISTPANEL_OVERLAY));

	pLabelTitle->SetText(title);
	pLabelDesc->SetText(desc);

	if(isComplete) {
		pImgComplete->SetShowState(true);
		pLabelPoint->SetShowState(false);
	} else {
		pLabelPoint->SetText(Integer::ToString(curPoint) +"/"+ Integer::ToString(goalPoint));
		pImgComplete->SetShowState(false);
	}

	if(isHidden == 0) {
		pPanelOverlay->SetShowState(false);
	}
}
Пример #20
0
//---------------------------------------
void Button::SetLabel( const std::string& text )
{
	Label* labelElement = GetLabelElement();

	if( labelElement )
	{
		// Set the text of the label.
		labelElement->SetText( text );
	}
	else
	{
		WarnFail( "Could not set label for Button \"%s\" because no label element \"%s\" was found!", GetFullName().c_str(), mLabelElementName.GetCString() );
	}
}
Пример #21
0
void RtsForm::ShowHeader()
{
	std::wstring name = UserService::GetInstance()->GetUserName(uid_);
	Label* friend_name = (Label*)FindControl(L"friend_name");
	friend_name->SetText(name);

	std::wstring title_text = L"与" + name + L"的白板";
	SetTaskbarTitle(title_text);
	Label* title = (Label*)FindControl(L"title");
	title->SetText(title_text);

	std::wstring photo = PhotoService::GetInstance()->GetUserPhoto(uid_);
	Button* headicon = (Button*)FindControl(L"headicon");
	headicon->SetBkImage(photo);
}
Пример #22
0
void BangSetText(HWND hwndOwner, LPCTSTR args)
{
    TCHAR name[MAX_LINE_LENGTH];
    TCHAR text[MAX_LINE_LENGTH];
    
    if (GetToken(args, name, &args, FALSE) && GetToken(args, text, &args, FALSE))
    {
        // Find the label
        Label *label = gLabelManager->FindLabel(name);
        
        if (label)
        {
            // Set it's text
            label->SetText(text);
        }
    }
}
Пример #23
0
void PauseWindow::AddSliderOption(int sliderNumber, string sliderName, vector<floatOption> options, float * appliesTo) {
	Label * sliderLabel = new Label();
	Slider<float> * slider = new Slider<float>();

	//Option View Distance
	sliderLabel->vPin = slider->vPin = Control::MIN;
	sliderLabel->hPin = slider->hPin = Control::CENTER;
	sliderLabel->position = Rect(0, 50 + 65 * sliderNumber, 300, 20);
	slider->SetPosition(Rect(0, 80 + 65 * sliderNumber, 300, 25));
	sliderLabel->SetText(sliderName);
	slider->SetValue(appliesTo);
	optsRect.AddControl(sliderLabel);
	optsRect.AddControl(slider);
    

	slider->SetElements(options);
}
Пример #24
0
void DisplayMessage::DisplayString(const char* Text, Scriptable *target) const
{
	Label *l = core->GetMessageLabel();
	if (l) {
		l->SetText(Text);
	}
	TextArea *ta = core->GetMessageTextArea();
	if (ta) {
		ta->AppendText( Text, -1 );
	} else {
		if(target) {
			char *tmp = strdup(Text);

			target->DisplayHeadText(tmp);
		}
	}
}
Пример #25
0
void TabStrip::AddTab(string name)
{
	Label* label = new Label();
	label->SetSize(tabSize);
	label->SetLayoutMargin(Box(0, 0, 10, 10));
	label->SetGravity(GRAVITY_VCENTER | GRAVITY_HCENTER);
	label->SetText(name);
	label->SetParentView(this);
	label->SetRelativePosition(0, 0);
	label->SetTextSize(18);
	if (IsInitialized())
	{
		label->Initialize(context);
		label->CalculateLayout(Size(-1, -1));
	}

	tabs.push_back(label);
}
//=============================================================================
void ControllerOptionsButtons::RecalculateBindingLabels( void )
{
	// Populate the bindings labels with the currently bound keys

	EditablePanel *pContainer = dynamic_cast<EditablePanel *>( FindChildByName( "LabelContainer" ) );
	if ( !pContainer )
		return;

	// for every button on the controller
	for ( int i=0;i<sizeof(sControllerBindings) / sizeof( ControllerBindingMap );i++ )
	{
		// what is it bound to?
		vgui::KeyCode code = sControllerBindings[i].m_keyCode;

		//int nJoystick = m_iActiveUserSlot;
		code = ButtonCodeToJoystickButtonCode( code, m_iActiveUserSlot );

		const char *pBinding = engine->Key_BindingForKey( code );
		if ( !pBinding )
		{
			// key is not bound to anything
			pContainer->SetControlString( sControllerBindings[i].m_pszLabelName, L"<Not Bound>" );
			continue;
		}

		// find the localized string for this binding and set the label text
		for( int j=0;j<sizeof( sBindingToDisplay ) / sizeof( BindingDisplayMap );j++ )
		{
			const BindingDisplayMap *entry =  &( sBindingToDisplay[ j ] );

			if ( Q_strstr( pBinding, entry->pszBinding ) )
			{
				Label *pLabel = dynamic_cast< Label * >( pContainer->FindChildByName( sControllerBindings[i].m_pszLabelName ) );
				if ( pLabel )
				{
					pLabel->SetText( entry->pszDisplay );
				}
			}
		}
	}
}
Пример #27
0
void RtsReplay::InitWindow()
{
	std::wstring title_text = L"白板回放";
	SetTaskbarTitle(title_text);
	Label* title = (Label*)FindControl(L"title");
	title->SetText(title_text);

	m_pRoot->AttachBubbledEvent(ui::kEventAll, nbase::Bind(&RtsReplay::Notify, this, std::placeholders::_1));
	m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&RtsReplay::OnClicked, this, std::placeholders::_1));

	board_ = (BoardControl*)FindControl(L"board");
	mine_slider_ = (Slider*)FindControl(L"mine_prg");
	other_slider_ = (Slider*)FindControl(L"other_prg");
	mine_size_label_ = (Label*)FindControl(L"mine_size");
	other_size_label_ = (Label*)FindControl(L"other_size");
	mine_pos_label_ = (Label*)FindControl(L"mine_pos");
	other_pos_label_ = (Label*)FindControl(L"other_pos");

	ReShowInfo(false);
	ReShowInfo(true);
}
Пример #28
0
int main()
{
    Label label;
    label.SetText( "This is a label" );

    Button button;
    button.SetDimensions( 10, 5 );

    TextButton textButton;
    textButton.SetText( "Click Me" );
    textButton.SetDimensions( 10, 5 );

    cout << endl << endl << "LABEL" << endl;
    label.Draw();

    cout << endl << endl << "BUTTON" << endl;
    button.Draw();

    cout << endl << endl << "TEXT BUTTON" << endl;
    textButton.Draw();

    return 0;
}
Пример #29
0
ListPanel::ListPanel(GHLeaderboard leaderboard)
{
	id = leaderboard.getId();
	title = leaderboard.getTitle();
	imgUrl = leaderboard.getImgUrl();

	Construct(IDL_PANEL_LISTPANEL);
	isTouchEnable = true;
	AddTouchEventListener(*this);

	Label *pLabelTitle = static_cast< Label* >(GetControl(IDC_LISTPANEL_LABEL_TITLE));
	Label *pLabelDesc = static_cast< Label* >(GetControl(IDC_LISTPANEL_LABEL_DESC));
	Label *pImg = static_cast< Label* >(GetControl(IDC_LISTPANEL_IMG));
	Panel *pPanelOverlay= static_cast< Panel* >(GetControl(IDC_LISTPANEL_OVERLAY));
	pPanelOverlay->SetShowState(false);
	Gallery *pImgComplete = static_cast< Gallery* >(GetControl(IDC_LISTPANEL_GALLERY_COMPLETE));
	pImgComplete->SetShowState(false);

	pLabelTitle->SetText(title);

	pLabelTitle->AddTouchEventListener(*this);
	pLabelDesc->AddTouchEventListener(*this);
	pImg->AddTouchEventListener(*this);
}
Пример #30
0
//-----------------------------------------------------------------------------
// 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 )
			{
				switch (iNewTeam)
				{
					case TF_TEAM_RED:
						m_pBalanceLabel->SetText(g_pVGuiLocalize->Find("#TF_teamswitch_red"));
						break;

					case TF_TEAM_BLUE:
						m_pBalanceLabel->SetText(g_pVGuiLocalize->Find("#TF_teamswitch_blue"));
						break;

					case TF_TEAM_GREEN:
						m_pBalanceLabel->SetText(g_pVGuiLocalize->Find("#TF_teamswitch_green"));
						break;

					case TF_TEAM_YELLOW:
						m_pBalanceLabel->SetText(g_pVGuiLocalize->Find("#TF_teamswitch_yellow"));
						break;

					default:
						m_pBalanceLabel->SetText(g_pVGuiLocalize->Find("#TF_teamswitch_blue"));
						break;
				}
			}
		}
	}
}