
/***************************************************************************
**
**    $Header:   D:/PICSLDV/SRC/LOG/PICINIT/ABICOM.CPP   1.14   09 Jan 1997 14:27:24   ZJRD  $
**
**    $Log:   D:/PICSLDV/SRC/LOG/PICINIT/ABICOM.CPP  $
** Initial revision.
** 
****************************************************************************/

// abicom.cpp : implementation file
//
//author: Frank Chang

#include "stdafx.h"
#include "abicom.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAbiComDlg dialog
#ifdef __cplusplus
extern "C" {
#endif	// __cplusplus
int WINAPI OpenAbiComDlg(int fHelpComm)
{ 
	int nYesNo; 
	
   	CAbiComDlg abiComDlg(fHelpComm);
   	nYesNo = abiComDlg.DoModal();
    return nYesNo;
}
#ifdef __cplusplus
}
#endif

CAbiComDlg::CAbiComDlg(int fHelp, CWnd* pParent /*=NULL*/)
    : CDialog(CAbiComDlg::IDD, pParent)
{
    //{{AFX_DATA_INIT(CAbiComDlg)                    
	//}}AFX_DATA_INIT
	m_fHelp = fHelp;
}

void CAbiComDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CAbiComDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAbiComDlg, CDialog)
    //{{AFX_MSG_MAP(CAbiComDlg)
	ON_WM_PAINT()
	ON_BN_CLICKED(ID_RELINK, OnRelink)
	ON_BN_CLICKED(IDOK, OnOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CAbiComDlg message handlers

void CAbiComDlg::OnPaint()
{
       /* CPaintDC dc(this); // device context for painting
	dc.SetBkMode(TRANSPARENT);
	dc.TextOut(12,16, "Please Check these items:"); 
	dc.SetTextColor(RGB(0,255,0));
	
	dc.TextOut(11,15, "Please Check these items:"); 

	dc.MoveTo(15, 200); 
	dc.SelectStockObject(WHITE_PEN);
	dc.LineTo(250, 200); 
	dc.LineTo(250, 40);
	dc.SelectStockObject(BLACK_PEN);
	dc.LineTo(15,40); 
	dc.LineTo(15, 200);       
	
//	dc.SelectObject(&m_redPen);
	dc.SelectObject(&m_brush);
	dc.Ellipse(23, 52, 31, 60);   
	dc.Ellipse(23, 70, 31, 78);   
	dc.Ellipse(23, 107, 31, 115);   
	dc.Ellipse(23, 127, 31, 135);   
   	dc.Ellipse(23, 147, 31, 155);   
  	dc.Ellipse(23, 167, 31, 175);   

        // TODO: Add your message handler code here
	                                               */
        CDialog::OnPaint();
}

BOOL CAbiComDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//m_redPen.CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
	//m_greyPen.CreatePen(PS_SOLID, 2, RGB(0, 0, 0));

//	RECT rect;
//	GetWindowRect(&rect);
	
//    MoveWindow(150, 150, 
//    	rect.right-rect.left, rect.bottom-rect.top, TRUE);
    CenterWindow();
	
//    m_brush.CreateSolidBrush(RGB(255,0,0));

    
    if (m_fHelp == 0) {
    	GetDlgItem(ID_RELINK)->EnableWindow(FALSE);
    	GetDlgItem(IDOK)->EnableWindow(TRUE);
    }
    else {
    	GetDlgItem(ID_RELINK)->EnableWindow(TRUE);
    	GetDlgItem(IDOK)->EnableWindow(FALSE);
    }

	return TRUE;  // return TRUE  unless you set the focus to a control
}

void CAbiComDlg::OnRelink()
{
	// TODO: Add your control notification handler code here
	EndDialog(IDOK);
	
}

void CAbiComDlg::OnOk()
{
	// TODO: Add your control notification handler code here
	EndDialog(IDCANCEL);
}
