#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>
enum{
	location_all,
	location_exe,
	location_group,
	location_user,
	location_custom,
	location_project,
};
#include <origin.h>
//put additional include files here

//put your own support static functions here



void ux(const int& location)
{
		// All=0|Exe|Group|User|Custom|Project
		int nPathType;
		if(ORIGIN_PATH_UNDEF+1<location && location<=ORIGIN_PATH_TYPE_END+1)// note: ORIGIN_PATH_UNDEF=-1.  
		   nPathType = ORIGIN_PATH_TYPE_END-location+1;
		else// out of bounds location
		   nPathType = ORIGIN_PATH_UNDEF;
		
		string strMsg= "Updating x-function list in ";
		if(0==location)
			strMsg += "all locations.";
		else if(1==location)
			strMsg += "sytem folder.";
		else if(2==location)
			strMsg += "group folder.";
		else if(3==location)
			strMsg += "user folder.";
		else if(4==location)
			strMsg += "custom folder.";
		else if(5==location)
			strMsg += "project folder.";
		else// out of bounds location
			strMsg += "all locations.";
			
		/// Iris 10/21/2010 ORG-1303 CLEANUP_XFS_ERROR_CODE
		//out_str(strMsg);
		warning_msg_box(strMsg, false, 'R');
		///End CLEANUP_XFS_ERROR_CODE
		
		list_x_functions("", "u", NULL, nPathType, 0x0, "");
}

//nEventID < 0 on event, like GETNE_ON_INIT, GETNE_ON_OK etc, >0 on change from control
//return 0 to do nothing, return PEVENT_GETN_RET_TO_CLOSE to close dialog
//dwEnables = bOKEnable, bBTN1Enable, bBTN2Enable, bBTN3Enable, , can set to false to disable OK/Apply buttons
//lpcszNodeName = the trGetN TreeNode tag name that generates the event, or is  if GETNE_ON_OK etc
//strAux = optional string for XF Wizard Bar, like DLG_NEED_CHANGE_GRID etc, it will be invalid if from internal node value change event
//strErrMsg = allowing messages to be shown
int ux_event1(TreeNode& trGetN, int nRow, int nEventID, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& DynaCntrlContainer, string& strAux, string& strErrMsg)
{
	if( xf_is_extended_event(nEventID) )
		return ux_event1_ex(trGetN, nRow, nEventID, dwEnables, lpcszNodeName, DynaCntrlContainer, strAux, strErrMsg);
	DECLARE_BUTTON_ENABLES
	return false;

}

int ux_make_tree(TreeNode& tr, LPCSTR lpcszVarName)
{
	return false;
}
//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 ux_before_execute(TreeNode& trGetN, int nGetNDialog, int& nRet, int dwCntrl)
{

}
//nEventID < 0 on event, like GETNE_ON_INIT, GETNE_ON_OK etc, >0 on change from control
//return 0 to do nothing, return PEVENT_GETN_RET_TO_CLOSE to close dialog
//dwEnables = bOKEnable, bBTN1Enable, bBTN2Enable, bBTN3Enable, , can set to false to disable OK/Apply buttons
//lpcszNodeName = the trGetN TreeNode tag name that generates the event, or is  if GETNE_ON_OK etc
//strAux = optional string for XF Wizard Bar, like DLG_NEED_CHANGE_GRID etc, it will be invalid if from internal node value change event
//strErrMsg = allowing messages to be shown
int ux_event1_ex(TreeNode& trGetN, int nRow, int nEventID, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& DynaCntrlContainer, string& strAux, string& strErrMsg)
{
	return false;
}
