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 |
|
|
// OutputPage.cpp : implementation file
|
23 |
|
|
//
|
24 |
|
|
//
|
25 |
|
|
//===========================================================================
|
26 |
|
|
//===========================================================================
|
27 |
|
|
//#####DESCRIPTIONBEGIN####
|
28 |
|
|
//
|
29 |
|
|
// Author(s): sdf
|
30 |
|
|
// Contact(s): sdf
|
31 |
|
|
// Date: 1998/08/11
|
32 |
|
|
// Version: 0.01
|
33 |
|
|
// Purpose:
|
34 |
|
|
// Description: This is the implementation of the Configuration -> Options View tab
|
35 |
|
|
// Requires:
|
36 |
|
|
// Provides:
|
37 |
|
|
// See also:
|
38 |
|
|
// Known bugs:
|
39 |
|
|
// Usage:
|
40 |
|
|
//
|
41 |
|
|
//####DESCRIPTIONEND####
|
42 |
|
|
//
|
43 |
|
|
//===========================================================================
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
#include "stdafx.h"
|
47 |
|
|
#include "ConfigTool.h"
|
48 |
|
|
#include "ConfigToolDoc.h"
|
49 |
|
|
#include "CTOptionsDialog.h"
|
50 |
|
|
#include "ConfigItem.h"
|
51 |
|
|
|
52 |
|
|
#ifdef _DEBUG
|
53 |
|
|
#define new DEBUG_NEW
|
54 |
|
|
#undef THIS_FILE
|
55 |
|
|
static char THIS_FILE[] = __FILE__;
|
56 |
|
|
#endif
|
57 |
|
|
|
58 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
59 |
|
|
// CToolsOptionsDialog property page
|
60 |
|
|
|
61 |
|
|
CToolsOptionsDialog::CToolsOptionsDialog()
|
62 |
|
|
: CeCosDialog(IDD, NULL)
|
63 |
|
|
{
|
64 |
|
|
//{{AFX_DATA_INIT(CToolsOptionsDialog)
|
65 |
|
|
//}}AFX_DATA_INIT
|
66 |
|
|
}
|
67 |
|
|
|
68 |
|
|
CToolsOptionsDialog::~CToolsOptionsDialog()
|
69 |
|
|
{
|
70 |
|
|
}
|
71 |
|
|
|
72 |
|
|
void CToolsOptionsDialog::DoDataExchange(CDataExchange* pDX)
|
73 |
|
|
{
|
74 |
|
|
CeCosDialog::DoDataExchange(pDX);
|
75 |
|
|
//{{AFX_DATA_MAP(CToolsOptionsDialog)
|
76 |
|
|
//}}AFX_DATA_MAP
|
77 |
|
|
}
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
BEGIN_MESSAGE_MAP(CToolsOptionsDialog, CeCosDialog)
|
81 |
|
|
//{{AFX_MSG_MAP(CToolsOptionsDialog)
|
82 |
|
|
ON_BN_CLICKED(IDC_DEFERRED, OnDeferred)
|
83 |
|
|
ON_BN_CLICKED(IDC_IMMEDIATE, OnImmediate)
|
84 |
|
|
//}}AFX_MSG_MAP
|
85 |
|
|
END_MESSAGE_MAP()
|
86 |
|
|
|
87 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
88 |
|
|
// CToolsOptionsDialog message handlers
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
BOOL CToolsOptionsDialog::OnInitDialog()
|
92 |
|
|
{
|
93 |
|
|
CeCosDialog::OnInitDialog();
|
94 |
|
|
CConfigToolDoc*pDoc=CConfigTool::GetConfigToolDoc();
|
95 |
|
|
((CButton *)GetDlgItem(IDC_IMMEDIATE))->SetCheck(pDoc->m_nRuleChecking&CConfigToolDoc::Immediate);
|
96 |
|
|
((CButton *)GetDlgItem(IDC_DEFERRED ))->SetCheck(pDoc->m_nRuleChecking&CConfigToolDoc::Deferred);
|
97 |
|
|
((CButton *)GetDlgItem(IDC_SUGGEST_FIXES ))->SetCheck(pDoc->m_nRuleChecking&CConfigToolDoc::SuggestFixes);
|
98 |
|
|
UpdateData(FALSE);
|
99 |
|
|
SetButtons();
|
100 |
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
101 |
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
102 |
|
|
}
|
103 |
|
|
|
104 |
|
|
void CToolsOptionsDialog::OnDeferred()
|
105 |
|
|
{
|
106 |
|
|
SetButtons();
|
107 |
|
|
}
|
108 |
|
|
|
109 |
|
|
void CToolsOptionsDialog::OnImmediate()
|
110 |
|
|
{
|
111 |
|
|
SetButtons();
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
void CToolsOptionsDialog::OnOK()
|
115 |
|
|
{
|
116 |
|
|
CConfigToolDoc *pDoc=CConfigTool::GetConfigToolDoc();
|
117 |
|
|
UpdateData(TRUE);
|
118 |
|
|
pDoc->m_nRuleChecking=
|
119 |
|
|
(CConfigToolDoc::SuggestFixes * ((CButton *)GetDlgItem(IDC_SUGGEST_FIXES))->GetCheck())|
|
120 |
|
|
(CConfigToolDoc::Immediate * ((CButton *)GetDlgItem(IDC_IMMEDIATE))->GetCheck())|
|
121 |
|
|
(CConfigToolDoc::Deferred * ((CButton *)GetDlgItem(IDC_DEFERRED))->GetCheck());
|
122 |
|
|
CeCosDialog::OnOK();
|
123 |
|
|
}
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
void CToolsOptionsDialog::SetButtons()
|
129 |
|
|
{
|
130 |
|
|
GetDlgItem(IDC_SUGGEST_FIXES)->EnableWindow(((CButton *)GetDlgItem(IDC_IMMEDIATE))->GetCheck()|((CButton *)GetDlgItem(IDC_DEFERRED))->GetCheck());
|
131 |
|
|
}
|