OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [testtool/] [win32/] [RunTestsDlg.cpp] - Blame information for rev 790

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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
// RunTestsDlg.cpp : implementation file
23
//
24
 
25
#include "stdafx.h"
26
#include "RunTestsDlg.h"
27
#include "TestToolRes.h"
28
 
29
#ifdef _DEBUG
30
#define new DEBUG_NEW
31
#undef THIS_FILE
32
static char THIS_FILE[] = __FILE__;
33
#endif
34
 
35
/////////////////////////////////////////////////////////////////////////////
36
// CAboutDlg dialog used for App About
37
/*
38
class CAboutDlg : public CeCosDialog
39
{
40
public:
41
        CAboutDlg();
42
 
43
// Dialog Data
44
        //{{AFX_DATA(CAboutDlg)
45
        enum { IDD = IDD_TT_ABOUTBOX };
46
        //}}AFX_DATA
47
 
48
        // ClassWizard generated virtual function overrides
49
        //{{AFX_VIRTUAL(CAboutDlg)
50
        protected:
51
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
52
        //}}AFX_VIRTUAL
53
 
54
// Implementation
55
protected:
56
        //{{AFX_MSG(CAboutDlg)
57
        //}}AFX_MSG
58
        DECLARE_MESSAGE_MAP()
59
};
60
 
61
CAboutDlg::CAboutDlg() : CeCosDialog(CAboutDlg::IDD)
62
{
63
        //{{AFX_DATA_INIT(CAboutDlg)
64
        //}}AFX_DATA_INIT
65
}
66
 
67
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
68
{
69
        CeCosDialog::DoDataExchange(pDX);
70
        //{{AFX_DATA_MAP(CAboutDlg)
71
        //}}AFX_DATA_MAP
72
}
73
 
74
BEGIN_MESSAGE_MAP(CAboutDlg, CeCosDialog)
75
        //{{AFX_MSG_MAP(CAboutDlg)
76
                // No message handlers
77
        //}}AFX_MSG_MAP
78
END_MESSAGE_MAP()
79
*/
80
/////////////////////////////////////////////////////////////////////////////
81
// CRunTestsDlg dialog
82
 
83
CRunTestsDlg::CRunTestsDlg(CWnd* pParent /*=NULL*/)
84
        : CeCosDialog(IDD_TT_RUNTESTS_DIALOG, pParent)
85
{
86
        //{{AFX_DATA_INIT(CRunTestsDlg)
87
                // NOTE: the ClassWizard will add member initialization here
88
        //}}AFX_DATA_INIT
89
        // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
90
        m_hIcon = AfxGetApp()->LoadIcon(IDR_TT_MAINFRAME);
91
}
92
 
93
void CRunTestsDlg::DoDataExchange(CDataExchange* pDX)
94
{
95
        CeCosDialog::DoDataExchange(pDX);
96
        //{{AFX_DATA_MAP(CRunTestsDlg)
97
                // NOTE: the ClassWizard will add DDX and DDV calls here
98
        //}}AFX_DATA_MAP
99
}
100
 
101
BEGIN_MESSAGE_MAP(CRunTestsDlg, CeCosDialog)
102
        //{{AFX_MSG_MAP(CRunTestsDlg)
103
        ON_WM_SYSCOMMAND()
104
        ON_WM_DESTROY()
105
        ON_WM_PAINT()
106
        ON_WM_QUERYDRAGICON()
107
        //}}AFX_MSG_MAP
108
END_MESSAGE_MAP()
109
 
110
/////////////////////////////////////////////////////////////////////////////
111
// CRunTestsDlg message handlers
112
 
113
BOOL CRunTestsDlg::OnInitDialog()
114
{
115
        CeCosDialog::OnInitDialog();
116
 
117
        // Add "About..." menu item to system menu.
118
 
119
        // IDM_TT_ABOUTBOX must be in the system command range.
120
    /*
121
        ASSERT((IDM_TT_ABOUTBOX & 0xFFF0) == IDM_TT_ABOUTBOX);
122
        ASSERT(IDM_TT_ABOUTBOX < 0xF000);
123
 
124
        CMenu* pSysMenu = GetSystemMenu(FALSE);
125
        if (pSysMenu != NULL)
126
        {
127
                CString strAboutMenu;
128
                strAboutMenu.LoadString(IDS_TT_ABOUTBOX);
129
                if (!strAboutMenu.IsEmpty())
130
                {
131
                        pSysMenu->AppendMenu(MF_SEPARATOR);
132
                        pSysMenu->AppendMenu(MF_STRING, IDM_TT_ABOUTBOX, strAboutMenu);
133
                }
134
        }
135
    */
136
        // Set the icon for this dialog.  The framework does this automatically
137
        //  when the application's main window is not a dialog
138
        SetIcon(m_hIcon, TRUE);                 // Set big icon
139
        SetIcon(m_hIcon, FALSE);                // Set small icon
140
 
141
        // TODO: Add extra initialization here
142
 
143
        return TRUE;  // return TRUE  unless you set the focus to a control
144
}
145
 
146
void CRunTestsDlg::OnSysCommand(UINT nID, LPARAM lParam)
147
{
148
    /*
149
        if ((nID & 0xFFF0) == IDM_TT_ABOUTBOX)
150
        {
151
                CAboutDlg dlgAbout;
152
                dlgAbout.DoModal();
153
        }
154
        else
155
    */
156
        {
157
                CeCosDialog::OnSysCommand(nID, lParam);
158
        }
159
}
160
 
161
void CRunTestsDlg::OnDestroy()
162
{
163
        WinHelp(0L, HELP_QUIT);
164
        CeCosDialog::OnDestroy();
165
}
166
 
167
// If you add a minimize button to your dialog, you will need the code below
168
//  to draw the icon.  For MFC applications using the document/view model,
169
//  this is automatically done for you by the framework.
170
 
171
void CRunTestsDlg::OnPaint()
172
{
173
        if (IsIconic())
174
        {
175
                CPaintDC dc(this); // device context for painting
176
 
177
                SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
178
 
179
                // Center icon in client rectangle
180
                int cxIcon = GetSystemMetrics(SM_CXICON);
181
                int cyIcon = GetSystemMetrics(SM_CYICON);
182
                CRect rect;
183
                GetClientRect(&rect);
184
                int x = (rect.Width() - cxIcon + 1) / 2;
185
                int y = (rect.Height() - cyIcon + 1) / 2;
186
 
187
                // Draw the icon
188
                dc.DrawIcon(x, y, m_hIcon);
189
        }
190
        else
191
        {
192
                CeCosDialog::OnPaint();
193
        }
194
}
195
 
196
// The system calls this to obtain the cursor to display while the user drags
197
//  the minimized window.
198
HCURSOR CRunTestsDlg::OnQueryDragIcon()
199
{
200
        return (HCURSOR) m_hIcon;
201
}
202
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.