#if !defined(AFX_CATEGORYDIFFDLG_H__C0BBE9C0_7960_498D_8721_41BD5A9C4FD2__INCLUDED_)
#define AFX_CATEGORYDIFFDLG_H__C0BBE9C0_7960_498D_8721_41BD5A9C4FD2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CategoryDiffDlg.h : header file
//
#include "stdafx.h"
#include "resource.h"
#include "ResizableDialog.h" 
#include "apl_api.h"
#include <apl_gui.h>
/////////////////////////////////////////////////////////////////////////////
// CCategoryDiffDlg dialog

class CCategoryDiffDlg : public CResizableDialog
{
// Construction
public:
	CCategoryDiffDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CCategoryDiffDlg)
	enum { IDD = IDD_CATEGORY_HISTORY_DIALOG };
	CStatic	m_ListFrame;
	CSortListCtrl m_ListCategoryDiff;
	//}}AFX_DATA

	CaplAPI*		m_api;
	CaplInstance*	m_inst;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCategoryDiffDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	BOOL FillTable(void);
	BOOL AddListColumns(void);
	BOOL SetControlsAnchors(void);
	BOOL SetControlsPositions(void);

	BOOL SortVersions(	aplExtent& aplUnsorted, aplExtent& aplSorted);
	
	BOOL AddProductId(		CaplInstance* caplIns, int& iRow);
	BOOL AddProductName(	CaplInstance* caplIns, int& iRow);

	BOOL AddInsVersionNo(	CaplInstance* caplIns, int& iRow);
	BOOL AddInsAuthor(		CaplInstance* caplIns, int& iRow);
	BOOL AddInsDate(		CaplInstance* caplIns, int& iRow);

	BOOL AddDelAuthor(		CaplInstance* caplIns, int& iRow);
	BOOL AddDelDate(		CaplInstance* caplIns, int& iRow);
	BOOL AddDelVersionNo(	CaplInstance* caplIns, int& iRow);



	enum
		{
			ColProductId=0,
			ColProductName,
			ColInsAuthor,ColInsDate,ColInsVersionNo,
			ColDelAuthor,ColDelDate,ColDelVersionNo,
			
			ColLastColumn=ColDelVersionNo,
			ColFirstColumn=ColProductId
		};

	TCHAR*	cColNames[8];
	int		iColSizes[8];


	// Generated message map functions
	//{{AFX_MSG(CCategoryDiffDlg)
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CATEGORYDIFFDLG_H__C0BBE9C0_7960_498D_8721_41BD5A9C4FD2__INCLUDED_)
