void CDialog_RendertargetList::FillList()
{
	ScrollBar *pScroll = m_pList_RT->GetScrollbar();
	int scrollValue = pScroll ? pScroll->GetValue() : 0;

	m_pList_RT->DeleteAllItems();

	GetRTManager()->SortRTsByName();
	for ( int i = 0; i < GetRTManager()->GetNumRTs(); i++ )
	{
		RTDef *rt = GetRTManager()->GetRT( i );

		if ( rt->IsFlaggedForDeletion() )
			continue;

		Label *pL = new Label( m_pList_RT, "", rt->GetName() );
		Button *pBDel = new Button( m_pList_RT, "", "Delete", this, VarArgs("del_rt_%i",i) );
		Button *pBEdit = new Button( m_pList_RT, "", "Edit", this, VarArgs("edit_rt_%i",i) );

		pBDel->SetContentAlignment( Label::a_center );
		pBEdit->SetContentAlignment( Label::a_center );

		m_pList_RT->AddItem( pL, pBDel );
		m_pList_RT->AddItem( NULL, pBEdit );
	}

	if ( pScroll )
		pScroll->SetValue( scrollValue );
}
void CDialog_PPEPrecache::FillList()
{
	ScrollBar *pScroll = m_pList_Effects->GetScrollbar();
	int scrollValue = pScroll ? pScroll->GetValue() : 0;

	m_pList_Effects->DeleteAllItems();

	GetPPCache()->ClearInvalidEntries();

	HFont fontMarlett = scheme()->GetIScheme( GetScheme() )->GetFont( "Marlett", false );

	for ( int i = 0; i < GetPPCache()->GetNumPostProcessingEffects(); i++ )
	{
		EditorPostProcessingEffect *effect = GetPPCache()->GetPostProcessingEffect( i );

		Label *pL = new Label( m_pList_Effects, "", effect->pszName );
		Button *pDel = new Button( m_pList_Effects, "", "Delete", this, VarArgs("del_effect_%i",i) );
		CheckButton *pCheck = new CheckButton( m_pList_Effects, effect->pszName, "" );

		pCheck->AddActionSignalTarget( this );
		pCheck->SetSelected( effect->bStartEnabled );

		Button *pDown = new Button( m_pList_Effects, "", "u", this, VarArgs("movedown_effect_%i",i) );
		Button *pUp = new Button( m_pList_Effects, "", "t", this, VarArgs("moveup_effect_%i",i) );

		pDown->SetFont( fontMarlett );
		pUp->SetFont( fontMarlett );

		pDel->SetContentAlignment( Label::a_center );
		pDown->SetContentAlignment( Label::a_center );
		pUp->SetContentAlignment( Label::a_center );

		m_pList_Effects->AddItem( NULL, pCheck );
		m_pList_Effects->AddItem( NULL, pDown );
		m_pList_Effects->AddItem( NULL, pUp );
		m_pList_Effects->AddItem( pL, pDel );
	}

	if ( pScroll )
		pScroll->SetValue( scrollValue );
}
//-----------------------------------------------------------------------------
// Purpose: Respond to movement of the scroll bar nob by updating the label's
// text with the current value of the scrollbar.
//-----------------------------------------------------------------------------
void ScrollBar2Demo::OnSliderMoved()
{
	char number[6];
	sprintf (number, "%d", m_pScrollbar->GetValue());
	m_pScrollValue->SetText(number);
}