/*------------------------------------------------------------------------------*
 * File Name:NLParamBoundsDlg.h		 											*
 * Creation: Jasmine 11/12/2005													*
 * Purpose: Parameters Bounds of NLFit and FunctionOrganizer					*
 * Copyright (c) Originlab Corp.	2005, 2006, 2007, 2008, 2009, 2010			*
 * All Rights Reserved															*
 * 																				*
 * Modification Log:															*
 * Jasmine 11/23/06 GET_SETTING_FROM_PARA_SETTING_DLG							*
 * Jasmine 02/06/07 ALLOW_MEANING_COL_EDITING									*
 *	ML 11/7/2007 MORE_LOCALIZATION_WORK											*
 *	Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING	*
 *	Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU			*
 *	Kyle 11/07/2008 QA80-12509-P1 ADD_PEAK_AMPLITUDE_INTO_CONTROL_SESSION_OF_FO	*
 *	Kyle 01/15/2009 SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE				*
 *	Kyle 08/06/2009 QA80-14077 ADD_UNIT_FOR_PARAMETER_SETTINGS					*
 *	Jasmine 07/19/10 ORG-486 NOT_ALLOW_USER_EDIT_TO_PREVENT_WRONG_STRING		*
 *	Jasmine 07/21/10 ORG-598-P2 FUNCTION_IS_IN_CONSTRUCTION_SO_NO_NEED_CHECK_COMPILE_OC
 *------------------------------------------------------------------------------*/

/// ML 11/7/2007 MORE_LOCALIZATION_WORK
//#define STR_DLG_NAME	STR_FUNC_PARAMETERS_SETTINGS//"NL Parameters Bounds"
#define STR_DLG_NAME	_L("Parameter Settings")
/// end MORE_LOCALIZATION_WORK

enum {NLF_NORMAL_SETTING_TAB, NLF_PBOUND_SETTING_TAB};

