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