/** 
 * Program: SelectEventsFromCursor.js
 * Description: This script will select all the events on all tracks that are 
 *              under the cursor position and to the right of it.
 * Author: Johnny (Roy) Rofrano  john_rofrano at hotmail dot com
 * 
 * Date: March 24, 2004 
 *
 **/ 

import SonicFoundry.Vegas; 
import System.Windows.Forms;

try
{
	// step through all the tracks
	for (var track in Vegas.Project.Tracks) 
	{
		// Step through all events
		for (var evnt in track.Events) 
		{
			// Check to see if event is under or to the right of the cursor
			if (-1 == Vegas.Cursor.CompareTo(evnt.Start + evnt.Length))
			{
				evnt.Selected = true;
			}
		}
	}
}
catch (errorMsg)
{
	MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
