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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [Utils/] [win32/] [CSHDialog.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
// CSHDialog.cpp : implementation file
23
//
24
 
25
#include "stdafx.h"
26
#include "CSHDialog.h"
27
#include <afxpriv.h> // for WM_COMMANDHELP
28
 
29
#ifdef _DEBUG
30
#define new DEBUG_NEW
31
#undef THIS_FILE
32
static char THIS_FILE[] = __FILE__;
33
#endif
34
 
35
#include <htmlHelp.h>
36
#include <windowsx.h>
37
/////////////////////////////////////////////////////////////////////////////
38
// CCSHDialog dialog
39
 
40
void CCSHDialog::DoDataExchange(CDataExchange* pDX)
41
{
42
        CDialog::DoDataExchange(pDX);
43
        //{{AFX_DATA_MAP(CCSHDialog)
44
                // NOTE: the ClassWizard will add DDX and DDV calls here
45
        //}}AFX_DATA_MAP
46
}
47
 
48
 
49
BEGIN_MESSAGE_MAP(CCSHDialog, CDialog)
50
        //{{AFX_MSG_MAP(CCSHDialog)
51
        ON_WM_CONTEXTMENU()
52
        ON_WM_HELPINFO()
53
  ON_MESSAGE(WM_COMMANDHELP,OnCommandHelp)
54
  ON_COMMAND(ID_WHATS_THIS,OnWhatsThis)
55
        ON_COMMAND(IDHELP, OnHelp)
56
        //}}AFX_MSG_MAP
57
END_MESSAGE_MAP()
58
 
59
/////////////////////////////////////////////////////////////////////////////
60
// CCSHDialog message handlers
61
void CCSHDialog::OnContextMenu(CWnd* pWnd, CPoint pt)
62
{
63
  m_pwndContext=WndFromPoint(this,pWnd,pt);
64
  if(NULL==m_pwndContext || !CCSHCommon::OnContextMenu(this,pt,HelpID(m_pwndContext->GetDlgCtrlID()))){
65
    CDialog::OnContextMenu(pWnd,pt);
66
  }
67
}
68
 
69
void CCSHDialog::OnWhatsThis()
70
{
71
  DisplayHelp(m_pwndContext->m_hWnd,HelpID(m_pwndContext->m_hWnd),GetInstanceHandle());
72
}
73
 
74
BOOL CCSHDialog::OnHelpInfo(HELPINFO* pHelpInfo)
75
{
76
  DisplayHelp((HWND)pHelpInfo->hItemHandle,HelpID((HWND)pHelpInfo->hItemHandle),GetInstanceHandle());
77
  return TRUE;
78
}
79
 
80
BOOL CCSHDialog::OnInitDialog()
81
{
82
        CDialog::OnInitDialog();
83
 
84
  if(0==HelpID(IDOK)){
85
    // Dynamically add/remove the question mark button to the title bar of the dialog box:
86
    ModifyStyleEx(WS_EX_CONTEXTHELP,0,0);
87
  } else {
88
    ModifyStyleEx(0,WS_EX_CONTEXTHELP,0);
89
  }
90
 
91
  CWnd *pHelpButton=GetDlgItem(IDHELP);
92
  if(NULL!=pHelpButton){
93
    pHelpButton->EnableWindow(!CSHFile().IsEmpty());
94
  }
95
        return TRUE;  // return TRUE unless you set the focus to a control
96
                      // EXCEPTION: OCX Property Pages should return FALSE
97
}
98
 
99
CString CCSHDialog::CSHFile() const // return the context-sensitive help file 
100
{
101
  return _T("");
102
}
103
 
104
UINT CCSHDialog::HelpID(DWORD) const
105
{
106
  return 0; // dummy implementation
107
}
108
 
109
void CCSHDialog::OnHelp()
110
{
111
  if(!CSHFile().IsEmpty()){
112
    HtmlHelp(NULL,GetCSHFilePath()+CSHFile(),HH_DISPLAY_TOPIC,0);
113
  }
114
}
115
 
116
HINSTANCE CCSHDialog::GetInstanceHandle()
117
{
118
  return AfxGetInstanceHandle();
119
}
120
 
121
BOOL CCSHDialog::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
122
{
123
  if(CCSHCommon::FilterMessage(message, wParam,lParam,pResult)){
124
    return true; // handled
125
  }
126
  return CDialog::OnWndMsg(message, wParam, lParam, pResult);
127
}
128
 

powered by: WebSVN 2.1.0

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