]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - tools/src/tools/configtool/common/win32/mltview.h
Initial revision
[karo-tx-redboot.git] / tools / src / tools / configtool / common / win32 / mltview.h
1 //####COPYRIGHTBEGIN####
2 //                                                                          
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
5 //
6 // This program is part of the eCos host tools.
7 //
8 // This program is free software; you can redistribute it and/or modify it 
9 // under the terms of the GNU General Public License as published by the Free 
10 // Software Foundation; either version 2 of the License, or (at your option) 
11 // any later version.
12 // 
13 // This program is distributed in the hope that it will be useful, but WITHOUT 
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
15 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
16 // more details.
17 // 
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc., 
20 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 //
22 // ----------------------------------------------------------------------------
23 //                                                                          
24 //####COPYRIGHTEND####
25 // MLTView.h: interface for the CMLTView class.
26 //
27 //////////////////////////////////////////////////////////////////////
28
29 #if !defined(AFX_MLTVIEW_H__C2A5FFD9_AEE9_11D2_BFDA_00A0C9554250__INCLUDED_)
30 #define AFX_MLTVIEW_H__C2A5FFD9_AEE9_11D2_BFDA_00A0C9554250__INCLUDED_
31
32 #if _MSC_VER >= 1000
33 #pragma once
34 #endif // _MSC_VER >= 1000
35
36 #include <afxtempl.h>
37
38 #include "memmap.h"
39
40 typedef struct tagREGIONRECT
41 {
42     std::list <mem_region>::iterator Region;
43     CRect Rect;
44 }
45 REGIONRECT;
46
47 typedef struct tagSECTIONRECT
48 {
49     std::list <mem_section_view>::iterator SectionView;
50     CRect Rect;
51 }
52 SECTIONRECT;
53
54 class CMLTView : public CScrollView
55 {
56 protected: // create from serialization only
57         DECLARE_DYNCREATE(CMLTView)
58
59 // Attributes
60 public:
61         CMLTView();
62
63 // Operations
64 public:
65
66 // Overrides
67         // ClassWizard generated virtual function overrides
68         //{{AFX_VIRTUAL(CMLTView)
69         public:
70         virtual void OnDraw(CDC* pDC);  // overridden to draw this view
71         virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
72         virtual void OnInitialUpdate();
73         protected:
74         virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
75         virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
76         virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
77         //}}AFX_VIRTUAL
78
79 // Implementation
80 public:
81         virtual ~CMLTView();
82 #ifdef _DEBUG
83         virtual void AssertValid() const;
84         virtual void Dump(CDumpContext& dc) const;
85 #endif
86
87 private:
88   
89   CMapStringToPtr m_arstrTooltipRects;
90
91         void DrawRegion (CDC* pDC, UINT uRegion, UINT uUnitCount, UINT uPixelsPerUnit, std::list <mem_region>::iterator region);
92     CList <SECTIONRECT, SECTIONRECT &> listSectionRect;
93     CList <REGIONRECT, REGIONRECT &> listRegionRect;
94     SECTIONRECT * SectionHitTest (CPoint pntTest);
95     REGIONRECT * RegionHitTest (CPoint pntTest);
96     std::list <mem_section_view>::iterator m_sviSelectedSectionView;
97     std::list <mem_region>::iterator m_riSelectedRegion;
98     UINT m_uViewWidth, m_uClientWidth;
99         void CalcUnitCountMax ();
100     UINT m_uUnitCountMax;
101         CRect m_rectSelectedItem;
102
103 protected:
104   virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
105
106 // Generated message map functions
107 protected:
108         CString m_strTipText;
109         //{{AFX_MSG(CMLTView)
110         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
111         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
112         afx_msg void OnSize(UINT nType, int cx, int cy);
113         afx_msg BOOL OnEraseBkgnd(CDC* pDC);
114         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
115   afx_msg void OnMLTNewRegion ();
116   afx_msg void OnMLTNewSection ();
117   afx_msg void OnMLTDelete ();
118   afx_msg void OnMLTProperties ();
119   afx_msg void OnUpdateMLTNewSection (CCmdUI* pCmdUI);
120   afx_msg void OnUpdateMLTDelete (CCmdUI* pCmdUI);
121   afx_msg void OnUpdateMLTProperties (CCmdUI* pCmdUI);
122         afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
123         afx_msg void OnPopupProperties();
124         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
125         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
126         afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
127         afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
128         //}}AFX_MSG
129   BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT*pResult);
130   afx_msg void OnUpdateMLTNewRegion (CCmdUI* pCmdUI);
131         DECLARE_MESSAGE_MAP()
132 };
133
134 #endif // !defined(AFX_MLTVIEW_H__C2A5FFD9_AEE9_11D2_BFDA_00A0C9554250__INCLUDED_)