1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
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)
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
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.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 // MLTView.h: interface for the CMLTView class.
27 //////////////////////////////////////////////////////////////////////
29 #if !defined(AFX_MLTVIEW_H__C2A5FFD9_AEE9_11D2_BFDA_00A0C9554250__INCLUDED_)
30 #define AFX_MLTVIEW_H__C2A5FFD9_AEE9_11D2_BFDA_00A0C9554250__INCLUDED_
34 #endif // _MSC_VER >= 1000
40 typedef struct tagREGIONRECT
42 std::list <mem_region>::iterator Region;
47 typedef struct tagSECTIONRECT
49 std::list <mem_section_view>::iterator SectionView;
54 class CMLTView : public CScrollView
56 protected: // create from serialization only
57 DECLARE_DYNCREATE(CMLTView)
67 // ClassWizard generated virtual function overrides
68 //{{AFX_VIRTUAL(CMLTView)
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();
74 virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
75 virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
76 virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
83 virtual void AssertValid() const;
84 virtual void Dump(CDumpContext& dc) const;
89 CMapStringToPtr m_arstrTooltipRects;
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;
104 virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
106 // Generated message map functions
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);
129 BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT*pResult);
130 afx_msg void OnUpdateMLTNewRegion (CCmdUI* pCmdUI);
131 DECLARE_MESSAGE_MAP()
134 #endif // !defined(AFX_MLTVIEW_H__C2A5FFD9_AEE9_11D2_BFDA_00A0C9554250__INCLUDED_)