#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>

///////////////////////////////////////////////////////////////////////
//////// modification log
/// Hong 05/18/09 QA80-13629 LT_FILE_DLG_ADD_DEFAILT_PATH_OPTION
///////////////////////////////////////////////////////////////////////
//put additional include files here

//put your own support static functions here



void dlgFile(string& fname, const string& group, const string& title, const int& multi, const string& init)
{
	
	//	if( !GetOpenBox(fname, group, NULL, NULL, title) )
	
	init_fdlog_with_group_name(group, NULL, NULL, title);
	
	int nType = (multi ? FDLOG_TYPE_MULTI_OPEN : FDLOG_TYPE_OPEN_SINGLE);
	StringArray saFileNames;
	/// Hong 05/18/09 QA80-13629 LT_FILE_DLG_ADD_DEFAILT_PATH_OPTION
	//if( GetFDLogBox(saFileNames, nType) )
	if( GetFDLogBox(saFileNames, nType, FALSE, init) )
	/// end LT_FILE_DLG_ADD_DEFAILT_PATH_OPTION
	{
		if( saFileNames.GetSize() > 1 )
			file_name_array_to_str(fname, saFileNames);
		else
			fname = saFileNames[0];
		return;
	}
	
	///Cheney 2007-5-30 UPDATE_XF_ERR_THROW
	//throw(XFERR_UI_USER_CANCEL);
	XF_THROW(XFERR_UI_USER_CANCEL);
	///end UPDATE_XF_ERR_THROW
}

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

}
