| 1 |
26 |
unneback |
//####COPYRIGHTBEGIN####
|
| 2 |
|
|
//
|
| 3 |
|
|
// ----------------------------------------------------------------------------
|
| 4 |
|
|
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
|
| 5 |
|
|
//
|
| 6 |
|
|
// This program is part of the eCos host tools.
|
| 7 |
|
|
//
|
| 8 |
|
|
// This program is free software; you can redistribute it and/or modify it
|
| 9 |
|
|
// under the terms of the GNU General Public License as published by the Free
|
| 10 |
|
|
// Software Foundation; either version 2 of the License, or (at your option)
|
| 11 |
|
|
// any later version.
|
| 12 |
|
|
//
|
| 13 |
|
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
| 14 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
| 15 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
| 16 |
|
|
// more details.
|
| 17 |
|
|
//
|
| 18 |
|
|
// You should have received a copy of the GNU General Public License along with
|
| 19 |
|
|
// this program; if not, write to the Free Software Foundation, Inc.,
|
| 20 |
|
|
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 21 |
|
|
//
|
| 22 |
|
|
// ----------------------------------------------------------------------------
|
| 23 |
|
|
//
|
| 24 |
|
|
//####COPYRIGHTEND####
|
| 25 |
|
|
// ConfigViewOptionsDialog.cpp : implementation file
|
| 26 |
|
|
//
|
| 27 |
|
|
|
| 28 |
|
|
#include "stdafx.h"
|
| 29 |
|
|
#include "ConfigViewOptionsDialog.h"
|
| 30 |
|
|
#include "ConfigTool.h"
|
| 31 |
|
|
#include "ConfigToolDoc.h"
|
| 32 |
|
|
#include "resource.h"
|
| 33 |
|
|
|
| 34 |
|
|
#ifdef _DEBUG
|
| 35 |
|
|
#define new DEBUG_NEW
|
| 36 |
|
|
#undef THIS_FILE
|
| 37 |
|
|
static char THIS_FILE[] = __FILE__;
|
| 38 |
|
|
#endif
|
| 39 |
|
|
|
| 40 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
| 41 |
|
|
// CConfigViewOptionsDialog dialog
|
| 42 |
|
|
|
| 43 |
|
|
|
| 44 |
|
|
CConfigViewOptionsDialog::CConfigViewOptionsDialog()
|
| 45 |
|
|
: CeCosDialog(IDD_CONFIGURATION_VIEW_OPTIONS_DIALOG, NULL)
|
| 46 |
|
|
{
|
| 47 |
|
|
//{{AFX_DATA_INIT(CConfigViewOptionsDialog)
|
| 48 |
|
|
// NOTE: the ClassWizard will add member initialization here
|
| 49 |
|
|
//}}AFX_DATA_INIT
|
| 50 |
|
|
}
|
| 51 |
|
|
|
| 52 |
|
|
|
| 53 |
|
|
void CConfigViewOptionsDialog::DoDataExchange(CDataExchange* pDX)
|
| 54 |
|
|
{
|
| 55 |
|
|
CeCosDialog::DoDataExchange(pDX);
|
| 56 |
|
|
//{{AFX_DATA_MAP(CConfigViewOptionsDialog)
|
| 57 |
|
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
| 58 |
|
|
//}}AFX_DATA_MAP
|
| 59 |
|
|
}
|
| 60 |
|
|
|
| 61 |
|
|
|
| 62 |
|
|
BEGIN_MESSAGE_MAP(CConfigViewOptionsDialog, CeCosDialog)
|
| 63 |
|
|
//{{AFX_MSG_MAP(CConfigViewOptionsDialog)
|
| 64 |
|
|
//}}AFX_MSG_MAP
|
| 65 |
|
|
END_MESSAGE_MAP()
|
| 66 |
|
|
|
| 67 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
| 68 |
|
|
// CConfigViewOptionsDialog message handlers
|
| 69 |
|
|
|
| 70 |
|
|
BOOL CConfigViewOptionsDialog::OnInitDialog()
|
| 71 |
|
|
{
|
| 72 |
|
|
CeCosDialog::OnInitDialog();
|
| 73 |
|
|
CConfigToolDoc *pDoc=CConfigTool::GetConfigToolDoc();
|
| 74 |
|
|
((CButton *)GetDlgItem(IDC_RADIO_DECIMAL))->SetCheck(!pDoc->m_bHex);
|
| 75 |
|
|
((CButton *)GetDlgItem(IDC_RADIO_DESCRIPTIVE_NAMES))->SetCheck(!pDoc->m_bMacroNames);
|
| 76 |
|
|
((CButton *)GetDlgItem(IDC_RADIO_HEXADECIMAL))->SetCheck(pDoc->m_bHex);
|
| 77 |
|
|
((CButton *)GetDlgItem(IDC_RADIO_MACRO_NAMES))->SetCheck(pDoc->m_bMacroNames);
|
| 78 |
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
| 79 |
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
| 80 |
|
|
}
|
| 81 |
|
|
|
| 82 |
|
|
void CConfigViewOptionsDialog::OnOK()
|
| 83 |
|
|
{
|
| 84 |
|
|
bool bHex=((CButton *)GetDlgItem(IDC_RADIO_HEXADECIMAL))->GetCheck();
|
| 85 |
|
|
CConfigToolDoc *pDoc=CConfigTool::GetConfigToolDoc();
|
| 86 |
|
|
if(bHex!=pDoc->m_bHex){
|
| 87 |
|
|
pDoc->m_bHex=bHex;
|
| 88 |
|
|
pDoc->UpdateAllViews(0,CConfigToolDoc::IntFormatChanged);
|
| 89 |
|
|
}
|
| 90 |
|
|
|
| 91 |
|
|
bool bMacros=((CButton *)GetDlgItem(IDC_RADIO_MACRO_NAMES))->GetCheck();
|
| 92 |
|
|
if(bMacros!=pDoc->m_bMacroNames){
|
| 93 |
|
|
pDoc->m_bMacroNames=bMacros;
|
| 94 |
|
|
pDoc->UpdateAllViews(0,CConfigToolDoc::NameFormatChanged);
|
| 95 |
|
|
}
|
| 96 |
|
|
CeCosDialog::OnOK();
|
| 97 |
|
|
}
|
| 98 |
|
|
|