// Filename:    MASK.OGS
// Creation:    by Ree Migliozzi, 6/1/97
// Purpose:     Data Mask scripts
// Modifications:
// RB 8/5/98 t3693 v6.0127 MASK_TOOLS
// RB 10/30/98 t4403 v6.0134 SWAP_MASK_TO_COMPLEMENTARY_POINTS
// RB 11/19/98 v6.0139 t4517 REORGANIZE_MASK_TOOLS
// RB 5/11/99 CORRECT_GRAPH_SELECTION_CHECK
[Range]
///Select a range with the data reader to toggle the mask on/off
	//dotool 4;	
	//def PointProc {mark -wt;dotool 0;};
	//mark -wt;	 
	if (exist(%H)==3)
	{
		if ( (1 == @J) || (mks1 > -1) )
		{
			mark -w1;
			dotool 0;
			mks1=-1;
			clr;
		}
		else
		{
			dotool 4;
			def PointProc {mark -w1;dotool 0;mks1=-1;clr;};
		}
	}
	else if(exist(%H)==2)
	{
		mark -w1;		
		work -s;
	}
[Point]
///Select a point with the data reader to toggle the mask on/off
	def PointProc {mark -st %C -b index -e index;dotool 0;};
	dotool 3;	
	
[Color]
///Cycle mask colors through the color list
	@MC=(@MC>22?1:@MC+1);
	mark -u;		/// update all plots with mask init

[Analysis]
/// RB 11/19/98 v6.0139 t4517 REORGANIZE_MASK_TOOLS
/////Set the option to include/exclude/or use only the masked data
//	//@MM=ignore.choice-1;
//	@MM= %1 - 1;
//	mark -u;		/// update all plots with mask init
//
///Toggle the analysis option: ignore mask or not?
	if ( 0 == @MM )
		@MM=1;
	else  if ( 1 == @MM )
		@MM=0;
	mark -u;
/// end REORGANIZE_MASK_TOOLS
[Hide]
///Toggle the hide masked data option
	//@MP=hide.v1;
	if ( 0 == @MP )
		@MP=1;
	else  if ( 1 == @MP )
		@MP=0;
	mark -u;

[Destroy]
///Remove mask from series
	mark -sa %c;
/// RB 11/19/98 v6.0139 t4517 REORGANIZE_MASK_TOOLS
[Clear]
	//mark -wd %c;	// remove mask from current selection
	//HideMarker;
	//work -s;
	if (exist(%H)==3)  /* if graph */
	{
		if ( (1 == @J) || (mks1 > -1) )
		{
			mark -wd;
			dotool 0;
			mks1=-1;
			clr;
		}
		else
		{
			dotool 4;
			def PointProc {mark -wd;dotool 0;mks1=-1;clr;};
		}
	}
	else if(exist(%H)==2) /* if wks */
	{
		mark -wd;
		work -s;
	}
/// end REORGANIZE_MASK_TOOLS
/// RB 10/30/98 t4403 v6.0134 SWAP_MASK_TO_COMPLEMENTARY_POINTS
[Swap]
///Remove mask from masked points and mask unmasked points
	mark -sw %c;
	mark -u;
/// RB 11/19/98 v6.0139 t4517 REORGANIZE_MASK_TOOLS
//[Ignore]
///Toggle between "ignore" and "use" mask
//	mark -SI %c;
/// end REORGANIZE_MASK_TOOLS
/// end SWAP_MASK_TO_COMPLEMENTARY_POINTS
