/*------------------------------------------------------------------------------*
 * File Name: ImpWizHeadVariables.h												*
 * Creation: Jacky 12/14/2003													*
 * Purpose: Origin C file containing Application Utilities						*
 * Copyright (c) OriginLab Corp.	2002-2007									*
 * All Rights Reserved															*
 * 																				*
 * Modification Log:															*
 * Danice 12/23/03 v7.5786 INIT_LOCAL											*
 * Danice 12/25/03 v7.5788 NOTUSE_SHOW                                          *
 * Jason  12/26/03 v7.5789 USE_M_REHDRLINES										*
 * Danice 12/26/03 v7.5789 PUT_FUNCTION_TO_SHEET								*
 * Jacky  12/28/03 v7.5788 USE_M_CBLASTLINE                                     *
 * Danice 1/16/04 v8.0800 NEW_ACCESS_METHOD_GET_POINTER							*
 * Danice 2/12/04 v8.0819 CHANGE_GRID_TO_CLASS									*
 * Danice 2/16/04 v8.0821 ADD_SOME_ACCESS_FUNCTION								*
 * Danice 3/1/04 v8.0828 PAGE_INIT_ONCE											*
 * Danice 3/29/04 v8.0844b CHANGE_PARA_ORDER_ROW_COL							*
 * EJP 10/01/2004 QA70-5658 v8.0143 IMPROVE_HDRVAR_EXTRACTION					*
 *------------------------------------------------------------------------------*/
 
/// EJP 10/01/2004 QA70-5658 v8.0143 IMPROVE_HDRVAR_EXTRACTION
///#define ON_PAGE_CHECK_ASC_HEADER_PARAM		if(!IS_SHOW_ASC_HEADER_PARAM_PAGE) return FALSE;
#define ON_PAGE_CHECK_ASC_HEADER_PARAM		if(!IsShowPage()) return FALSE;
/// end IMPROVE_HDRVAR_EXTRACTION

enum {
	ASCHDR_VARCOL_NAME=0,
	ASCHDR_VARCOL_VALUE,
	ASCHDR_TOTAL_COLS
};

enum {
	DELIMITER_EQUAL=0,
	DELIMITER_COMMA,
	DELIMITER_TAB,
	DELIMITER_SPACE,
	DELIMITER_COLON,
	DELIMITER_OTHER
};

///Danice 2/12/04 v8.0819 CHANGE_GRID_TO_CLASS
class ASCHdrVarList : public GridListControl
{
public:
	ASCHdrVarList();

	void Init(int nID, WndContainer& dlg);
	
	void UpdateGrid(string strFileName, Tree& trFilter);
};
///END CHANGE_GRID_TO_CLASS

/// EJP 10-06-2004 QA70-5658 v8.0144 IMPROVE_HDRVAR_EXTRACTION
///class ImpWizHeadVariablesPage : public ImpWizardPage
class ImpWizHeadVariablesPage : public ImpWizAscPage
/// end IMPROVE_HDRVAR_EXTRACTION
{
public :
	EVENTS_BEGIN
		////////////////////////////////////////////////////////////////////////
		// ASCII Header Variables Page
		////////////////////////////////////////////////////////////////////////
		//PAGE_ON_IS_SHOW(OnIsShow_AscHdrVar)		///Danice 12/25/03 v7.5788 NOTUSE_SHOW
		PAGE_ON_INIT(OnInit)
		PAGE_ON_ACTIVE(OnActive_AscHdrVar)
		PAGE_ON_KILLACTIVE(OnKillActive_AscHdrVar)
	
		ON_CBN_SELCHANGE(IDC_HDRVAR_FIRSTLINE, OnSelChangeFirstLine_AscHdrVar)
		//ON_TOOLBAR_BN_CLICKED(IDB_ASCHDRVAR_LINESREFRESH, OnClickRefresh_AscHdrVar) /// EJP 08-04-2003 v7.0644 QA70-4896 ADD_REFRESH_BTN_TO_HDRVAR_PAGE
		ON_BN_CLICKED(IDC_ASCHDRVAR_LINESREFRESH_TBHLDR, OnClickRefresh_AscHdrVar)
		ON_CBN_SELCHANGE(IDC_HDRVAR_SEPARATOR, OnSelChangeSeparator_AscHdrVar)
		ON_BN_CLICKED(IDC_HDRVAR_SCAN, OnClickScan_AscHdrVar)
	EVENTS_END
	
	/// EJP 10/01/2004 QA70-5658 v8.0143 IMPROVE_HDRVAR_EXTRACTION
	///	///Danice 12/25/03 v7.5788 NOTUSE_SHOW
	///	BOOL OnIsShow_AscHdrVar(DWORD dwPageID, DWORD lParam)
	///	DWORD    OnShowStatus(DWORD InternalStatus)
	///	///END NOTUSE_SHOW
	BOOL IsShowPage();
	
	DWORD OnShowStatus(DWORD InternalStatus);
	/// end IMPROVE_HDRVAR_EXTRACTION

	void InitializeBitmapButtons();

	BOOL OnInit();
	
	BOOL OnActive_AscHdrVar();
	
	///Danice 12/26/03 v7.5789 PUT_FUNCTION_TO_SHEET
	///BOOL iw_SetGridFont(int iCtrl, int iFont);
	///END PUT_FUNCTION_TO_SHEET
	
	/// EJP 10-06-2004 QA70-5658 v8.0144 IMPROVE_HDRVAR_EXTRACTION
	/// This function moved to base class
	///int iwDataFileErrorMsgBox();
	/// end IMPROVE_HDRVAR_EXTRACTION
	
	BOOL	OnKillActive_AscHdrVar();
	
	BOOL	OnSelChangeFirstLine_AscHdrVar(Control ctrl);
	
	BOOL OnClickRefresh_AscHdrVar(Control ctrl);
	
	BOOL	OnSelChangeSeparator_AscHdrVar(Control ctrl);
	
	BOOL	OnClickScan_AscHdrVar(Control ctrl);
	
	void AscHdrVar_Update(bool bTreeToDlg=true);
	
	void AscHdrVar_UpdateGrid();
	
	void AscHdrVar_GetScanSettings(int &iFrom, int &iTo, int &iSeparator);
	
	void AscHdrVar_SetScanSettings(int iFrom, int iTo, int iSeparator);
	
private :
	//RichEdit 	m_reHdr;			///Jason 12/26/03 v7.5789 USE_M_REHDRLINES
	RichEdit 	m_reHdrLines ;
	
	Edit 		m_ebOther ;

	ComboBox 	m_cbLastLine;
	ComboBox 	m_cbFrom ;
	//ComboBox 	m_cbTo ;            ///Jacky  12/28/03 v7.5788 USE_M_CBLASTLINE
	ComboBox 	m_cbSeparator ;
	
	//Control 	m_ctrlVar ;			///Danice CHANGE_GRID_TO_CLASS

	/// EJP 10-06-2004 QA70-5658 v8.0145 IMPROVE_HDRVAR_EXTRACTION
	// Replace with IW_ASCIMP_PTR macro that references m_pSheet's m_ascimp member.
	/////ASCIMP	IW_ASCIMP_PTR ;	///Danice 1/16/04 v8.0800 NEW_ACCESS_METHOD_GET_POINTER
	///ASCIMP*		m_ascimp;
	/// end IMPROVE_HDRVAR_EXTRACTION

	string 		m_strAscHdrVarSeparators ;
	ASCHdrVarList	m_HdrVarList;	///Danice CHANGE_GRID_TO_CLASS
};