1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
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)
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
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.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 // ConfigViewOptionsDialog.cpp : implementation file
29 #include "ConfigViewOptionsDialog.h"
30 #include "ConfigTool.h"
31 #include "ConfigToolDoc.h"
37 static char THIS_FILE[] = __FILE__;
40 /////////////////////////////////////////////////////////////////////////////
41 // CConfigViewOptionsDialog dialog
44 CConfigViewOptionsDialog::CConfigViewOptionsDialog()
45 : CeCosDialog(IDD_CONFIGURATION_VIEW_OPTIONS_DIALOG, NULL)
47 //{{AFX_DATA_INIT(CConfigViewOptionsDialog)
48 // NOTE: the ClassWizard will add member initialization here
53 void CConfigViewOptionsDialog::DoDataExchange(CDataExchange* pDX)
55 CeCosDialog::DoDataExchange(pDX);
56 //{{AFX_DATA_MAP(CConfigViewOptionsDialog)
57 // NOTE: the ClassWizard will add DDX and DDV calls here
62 BEGIN_MESSAGE_MAP(CConfigViewOptionsDialog, CeCosDialog)
63 //{{AFX_MSG_MAP(CConfigViewOptionsDialog)
67 /////////////////////////////////////////////////////////////////////////////
68 // CConfigViewOptionsDialog message handlers
70 BOOL CConfigViewOptionsDialog::OnInitDialog()
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
82 void CConfigViewOptionsDialog::OnOK()
84 bool bHex=((CButton *)GetDlgItem(IDC_RADIO_HEXADECIMAL))->GetCheck();
85 CConfigToolDoc *pDoc=CConfigTool::GetConfigToolDoc();
86 if(bHex!=pDoc->m_bHex){
88 pDoc->UpdateAllViews(0,CConfigToolDoc::IntFormatChanged);
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);