#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>
#include <origin.h>
#include	<operation.h>
#include <xfutils.h>
//put additional include files here

//put your own support static functions here



void op_values(const int& bXfromY, const Range& source, Range& dest)
{
	//printf("Inside op_values():  bXfromY = %d\n", bXfromY);
	int		r1, c1, r2, c2;
	Worksheet	wks;
	
	/// Iris 02/01/2007 SHOULD_RETURN_IF_NOT_INPUT_DATA
	if( !source.GetRange(wks, c1, c2) )
		return;
	
	bool	bHasData = false;
	for(int cc = c1; cc <= c2; cc++)
	{
		Column 	col = wks.Columns(cc);
		int 	nUpper = col.GetUpperBound();
		if(nUpper >= 0)
			bHasData = true;
	}
	if(!bHasData)
		return;
	///end SHOULD_RETURN_IF_NOT_INPUT_DATA
		
	//if ( !dest.GetRange("X", r1, c1, r2, c2, wks) )
	//	return;
	if ( !dest.GetRange(wks, c1, c2) )
		return;
	
	int		nTblId;
	OperationBase	&op = wks.GetSrcOperation(0, c1, &nTblId);
	if (NULL == op)
		return;
	
	if ( !op.GetXFromYorYFromX(bXfromY, source, dest, nTblId) )
		;		// failed
	
	
}

//nGetNDialog = 0,1,2, corresponding to the XF GetN dropdown, 0 = dialog is not used
//you can change nRet to be one of XFEVT_PROCEED (defualt), XFEVT_ABORT, XFEVT_PROCEED_NO_DLG or XFEVT_PROCEED_WITH_DLG(when nGetNDialog = 0)
//nGetNDialog = -1 when Ok on GetN dialog to allow handler to preocess <auto> etc variables
//dwCntrl is combination of bits
//LTXF_FROM_GUI_MENU, LTXF_FROM_GUI_PROMPT, LTXF_FROM_AUTO_UPDATE, LTXF_FROM_FUNCTION, LTXF_THEME_USED, LTXF_CHANGE_PARAM
void op_values_before_execute(TreeNode& trGetN, int nGetNDialog, int& nRet, int dwCntrl)
{

}