///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
//class FOParamSetting : public NLFitParamsControl
class FOParamSetting : public NLFParamsControl
///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
{
public:
	///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	//FOParamSetting() : NLFitParamsControl()
	FOParamSetting() : NLFParamsControl()
	///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	{		
		m_bCheck = false;
		///Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
		//loadNormalShow(m_vnNormalSettingsShow);
		//loadBoundShow(m_vnParaBoundsShow);
		///End MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
		/// Iris  02/13/2007 v8.0561 NOT_AUTO_RUN_PARAMS_INIT_IN_FO_PARAMS_GRID
//----- CPY 3/1/2007 DEV80OP_COMPILE_CRASH_WITH_FOParamSetting
// better do this later
//		m_NLFitSession.SetAutoInitParams(false);
//-----
		///end NOT_AUTO_RUN_PARAMS_INIT_IN_FO_PARAMS_GRID
	}
	~FOParamSetting()
	{
	}
	///---Jasmine 05/18/10 ORG-2 CHANGE_DLG_TYPE_FOR_PROPERTY_PAGE
	//void Init(int nID, Dialog& dlg,LPCSTR lpcszDlgName)//, const string& strRegForDlgInfo, int nMakePlotExVal, int nXErrID, int nPosNegErrID, int naddRowToParamterCntrNumForX, int nPageNames, int nShowAllCols)
	void Init(int nID, WndContainer& dlg,LPCSTR lpcszDlgName)
	///---
	{
		//----- CPY 3/1/2007 DEV80OP_COMPILE_CRASH_WITH_FOParamSetting
		// moved from constructor to here
		m_NLFitSession.SetAutoInitParams(false);
		//-----
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//NLFitParamsControl::Init(nID, dlg, lpcszDlgName);
		SetNLParamsMngr(m_NLFitSession.GetNLParamsMngr());
		NLFParamsControl::Init(nID, dlg, lpcszDlgName);
		///Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
		//vector<int> vnParamValsColList, vnBoundsColList;
		//initGroupColList(GROUP_NORMAL, vnParamValsColList);
		//initGroupColList(GROUP_BOUNDS, vnBoundsColList);
//
		//AddGroup(vnParamValsColList);
		//AddGroup(vnBoundsColList);
		vector<uint> vnDefaultShows;
		vector<int> vnColList;
		initGroupColList(0, vnColList);
		vnDefaultShows.SetSize(vnColList.GetSize());
		vnDefaultShows = 1;
		AddGroup(vnColList, vnDefaultShows);
		///END MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		SetVisible(true);
	}
	///Kyle 01/15/2009 SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
	//bool SetTree(TreeNode &trFunct)
	bool SetTree(TreeNode &trFunct, int* pnErrorCode = NULL)
	{
		///Kyle 01/15/2009 SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
		//constructParamsTree(trFunct, m_trParameter);
		//
		////LinkFunctionTreeToFitFunction(m_trParameter);			///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//return true;
		return constructParamsTree(trFunct, m_trParameter, pnErrorCode);
		///End SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
	}
	///Kyle 01/15/2009 SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
	//bool constructParamsTree(TreeNode &trFunct, TreeNode &trParams)
	bool constructParamsTree(TreeNode &trFunct, TreeNode &trParams, int* pnErrorCode = NULL)
	///End SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
	{
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//m_NLFitSession.SetFunction(trFunct);
		//trParams = m_NLFitSession.GetSessionTree().GetNode(STR_PARAM_SETTING);
		string strFuncName, strFDFname;
		nlf_get_func_names( trFunct, strFuncName, strFDFname);
		///Kyle 01/15/2009 SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
		//m_NLFitSession.SetFunction( trFunct, 1, false, strFuncName);
		///Jasmine 07/21/10 ORG-598-P2 FUNCTION_IS_IN_CONSTRUCTION_SO_NO_NEED_CHECK_COMPILE_OC
		//if(!m_NLFitSession.SetFunction(trFunct, 1, false, strFuncName, NULL, 0, NULL, pnErrorCode))
			//return false;			
		if(pnErrorCode)
			*pnErrorCode = CER_NO_ERROR;
		NLParametersManager	*pNLParamsMngr = m_NLFitSession.GetNLParamsMngr();
		pNLParamsMngr->OnAfterResetNLFit();						
		if ( pNLParamsMngr->SetOneFunc(strFDFname, trFunct, strFuncName, NULL, 0) )
		{
			if(pnErrorCode)
				*pnErrorCode = XFERR_FAIL_SET_FUNCTION;
			return error_report("SetFunction error");
		}
		m_NLFitSession.SetParamByFDFSettings(0);
		///End FUNCTION_IS_IN_CONSTRUCTION_SO_NO_NEED_CHECK_COMPILE_OC
			
		///End SETFUNCTION_ADD_ARGUMENT_TO_OUTPUT_ERROR_CODE
		///Sophy 6/24/2010 ORG-344-P1 FFW_PARAMETER_AUTOINIT_SETTINGS_NOT_UPDATE_INTO_SESSION
		bool bAutoInit = false;
		nlf_is_auto_init_params(trFunct, bAutoInit);
		m_NLFitSession.SetAutoInitParams(bAutoInit);
		///end FFW_PARAMETER_AUTOINIT_SETTINGS_NOT_UPDATE_INTO_SESSION
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		return true;
	}
	bool GetTree(TreeNode &trFunc)
	{
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//Tree trParams;
		//trParams = GetParamTree();
		//if(!m_NLFitSession.SetParams(trParams))
			//error_report("SetParams fails in GetTree");
		//m_NLFitSession.UpdateParamSettings();
		//trFunc = m_NLFitSession.GetSessionTree();
		trFunc = m_NLFitSession.GetTreeFDFModified();
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		///Jasmine 07/14/10 ORG-486-S1 CENTRALIZE_PEAK_ATTRIB_TO_NLFIT
		set_duplicate_unit_for_peak_fit(trFunc, !m_bCheck);
		if(m_bCheck)
		{
			vector<string> vsPeakAttributes;
			GetColValues(NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE, vsPeakAttributes, GetRowOffset());
			write_peak_attributes_to_tree(vsPeakAttributes, trFunc);
		}
		///End CENTRALIZE_PEAK_ATTRIB_TO_NLFIT
		return true;
	}
	bool ShowSettings(int nSelTab)
	{
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//switch(nSelTab)
		//{
		//case NLF_NORMAL_SETTING_TAB:
			//ShowNormalSettings();
			//break;
		//case NLF_PBOUND_SETTING_TAB:
			//ShowParaBounds();
			//break;
		//default :
			//return false;
		//}		
		SetShowCols(nSelTab);
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		return true;		
	}
	///Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
	//bool ShowNormalSettings()
	//{
		//m_nCurShowTab = NLF_NORMAL_SETTING_TAB;
		//for(int nI =GetColOffset(); nI < m_vnNormalSettingsShow.GetSize() - GetColOffset(); nI++)
			//HideCol(nI, m_vnNormalSettingsShow[nI-GetColOffset()]);
		//return true;
	//}
	//bool ShowParaBounds()
	//{
		//m_nCurShowTab = NLF_PBOUND_SETTING_TAB;
		//for(int nI =GetColOffset(); nI < m_vnParaBoundsShow.GetSize() - GetColOffset(); nI++)
			//HideCol(nI, m_vnParaBoundsShow[nI-GetColOffset()]);
		//return true;
	//}
	///End MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
	
	void OnBeforeEditParaControl(Control cntrl, long nRow, long nCol, BOOL* pCancel)
	{
		///Jasmine 02/06/07 ALLOW_MEANING_COL_EDITING
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//if(GRID_COL_MEANING == nCol && *pCancel))
		if(NLPARAMGRIDCOLTYPE_MEANING == nCol)
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
			return;
		///End ALLOW_MEANING_COL_EDITING
		
		///Kyle 08/06/2009 QA80-14077 ADD_UNIT_FOR_PARAMETER_SETTINGS
		if(NLPARAMGRIDCOLTYPE_UNIT == nCol)
			return;
		///End ADD_UNIT_FOR_PARAMETER_SETTINGS
		
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//NLFitParamsControl::OnBeforeEditParaControl(cntrl, nRow, nCol, pCancel);
		NLFParamsControl::OnBeforeEditParaControl(cntrl, nRow, nCol, pCancel);
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//if(GRID_COL_MEANING == nCol)
		//if(NLPARAMGRIDCOLTYPE_MEANING == nCol)
		if(NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE == nCol)///Jasmine 07/14/10 ORG-486-S1 CENTRALIZE_PEAK_ATTRIB_TO_NLFIT
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		{
			string strPeakInfoLilst = "";
			
			if(m_bCheck)
			{
				///Jasmine 07/19/10 ORG-486 NOT_ALLOW_USER_EDIT_TO_PREVENT_WRONG_STRING
				if(GetRowOffset() < nRow)//not allow change offsett parameter
				{
					int nDeps, nIndeps;
					m_NLFitSession.GetNumVars( &nDeps, &nIndeps);
					
					strPeakInfoLilst = ConstructPeakAttributeString(GetRowOffset() == nRow, nIndeps>1);
					
					if(pCancel)
						*pCancel = false;
				}
				else if(pCancel)
					*pCancel = true;
					
				///End NOT_ALLOW_USER_EDIT_TO_PREVENT_WRONG_STRING
			}
			
			///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
			//m_flx.ColComboList(GRID_COL_MEANING) = strPeakInfoLilst;		
			//SetColComboList(NLPARAMGRIDCOLTYPE_MEANING, strPeakInfoLilst);		
			SetColComboList(NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE, strPeakInfoLilst);	///Jasmine 07/14/10 ORG-486-S1 CENTRALIZE_PEAK_ATTRIB_TO_NLFIT
			///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
			
			///End NOT_ALLOW_USER_EDIT_TO_PREVENT_WRONG_STRING
		}		
	}
	///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	//void OnBeforeMouseDown(Control cntrl, short nButton, short nShift, float X, float Y, BOOL* pCancel)
	//{
		//int nRow = m_flx.MouseRow;
		//int nCol = m_flx.MouseCol;
		//if(MK_RBUTTON == nButton && 0 == nShift)
		//{
			//int nx = XTwipsToPixels(X);
			//int ny = YTwipsToPixels(Y);
			//ClientToScreen(nx, ny);
			////printf("nx = %d, ny = %d\n", nx, ny);
			//NLFParametersControlMenu	myMenu( IsInGrid(nRow, nCol));
			//myMenu.TrackPopupMenu(0,  nx, ny, GetDlgSafeHwnd());
			//int nCmd;
			//if(myMenu.GetCommand(nCmd))
			//{
				//switch(nCmd)
				//{
				//case NLFPCMENU_HIDE:
					//if(m_nCurShowTab == NLF_NORMAL_SETTING_TAB)
						//m_vnNormalSettingsShow[nCol] = 1;
					//else
						//if(m_nCurShowTab == NLF_PBOUND_SETTING_TAB)
							//m_vnParaBoundsShow[nCol] = 1;
						//
					//HideCol(nCol);
					//break;
				//case NLFPCMENU_SHOW_ALL:
					//if(m_nCurShowTab == NLF_NORMAL_SETTING_TAB)
						//loadNormalShow(m_vnNormalSettingsShow);
					//else
						//if(m_nCurShowTab == NLF_PBOUND_SETTING_TAB)
							//loadBoundShow(m_vnParaBoundsShow);
					//ShowSettings(m_nCurShowTab);
					//break;
				//}
			//}
			//return;
		//}
	//}
	///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	bool Update()
	{
		///Jasmine 11/06/06 
		///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//TreeNode trPara = m_trParameter.GetNode("Names");//m_trParameter.FirstNode;
		//int nCount;
		//vector<string> vs ;
		//vs = trPara.strVals;
		//nCount = vs.GetSize();
		//return NLFitParamsControl::Update(nCount, 0);
		return NLFParamsControl::Update( m_NLFitSession.IsAllowSharing() );
		///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	}
	bool OnPeakFuncCheck(bool bCheck)
	{
		m_bCheck = bCheck;		
		
		HideCol(NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE, !m_bCheck);
		///Jasmine 07/19/10 ORG-486 NOT_ALLOW_USER_EDIT_TO_PREVENT_WRONG_STRING
		if(m_bCheck)
		{
			string strTemp = GetCell(GetRowOffset(), NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE);
			if( strTemp.IsEmpty() )
				SetCell(GetRowOffset(), NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE, STR_OFFSET_PEAK_INFO);
		}
		///End NOT_ALLOW_USER_EDIT_TO_PREVENT_WRONG_STRING
		return true;
	}
private:
	///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	// virtual
	void initGroupColList(int nGroup, vector<int>& vnColLists)
	{
		///Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
		//vector<int> vnNormal = {	NLPARAMGRIDCOLTYPE_NAME, NLPARAMGRIDCOLTYPE_MEANING, NLPARAMGRIDCOLTYPE_FIXED,
									//NLPARAMGRIDCOLTYPE_VALUE, NLPARAMGRIDCOLTYPE_SD};
				//
		//vector<int> vnBounds = {	NLPARAMGRIDCOLTYPE_LB, NLPARAMGRIDCOLTYPE_LB_CONTROL, NLPARAMGRIDCOLTYPE_NAME_DUP, 
									//NLPARAMGRIDCOLTYPE_UB_CONTROL, NLPARAMGRIDCOLTYPE_UB};
		//switch(nGroup)
		//{
		//case GROUP_NORMAL:	
			//vnColLists = vnNormal;
			//break;
		//case GROUP_BOUNDS:
			//vnColLists = vnBounds;
			//break;
		//case GROUP_ALL:
		//default:
			//vnColLists.Data(NLPARAMGRIDCOLTYPE_PEAK_NO, NLPARAMGRIDCOLTYPE_UB, 1);
			//break;
		//}		
		///Kyle 08/06/2009 QA80-14077 ADD_UNIT_FOR_PARAMETER_SETTINGS
		//vector<int> vn = {	NLPARAMGRIDCOLTYPE_NAME, NLPARAMGRIDCOLTYPE_MEANING, NLPARAMGRIDCOLTYPE_FIXED,
		vector<int> vn = {	NLPARAMGRIDCOLTYPE_NAME, NLPARAMGRIDCOLTYPE_UNIT, NLPARAMGRIDCOLTYPE_MEANING, NLPARAMGRIDCOLTYPE_FIXED,
		///End ADD_UNIT_FOR_PARAMETER_SETTINGS
							NLPARAMGRIDCOLTYPE_VALUE, NLPARAMGRIDCOLTYPE_SD, 
							NLPARAMGRIDCOLTYPE_LB, NLPARAMGRIDCOLTYPE_LB_CONTROL, NLPARAMGRIDCOLTYPE_NAME_DUP, 
							NLPARAMGRIDCOLTYPE_UB_CONTROL, NLPARAMGRIDCOLTYPE_UB,
							NLPARAMGRIDCOLTYPE_PEAK_ATTRIBUTE};///Jasmine 07/14/10 ORG-486-S1 CENTRALIZE_PEAK_ATTRIB_TO_NLFIT
		vnColLists = vn;
		///End MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU

	}
	///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	///Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
	//void loadNormalShow(vector<uint> &vn)
	//{
		/////Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		////vector<uint> vnIndex = {GRID_COL_NAME, GRID_COL_MEANING, GRID_COL_FIXED,
								////GRID_COL_VALUE, GRID_COL_SIGN_DIGITES};
		//vector<uint> vnIndex = {NLPARAMGRIDCOLTYPE_NAME, NLPARAMGRIDCOLTYPE_MEANING, NLPARAMGRIDCOLTYPE_FIXED,
								//NLPARAMGRIDCOLTYPE_VALUE, NLPARAMGRIDCOLTYPE_SD};
		/////End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//vn.RemoveAll();
		/////Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		////vn.SetSize(GRID_COL_TOTAL);
		//vn.SetSize(NLPARAMGRIDCOLTYPE_TOTAL);
		/////End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//vn = 1;
		//for(int n=0; n< vnIndex.GetSize(); n++)
			//vn[vnIndex[n]] = 0;
	//}
	//void loadBoundShow(vector<uint> &vn)
	//{
		/////Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		////vector<uint> vnIndex = {//GRID_COL_NAME, GRID_COL_MEANING, //GRID_COL_CONSTRAINTS,	///Jasmine 11/23/06 GET_SETTING_FROM_PARA_SETTING_DLG
								////GRID_COL_LB, GRID_COL_LB_CONTROL, GRID_COL_NAME_DUP, 
								////GRID_COL_UB_CONTROL, GRID_COL_UB};
		//vector<uint> vnIndex = {	NLPARAMGRIDCOLTYPE_LB, NLPARAMGRIDCOLTYPE_LB_CONTROL, NLPARAMGRIDCOLTYPE_NAME_DUP, 
									//NLPARAMGRIDCOLTYPE_UB_CONTROL, NLPARAMGRIDCOLTYPE_UB};
		/////End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//vn.RemoveAll();
		/////Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		////vn.SetSize(GRID_COL_TOTAL);
		//vn.SetSize(NLPARAMGRIDCOLTYPE_TOTAL);
		/////End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
		//vn = 1;
		//for(int n=0; n< vnIndex.GetSize(); n++)
			//vn[vnIndex[n]] = 0;
	//}
	///End MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
public:
private:
	Tree 			m_trParameter;
	//TreeNode 		m_trFunctDetail;
	///Kyle 11/06/2008 MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
	//vector<uint>	m_vnNormalSettingsShow;
	//vector<uint> 	m_vnParaBoundsShow;
	///End MERGE_TWO_TABS_TO_ONE_AND_NOT_SHOW_SHORT_CUT_MENU
	int				m_nCurShowTab;
	///Kyle 11/04/2008 USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	//NLFitSession	m_NLFitSession;
	NLFitSession 		m_NLFitSession;
	///End USE_NEW_NLFSESSION_AND_GRIDCONTROL_FOR_FO_PARAMS_SETTING
	bool 			m_bCheck;
};
