
/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/STKFMT.CPP   1.2.1.4   17 Apr 1997 16:01:34   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/STKFMT.CPP  $
** 
**    Rev 1.2.1.4   17 Apr 1997 16:01:34   ZJRD
** No change.
** 
**    Rev 1.2.1.3   16 Apr 1997 10:34:38   ZJRD
** No change.
** 
**    Rev 1.2.1.2   10 Apr 1997 15:43:56   ZJRD
** No change.
** 
**    Rev 1.2.1.1   03 Apr 1997 15:22:30   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:26:32   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:36:22   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:50:34   ZJRD
** Initial revision.
** 
**    Rev 1.7.1.0.1.2   09 Dec 1996 10:16:12   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.7.1.0.1.0   11 Nov 1996 12:59:26   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.7.1.4   09 Sep 1996 13:18:18   ZJRD
** No change.
** 
**    Rev 1.7.1.3   05 Sep 1996 11:29:48   ZJRD
** No change.
** 
**    Rev 1.7.1.2   02 Sep 1996 09:56:54   ZJRD
** No change.
** 
**    Rev 1.7.1.1   28 Aug 1996 15:51:24   ZJRD
** No change.
** 
**    Rev 1.7.1.0   12 Aug 1996 10:55:04   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.5   05 Jun 1996 14:58:06   ZJRD
** No change.
** 
**    Rev 1.4   29 May 1996 09:28:44   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:05:58   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:12:00   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:23:48   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.31   18 Apr 1996 12:57:38   Shirley
** No change.
** 
**    Rev 1.30   12 Apr 1996 10:43:06   Shirley
** No change.
** 
**    Rev 1.29   02 Apr 1996 09:29:40   Shirley
** No change.
** 
**    Rev 1.28   15 Feb 1996 08:55:12   Shirley
** No change.
** 
**    Rev 1.27   12 Feb 1996 14:03:24   Shirley
** No change.
** 
**    Rev 1.26   06 Feb 1996 15:29:54   Shirley
** No change.
** 
**    Rev 1.25   06 Feb 1996 13:44:16   Shirley
** No change.
** 
**    Rev 1.24   01 Feb 1996 10:17:14   Shirley
** No change.
** 
**    Rev 1.23   26 Jan 1996 09:19:48   Shirley
** No change.
** 
**    Rev 1.22   25 Jan 1996 13:19:42   Shirley
** No change.
** 
**    Rev 1.21   24 Jan 1996 10:32:50   Shirley
** No change.
** 
**    Rev 1.20   23 Jan 1996 11:26:36   Shirley
** No change.
** 
**    Rev 1.19   18 Jan 1996 10:11:24   Shirley
** No change.
** 
**    Rev 1.18   15 Jan 1996 16:12:58   Shirley
** No change.
** 
**    Rev 1.17   04 Jan 1996 11:11:02   Shirley
** No change.
** 
**    Rev 1.16   30 Nov 1995 09:14:52   Shirley
** No change.
** 
**    Rev 1.15   28 Nov 1995 15:29:24   Shirley
** No change.
** 
**    Rev 1.14   21 Nov 1995 11:21:38   Shirley
** No change.
** 
**    Rev 1.13   13 Nov 1995 09:27:20   Shirley
** No change.
** 
**    Rev 1.12   12 Nov 1995 11:32:46   Shirley
** No change.
** 
**    Rev 1.11   08 Nov 1995 16:31:10   Shirley
** No change.
** 
**    Rev 1.10   08 Nov 1995 12:45:48   Shirley
** No change.
** 
**    Rev 1.9   02 Nov 1995 10:07:58   Shirley
** No change.
** 
**    Rev 1.8   27 Oct 1995 16:45:16   Shirley
** No change.
** 
**    Rev 1.7   27 Oct 1995 13:47:34   Shirley
** No change.
** 
**    Rev 1.6   25 Oct 1995 14:30:24   Shirley
** No change.
** 
**    Rev 1.5   18 Oct 1995 14:51:48   Shirley
** No change.
** 
**    Rev 1.4   13 Oct 1995 13:22:02   Shirley
** No change.
** 
**    Rev 1.3   29 Sep 1995 09:49:38   Shirley
** No change.
** 
**    Rev 1.2   20 Sep 1995 10:55:54   Shirley
** No change.
** 
**    Rev 1.1   15 Sep 1995 09:47:50   Shirley
** No change.
** 
**    Rev 1.0   07 Sep 1995 09:55:08   Shirley
** Initial revision.
**
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
//
//  File name: STKFMT.CPP
//
//  Description: The implementation file fore class: CStackFormatDialog.
//
//  Author: Chen Jun
//
//  Date: 08/22/95
//
//  Modification:
//      1. 08/22/95, Initial version of the class: CStackFormatDialog.
//
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// Include files.
#include "stdafx.h"
#include "resource.h"

