// 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
int OpenAbiComDlg(int fHelpComm);

int OpenAbiComDlg(int fHelpComm)
{ 
	int nYesNo; 
	
   	CAbiComDlg abiComDlg(fHelpComm);
   	nYesNo = abiComDlg.DoModal();
    return nYesNo;
}

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_BN_CLICKED(ID_RELINK, OnRelink)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


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

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);
	
}
