#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>
enum{
	hw_w,
	hw_h,
	hw_b,
};

////////////// modification log ////////////////
//---- CPY 12/16/2007 moved autosize_rowcol from wksOperation to page_utils
//---- CPY 3/7/08 WAUTOSIZE_ALLOW_SEL_ROW_COL
//---- CPY 5/5/09 QA70-8941 AUTOSIZE_CODE_CENTRALIZING


void wautosize(const Worksheet& iw, const double& cw1, const double& cw2, const double& rh1, const double& rh2, const int& hw, const int& mw, const int& mh, const int& limit)
{
	if (!iw)
	/// Cloud 7/12/07 UPDATE_XF_ERR_THROW
	//	XF_THROW(CER_NO_WORKSHEET);
	{
		warning_msg_box(CER_NO_WORKSHEET, false, 'E');
		return;
	}
	/// End UPDATE_XF_ERR_THROW
	//---- CPY 3/7/08 WAUTOSIZE_ALLOW_SEL_ROW_COL
	/*
	autosize_rowcol(iw, cw1, cw2, rh1, rh2);
	//----- CPY 12/16/2007
	//LT_execute("Clr;");	// REFRESH_ACTIVE_WINDOW
	iw.Invalidate();
	//-----
	*/
	DWORD dwCntrl = AS_INVALIDATE;
	if(hw == hw_w)
		dwCntrl |= AS_NOHEIGHT;
	else if(hw == hw_h)
		dwCntrl |= AS_NOWIDTH;
	//---- CPY 5/5/09 QA70-8941 AUTOSIZE_CODE_CENTRALIZING	
	//autosize_rowcol(iw, cw1, cw2, rh1, rh2, dwCntrl, mh, mw);
	autosize_rowcol(iw, cw1, cw2, rh1, rh2, dwCntrl, mh, mw, limit);
	//----
	//---- end WAUTOSIZE_ALLOW_SEL_ROW_COL
	
	
}

//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 wautosize_before_execute(TreeNode& trGetN, int nGetNDialog, int& nRet, int dwCntrl)
{

}