#include "stkfmt.h"


/////////////////////////////////////////////////////////////////////////////
// Debug flags.
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif


/////////////////////////////////////////////////////////////////////////////
// Global variables.
BOOL bStkShowAddress = TRUE;
BOOL bStkShowEntryPoint = TRUE;
BOOL bStkShowModule = TRUE;
BOOL bStkShowParameters = TRUE;


/////////////////////////////////////////////////////////////////////////////
// External function prototypes.
void StkUpdateStackWindow(BOOL bUpdateStackOnly = FALSE);


/////////////////////////////////////////////////////////////////////////////
// CStackFormatDialog dialog

CStackFormatDialog::CStackFormatDialog(CWnd* pParent /*=NULL*/)
    : CDialog(CStackFormatDialog::IDD, pParent)
{
    //{{AFX_DATA_INIT(CStackFormatDialog)
    m_bAddress = FALSE;
    m_bEntryPoint = FALSE;
    m_bModule = FALSE;
    m_bParameters = FALSE;
    //}}AFX_DATA_INIT
}

void CStackFormatDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CStackFormatDialog)
    DDX_Check(pDX, IDC_CHECK_STK_FORMAT_ADDRESS, m_bAddress);
    DDX_Check(pDX, IDC_CHECK_STK_FORMAT_ENTRYPOINT, m_bEntryPoint);
    DDX_Check(pDX, IDC_CHECK_STK_FORMAT_MODULE, m_bModule);
    DDX_Check(pDX, IDC_CHECK_STK_FORMAT_PARAMETERS, m_bParameters);
    //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CStackFormatDialog, CDialog)
    //{{AFX_MSG_MAP(CStackFormatDialog)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CStackFormatDialog message handlers

BOOL CStackFormatDialog::OnInitDialog()
{
    CDialog::OnInitDialog();
    
    // TODO: Add extra initialization here
    
    // Central the dialog position.
    CenterWindow();
        
    // Retrieve from the global flags.
    m_bAddress = ::bStkShowAddress;
    m_bEntryPoint = ::bStkShowEntryPoint;
    m_bModule = ::bStkShowModule;
    m_bParameters = ::bStkShowParameters;
    
    // Set the initial value.
    UpdateData(FALSE);
    
    return TRUE;  // return TRUE  unless you set the focus to a control
}

void CStackFormatDialog::OnCancel()
{
    // TODO: Add extra cleanup here
    
    CDialog::OnCancel();
}

void CStackFormatDialog::OnOK()
{
    // TODO: Add extra validation here
    
    // Set to the global flags.
    UpdateData();

    if ( m_bAddress != ::bStkShowAddress ||
         m_bEntryPoint != ::bStkShowEntryPoint ||
         m_bModule != ::bStkShowModule ||
         m_bParameters != ::bStkShowParameters ) {
        
        // Update flags.
        ::bStkShowAddress = m_bAddress;
        ::bStkShowEntryPoint = m_bEntryPoint;
        ::bStkShowModule = m_bModule;
        ::bStkShowParameters = m_bParameters;
        
        // Update Stack window.
        ::StkUpdateStackWindow(TRUE);
    }
    
    CDialog::OnOK();
}
