
/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/ABOUT.CPP   1.8   20 Jun 1996 09:24:58   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/ABOUT.CPP  $
** 
**    Rev 1.8   20 Jun 1996 09:24:58   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.6   10 Jun 1996 10:19:38   ZJRD
** EasyPack/SLD Version 1.20
** 
**    Rev 1.4   29 May 1996 09:28:46   ZJRD
** EasyPack/SLD Version 1.95
** 
**    Rev 1.3   16 May 1996 09:06:02   ZJRD
** EasyPack/SLD Version 1.94
** 
**    Rev 1.2   10 May 1996 09:10:30   ZJRD
** EasyPack/SLD Version 1.93
** 
**    Rev 1.1   02 May 1996 10:28:10   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.31   18 Apr 1996 12:59:02   Shirley
** No change.
** 
**    Rev 1.30   12 Apr 1996 10:39:08   Shirley
** EasyPack/SLD Version 1.90
** 
**    Rev 1.28   15 Feb 1996 08:52:46   Shirley
** No change.
** 
**    Rev 1.27   12 Feb 1996 14:10:38   Shirley
** No change.
** 
**    Rev 1.26   06 Feb 1996 15:26:36   Shirley
** No change.
** 
**    Rev 1.25   06 Feb 1996 13:42:00   Shirley
** No change.
** 
**    Rev 1.24   01 Feb 1996 10:10:34   Shirley
** No change.
** 
**    Rev 1.23   26 Jan 1996 09:11:22   Shirley
** No change.
** 
**    Rev 1.22   25 Jan 1996 13:11:42   Shirley
** No change.
** 
**    Rev 1.21   24 Jan 1996 10:31:06   Shirley
** No change.
** 
**    Rev 1.20   23 Jan 1996 11:21:12   Shirley
** No change.
** 
**    Rev 1.19   18 Jan 1996 10:06:44   Shirley
** No change.
** 
**    Rev 1.18   15 Jan 1996 16:09:28   Shirley
** No change.
** 
**    Rev 1.17   04 Jan 1996 11:06:56   Shirley
** No change.
** 
**    Rev 1.16   30 Nov 1995 09:07:28   Shirley
** No change.
** 
**    Rev 1.15   28 Nov 1995 15:28:32   Shirley
** No change.
** 
**    Rev 1.14   21 Nov 1995 11:17:28   Shirley
** No change.
** 
**    Rev 1.13   13 Nov 1995 09:21:04   Shirley
** No change.
** 
**    Rev 1.12   12 Nov 1995 11:27:40   Shirley
** No change.
** 
**    Rev 1.11   08 Nov 1995 16:27:14   Shirley
** No change.
** 
**    Rev 1.10   08 Nov 1995 12:38:58   Shirley
** No change.
** 
**    Rev 1.9   02 Nov 1995 10:01:52   Shirley
** No change.
** 
**    Rev 1.8   27 Oct 1995 16:44:32   Shirley
** No change.
** 
**    Rev 1.7   27 Oct 1995 13:42:40   Shirley
** No change.
** 
**    Rev 1.6   25 Oct 1995 14:25:20   Shirley
** No change.
** 
**    Rev 1.5   18 Oct 1995 14:46:22   Shirley
** EasyPack/SLD Version 0.1e
** 
**    Rev 1.4   13 Oct 1995 13:18:18   Shirley
** No change.
** 
**    Rev 1.3   29 Sep 1995 09:47:42   Shirley
** No change.
** 
**    Rev 1.2   20 Sep 1995 10:52:26   Shirley
** No change.
** 
**    Rev 1.1   15 Sep 1995 09:43:32   Shirley
** No change.
** 
**    Rev 1.0   07 Sep 1995 09:53:18   Shirley
** Initial revision.
**
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
//
//  File name:  ABOUT.CPP
//
//  Description:The implement file for the class: CAboutDialog
//
//  Author:     Roger Zhang
//
//  Date:       03/05/95
//
//  Modification:
//
//      1. 03/05/95, Initial version 
//		2. 05/09/96, Add a bitmap button to the About box, Chen.
//
//
//  Copyright (C) 1995 Microtek International. All rights reserved.
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"
#include "xview.h"
                                                              
#include "uicom.h"                                                              
#include "about.h"

/////////////////////////////////////////////////////////////////////////////
// extern function for getting version information
void TstIdentify(CString &, CString &, CString &, CString &, CString &);

 
/////////////////////////////////////////////////////////////////////////////
//
//  Name:   CAboutDialog::CAboutDialog
//
//  Description: The constructor of the class CAboutDialog.
//
//  Input:  None
//
//  Output: None.
//
//  Return: None.
//
/////////////////////////////////////////////////////////////////////////////
CAboutDialog::CAboutDialog() : CDialog(CAboutDialog::IDD),
	m_bShowName(FALSE), m_uTimerID(0)
{
//	m_pTip = new CVBControl;
    //{{AFX_DATA_INIT(CAboutDialog)
    //}}AFX_DATA_INIT
}

CAboutDialog::~CAboutDialog()
{
//	m_pTip->DestroyWindow();
//	delete m_pTip;
}
	
/////////////////////////////////////////////////////////////////////////////
//
//  Name:   CAboutDialog::DoDataExchange
//
//  Description: Exchange data between local variables and dialog controls.
//
//  Input:  
//      pDX -- Pointer to CDataExchange
//
//  Output: None
//
//  Return: None
//
/////////////////////////////////////////////////////////////////////////////
void CAboutDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CAboutDialog)
	DDX_Control(pDX, IDC_LIST_ABOUT_NAME, m_listName);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDialog, CDialog)
    //{{AFX_MSG_MAP(CAboutDialog)
	ON_BN_DOUBLECLICKED(ID_TEST, OnDoubleclickedButtonAbout)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//	ON_VBXEVENT(VBN_SETCAPTION, IDC_MHTIP2, OnSetcaptionMhtip2)

