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 //===========================================================================
26 //#####DESCRIPTIONBEGIN####
33 // Description: Interface of the tree (control) view class
40 //####DESCRIPTIONEND####
42 //===========================================================================
43 #if !defined(AFX_CONTROLVIEW_H__A4845250_05EE_11D2_80BE_00A0C949ADAC__INCLUDED_)
44 #define AFX_CONTROLVIEW_H__A4845250_05EE_11D2_80BE_00A0C949ADAC__INCLUDED_
48 #endif // _MSC_VER >= 1000
49 // ControlView.h : header file
51 /////////////////////////////////////////////////////////////////////////////
58 class CConfigViewOptionsDialog;
61 class CControlView : public CTreeView
63 friend class CConfigItem;
65 CControlView(); // protected constructor used by dynamic creation
66 DECLARE_DYNCREATE(CControlView)
71 // Let us use the View as a control:
72 #include "TreeCtrlToView.inl"
73 friend class CCellView;
76 int GetItemHeight() const { return m_nItemHeight; }
77 CConfigItem &TI (HTREEITEM h) const {
78 return *(CConfigItem *)GetItemData(h);
81 BOOL IsActive(HTREEITEM h) const;
84 // ClassWizard generated virtual function overrides
85 //{{AFX_VIRTUAL(CControlView)
87 virtual void OnInitialUpdate();
88 virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
89 virtual BOOL PreTranslateMessage(MSG* pMsg);
91 virtual void OnDraw(CDC* pDC); // overridden to draw this view
92 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
97 void Refresh (HTREEITEM h);
101 void SetHScrollPos();
102 void SetHScrollRangePos();
104 void SetScrollRangePos();
106 void KillScrollBars();
107 virtual ~CControlView();
109 virtual void AssertValid() const;
110 virtual void Dump(CDumpContext& dc) const;
113 // Generated message map functions
115 void ShowPopupMenu (HTREEITEM h,CPoint point=CPoint(-1,-1));
116 void RecalcWorkSpaceSize();
117 int m_TreeXOffsetAdjustment;
118 int m_nWorkspace; // Height of the virtual workspace
119 int TotalDescendantHeight(HTREEITEM hItem)const; // Visible height of descendants (not including hItem itself)
121 int m_nItemHeight; // Height of an item (can use GetItemHeight() in IE4)
122 bool BumpItem (HTREEITEM h,int nInc=1); // Increment the item (do what clicking on the icon achieves)
123 void AdjustItemImage (HTREEITEM h);
125 bool m_bFindInProgress;
126 static bool IsWordChar (TCHAR c);
127 CConfigItem *DoFind(LPCTSTR pszWhat,DWORD dwFlags,WhereType where);
128 HTREEITEM m_hExpandedForFind;
129 CConfigToolDoc * GetDocument();
130 void InvalidateItem (HTREEITEM h);
131 BOOL IsChanged (HTREEITEM h, BOOL bRecurse);
132 void RestoreDefault (HTREEITEM h, BOOL bRecurse = FALSE, BOOL bTopLevel = TRUE);
133 HTREEITEM m_hContext; // Where the right-click occurred
134 ItemIntegerType Value(HTREEITEM h) const; // Value (taking into account any in-cell activity)
135 CImageList m_il; // Image list for the control
136 //{{AFX_MSG(CControlView)
137 afx_msg void OnPaint();
138 afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
139 afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
140 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
141 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
142 afx_msg void OnSize(UINT nType, int cx, int cy);
143 afx_msg void OnRestoreDefaults();
144 afx_msg void OnPopupProperties();
145 afx_msg void OnUnload();
146 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
147 afx_msg void OnViewUrl();
148 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
149 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
150 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
151 afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
152 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
153 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
154 afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
155 afx_msg void OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags);
156 afx_msg void OnViewHeader();
157 afx_msg LONG OnFind(WPARAM wParam, LPARAM lParam);
158 afx_msg void OnEditFind();
159 afx_msg void OnEditFindAgain();
160 afx_msg void OnUpdateEditFindAgain(CCmdUI* pCmdUI);
161 afx_msg void OnUpdateEditFind(CCmdUI* pCmdUI);
162 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
163 afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
164 afx_msg void OnWhatsThis();
165 afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
166 afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
168 afx_msg LRESULT OnSetFont(WPARAM, LPARAM lParam);
170 void Refresh (LPCTSTR pszMacroName);
171 bool SelectItem (const CConfigItem *pItem);
172 DECLARE_MESSAGE_MAP()
176 /////////////////////////////////////////////////////////////////////////////
178 //{{AFX_INSERT_LOCATION}}
179 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
181 #endif // !defined(AFX_CONTROLVIEW_H__A4845250_05EE_11D2_80BE_00A0C949ADAC__INCLUDED_)