//-----------------------------------------------------------------------------
// Purpose: 
// Input  : exp - 
//-----------------------------------------------------------------------------
void mxExpressionTray::Select( int exp, bool deselect /*=true*/ )
{
	int oldcell = m_nCurCell;

	if ( deselect )
	{
		Deselect();
	}

	m_nPrevCell = oldcell;
	m_nCurCell = exp;

	if ( m_nCurCell >= 0 )
	{
		CExpClass *active = expressions->GetActiveClass();
		if ( active )
		{
			CExpression *exp = active->GetExpression( m_nCurCell );
			if ( exp )
			{
				exp->SetSelected( true );
			}
		}
	}

	redraw();
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void mxExpressionTray::Deselect( void )
{
	CExpClass *active = expressions->GetActiveClass();
	if ( active )
	{
		for ( int i = 0 ; i < active->GetNumExpressions(); i++ )
		{
			CExpression *exp = active->GetExpression( i );
			if ( exp )
			{
				exp->SetSelected( false );
			}
		}
	}

	m_nCurCell = m_nPrevCell = -1;
	redraw();
}