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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [common/] [win32/] [FindDialog.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
// FindDialog.cpp : implementation file
23
//
24
//
25
//===========================================================================
26
//#####DESCRIPTIONBEGIN####
27
//
28
// Author(s):   sdf
29
// Contact(s):  sdf
30
// Date:                1998/08/11
31
// Version:             0.01
32
// Purpose:     
33
// Description: This overrides CFindDialog functions to customize the dialog
34
//                              for use in the configuration tool.
35
// Requires:    
36
// Provides:    
37
// See also:    
38
// Known bugs:  
39
// Usage:       
40
//
41
//####DESCRIPTIONEND####
42
//
43
//===========================================================================
44
 
45
#include "stdafx.h"
46
#include "FindDialog.h"
47
#include "ConfigTool.h"
48
#include "ConfigToolDoc.h"
49
#include <afxpriv.h>
50
 
51
#ifdef _DEBUG
52
#define new DEBUG_NEW
53
#undef THIS_FILE
54
static char THIS_FILE[] = __FILE__;
55
#endif
56
 
57
/////////////////////////////////////////////////////////////////////////////
58
// CFindDialog dialog
59
 
60
 
61
CFindDialog::CFindDialog()
62
        : CFindReplaceDialog()
63
{
64
        //{{AFX_DATA_INIT(CFindDialog)
65
                // NOTE: the ClassWizard will add member initialization here
66
        //}}AFX_DATA_INIT
67
    #ifdef PLUGIN
68
    extern HINSTANCE heCosInstance;
69
    m_fr.hInstance=heCosInstance;
70
    #endif
71
        m_fr.Flags |= FR_ENABLETEMPLATE;
72
        m_fr.lpTemplateName=MAKEINTRESOURCE(IDD_FINDREPLACE);
73
}
74
 
75
CFindDialog::~CFindDialog()
76
{
77
}
78
 
79
void CFindDialog::DoDataExchange(CDataExchange* pDX)
80
{
81
        CFindReplaceDialog::DoDataExchange(pDX);
82
        //{{AFX_DATA_MAP(CFindDialog)
83
                // NOTE: the ClassWizard will add DDX and DDV calls here
84
        //}}AFX_DATA_MAP
85
}
86
 
87
BOOL CFindDialog::OnInitDialog()
88
{
89
        CFindReplaceDialog::OnInitDialog();
90
  CComboBox *pCombo=(CComboBox *)GetDlgItem(IDC_SEARCHCOMBO);
91
  pCombo->AddString(_T("Macro names"));
92
  pCombo->AddString(_T("Item names"));
93
  pCombo->AddString(_T("Short descriptions"));
94
  pCombo->AddString(_T("Current Values"));
95
  pCombo->AddString(_T("Default Values"));
96
  pCombo->SetCurSel(m_nFindPos);
97
        return TRUE;  // return TRUE unless you set the focus to a control
98
                      // EXCEPTION: OCX Property Pages should return FALSE
99
}
100
 
101
BEGIN_MESSAGE_MAP(CFindDialog, CFindReplaceDialog)
102
        //{{AFX_MSG_MAP(CFindDialog)
103
        ON_CBN_SELCHANGE(IDC_SEARCHCOMBO, OnSelchangeSearchcombo)
104
        //}}AFX_MSG_MAP
105
END_MESSAGE_MAP()
106
 
107
/////////////////////////////////////////////////////////////////////////////
108
// CFindDialog message handlers
109
 
110
void CFindDialog::OnSelchangeSearchcombo()
111
{
112
  m_nFindPos=(WhereType)((CComboBox *)GetDlgItem(IDC_SEARCHCOMBO))->GetCurSel();
113
}
114
 
115
BOOL CFindDialog::Create(LPCTSTR lpszFindWhat, DWORD dwFlags, WhereType where, CWnd* pParentWnd)
116
{
117
    m_nFindPos=where;
118
        m_nIDHelp = AFX_IDD_FIND;
119
        m_fr.Flags |= dwFlags;
120
 
121
        ASSERT_VALID(pParentWnd);
122
        m_fr.hwndOwner = pParentWnd->m_hWnd;
123
        ASSERT(m_fr.hwndOwner != NULL); // must have a parent for modeless dialog
124
 
125
        m_fr.wFindWhatLen = sizeof(m_szFindWhat);
126
 
127
    int n=min(sizeof(m_szFindWhat)-1,_tcslen(lpszFindWhat));
128
        _tcsncpy(m_szFindWhat, lpszFindWhat, n);
129
    m_szFindWhat[n]=_TCHAR('\0');
130
 
131
        AfxHookWindowCreate(this);
132
    HWND hWnd = ::FindText(&m_fr);
133
    if (!AfxUnhookWindowCreate()){
134
                PostNcDestroy();
135
    }
136
 
137
        ASSERT(hWnd == NULL || hWnd == m_hWnd);
138
        return hWnd != NULL;
139
}

powered by: WebSVN 2.1.0

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