#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>
enum{
	execute_get,
	execute_set,
};
//put additional include files here
#include <../OriginLab/Wks_Utils.h>
//put your own support static functions here



void wproperties(const Worksheet& iw, const int& execute, TreeNode& iotrgui)
{
	if ( !iw || !iotrgui)
		return;
	
	if (execute == execute_get)
	{
		iotrgui.Reset();
		construct_wks_properties_tree(iw, iotrgui);
		get_wks_setting(iw, iotrgui);
	}
	else
	{
		string strOldValue;
		Tree tr;
		construct_wks_properties_tree(iw, tr);
		get_wks_setting(iw, tr);
		/// TD 01-05-2008 QA80-12470 LT_INVOKE_Worksheet_Properties_dialog
		//set_wks_setting(iw, tr, iotrgui);
		set_wks_setting(iw, tr, iotrgui, false);
		/// end LT_INVOKE_Worksheet_Properties_dialog
	}
}

//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 wproperties_before_execute(TreeNode& trGetN, int nGetNDialog, int& nRet, int dwCntrl)
{
	//if ( nGetNDialog > -1 )
	//{
		//Worksheet iw;
		//okxf_resolve_string_get_origin_object(trGetN.iw.strVal, &iw);
		//if (!iw)
		//{
			//nRet = XFEVT_ABORT;
			//warning_msg_box(CER_NO_WORKSHEET, true);
		//}
	//}
}
