// varwnd.h : header file
// 
struct VARITEM
{                  
  BOOL  bDVar;
  BOOL  bPVar;
  char  lpItemT1[20];
  LPSTR *lpItem1;
  char  lpItemT2[20];
  LPSTR *lpItem2;
};
/////////////////////////////////////////////////////////////////////////////
// CVARListBox window

class CVARListBox : public CListBox
{
// Construction
public:
	CVARListBox();

// Attributes
public:
private:
   POINT   m_pointCaret;

// Operations
public:
virtual void MeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct);
// Implementation
private:

public:
	virtual ~CVARListBox();

protected:
	// Generated message map functions
	//{{AFX_MSG(CVARListBox)
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CVarWnd window

class CVarWnd : public CTWnd
{
// Construction
public:
	CVarWnd(UINT idMenu,UINT idSub,BOOL bTutorial,BOOL bSetByUser=TRUE);

// Attributes
public:
    CVARListBox *GetListVar(){return m_pListVar;};
private:
   VARITEM m_Var;
   CRect   m_TypeRect;
   CRect   m_AddressRect;
public:

// Operations
//for list
private:
   CBitmap *m_pBitOpen;
   CBitmap *m_pBitSOpen;
   CBitmap *m_pBitClose;
public:
BOOL AddItem(int nSnd);
void SetOpen(){OnLBNDBLClk();};
// Implementation
private:
void DrawStatus(CPaintDC &dc);
void DrawRectangle(CPaintDC &dc,CRect rect);
void WriteBarTitle(CPaintDC &dc,CRect rect,CRect AddressRect,CRect TypeRect);
BOOL FindItem(DRAWITEMSTRUCT dis,LPSTR lpText);
void SetStatus(BOOL bSet,BOOL bFisrt);
void UpdateItem(int nCSel);
private:         
    enum{IDD = 100};
    CVARListBox *m_pListVar;
    int m_nVar[21];
public:
	virtual ~CVarWnd();

protected:
	// Generated message map functions
	//{{AFX_MSG(CVarWnd)
	afx_msg int  OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	afx_msg void OnVariableAdd();
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnLBNDBLClk();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CVarAddDlg dialog

class CVarAddDlg : public CTDialog
{
// Construction
public:
	CVarAddDlg(CWnd* pParent = NULL,
	           BOOL bModal=1,
	           BOOL bChild=0,
	           BOOL bSetByUse=TRUE);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CVarAddDlg)
	enum { IDD = IDD_DIALOG_VAR_ADD_VARIABLE };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

// Implementation
public:
 void SetCombo();
 void SetOk();
private:
    CTComboBox *m_pAddVar;
    CTButton   *m_pOk;
protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

	// Generated message map functions
	//{{AFX_MSG(CVarAddDlg)
	virtual BOOL OnInitDialog();
	virtual void OnCancel();
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};