/////////////////////////////////////////////////////////////////////////////
//
//  Name:   CAboutDialog::OnInitDialog
//
//  Description: Initilize dialog
//
//  Input:  None
//
//  Output: None
//
//  Return: FALSE -- Set focus to a control
//          TRUE  -- Let focus on first control
//
/////////////////////////////////////////////////////////////////////////////
BOOL CAboutDialog::OnInitDialog()
{
    CDialog::OnInitDialog();
    
    // TODO: Add extra initialization here
    CenterWindow();

  //  m_pTip->Create("MHTIP.VBX;MhTip;MhTip1", NULL, CRect(0, 0, 50, 20),
    //	this, IDC_MHTIP2);

    CString str;
    char szBuf[100];
    
    // Show Communication Information
    extern int nPortType;
    extern int nPortAddr;
    extern int nBaudRate;
                
    if(nPortType == 0)  str = "Parallel";
    else if(nPortType == 1) str = "LPT1";                
    else if(nPortType == 2) str = "LPT2";                
    else if(nPortType == 3) str = "LPT3";                
    SetDlgItemText(IDC_ABOUT_PORT, str);
    
    wsprintf(szBuf, "%03X", nPortAddr);    
    SetDlgItemText(IDC_ABOUT_ADDR, szBuf);
    
    wsprintf(szBuf, "%d", nBaudRate);    
    SetDlgItemText(IDC_ABOUT_BAUD, /*szBuf*/"NONE");        
    
    // Show version information                                              
    CString strDos, strWindows, strVer, strFWVer, strCPU;
                                                      
    TstIdentify(strCPU, strFWVer, strVer, strDos, strWindows);
    SetDlgItemText(IDC_ABOUT_VER, strVer);
    SetDlgItemText(IDC_ABOUT_CPU, strCPU);
    SetDlgItemText(IDC_ABOUT_DOS, strDos);
    SetDlgItemText(IDC_ABOUT_WINDOWS, strWindows);
    SetDlgItemText(IDC_ABOUT_FWVER, strFWVer);

	// Draw the bitmap.
	m_btnAbout.AutoLoad(ID_TEST, this);
	
	// Hide the list box.
	GetDlgItem(IDC_LIST_ABOUT_NAME)->ShowWindow(SW_HIDE);

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

/*
void CAboutDialog::OnSetcaptionMhtip2(UINT, int, CWnd*, LPVOID lpParams)
{
	
	char StrBuff[256];
	int StrBuffLen;
		
	StrBuffLen = ::GetWindowText((HWND)AFX_NUM_EVENTPARAMINDEX(int, lpParams, 3), StrBuff, 255);
	
	m_pTip->SetStrProperty("Caption", "ifuodiufg"StrBuff);
	m_pTip->ShowWindow(SW_SHOW);	
}
*/

void CAboutDialog::OnDoubleclickedButtonAbout() 
{
	// TODO: Add your control notification handler code here

	// Hide some cotrols.
	m_bShowName = !m_bShowName;
	if ( m_bShowName ) {
		GetDlgItem(IDC_LIST_ABOUT_NAME)->ShowWindow(SW_SHOW);
		
		// Show the engineers' names.
		m_listName.ResetContent();

		m_listName.AddString("EP/SLD Development Team: ");
		m_listName.AddString("");

		m_listName.AddString("Program Manager:");
		m_listName.AddString("Cheerson Jeng");
		m_listName.AddString("");

		m_listName.AddString("Manual Editor:");
		m_listName.AddString("Kathleen Zhow");
		m_listName.AddString("");

		m_listName.AddString("Test Engineers:");
		m_listName.AddString("Frank Chang");
		m_listName.AddString("Shirley Dong");
		m_listName.AddString("Cathy Yang");
		m_listName.AddString("Jeff Bing");
		m_listName.AddString("");

		m_listName.AddString("Hardware Engineers:");
		m_listName.AddString("Eric Deng");
		m_listName.AddString("Xu Shuqing");
		m_listName.AddString("Koo Gu");
		m_listName.AddString("");

		m_listName.AddString("Software Engineers:");
		m_listName.AddString("Richard Guo");
		m_listName.AddString("Michael Long");
		m_listName.AddString("Roger Zhang");
		m_listName.AddString("Annie Yi");
		m_listName.AddString("Chris Fang");
		m_listName.AddString("Carl Hu");
		m_listName.AddString("John Zhou");
		m_listName.AddString("Gates Hua");
		m_listName.AddString("Jamoon Zhou");
		m_listName.AddString("Jerry Yan");
		m_listName.AddString("Daniel Lin");
		m_listName.AddString("Chen Jun");

		// Set timer.
		if ( 0 != m_uTimerID ) {
			// If outstanding timer, kill it.
			KillTimer(m_uTimerID);
		}
	 	// Set a timer for 200 milliseconds.
	 	m_uTimerID = SetTimer(tmEvent, tmElapse, NULL);
	}
	else {
		GetDlgItem(IDC_LIST_ABOUT_NAME)->ShowWindow(SW_HIDE);

		// Kill one-shot timer.
		if ( 0 != m_uTimerID ) {
			KillTimer(m_uTimerID);
			m_uTimerID = 0;
		}
	}
}

void CAboutDialog::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	
	// Not our timer.
	if ( m_uTimerID != nIDEvent ) {
		CDialog::OnTimer(nIDEvent);
		return;
	}

	// Scroll the list box contents.
	m_listName.SendMessage(WM_VSCROLL, SB_LINEDOWN);
}
