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 a the cell window view class
40 //####DESCRIPTIONEND####
42 //===========================================================================
43 #if !defined(AFX_CELLVIEW_H__71506369_375A_11D2_80C1_00A0C949ADAC__INCLUDED_)
44 #define AFX_CELLVIEW_H__71506369_375A_11D2_80C1_00A0C949ADAC__INCLUDED_
48 #endif // _MSC_VER >= 1000
49 // CellView.h : header file
52 /////////////////////////////////////////////////////////////////////////////
56 #include "ControlView.h"
57 #include "ConfigTool.h"
59 class CCellView : public CView
62 // Convert an HTREEITEM to a CConfigItem:
63 CConfigItem &TI (HTREEITEM h) const {
64 return *(CConfigItem *)(CConfigTool::GetControlView()->GetItemData(h));
67 CCellView(); // protected constructor used by dynamic creation
68 DECLARE_DYNCREATE(CCellView)
70 // Create a control for in-cell editing:
71 BOOL InCell(HTREEITEM h);
73 // Get the value from the cell control
74 ItemIntegerType GetCellValue() const;
76 // retrieve the bounding rectangle for hItem
77 void GetItemRect(HTREEITEM hItem,CRect & rect) const;
79 // bounding rectangle for cells (this is a little smaller than the item rectangle
80 // in the case of editboxes). bDropped tells us what we want to know about comboboxes
81 void GetInCellRect(HTREEITEM h, CRect & rect,BOOL bDropped=TRUE) const;
83 int m_nFirstVisibleItem;
90 // return the handle of the item with an in-cell edit control, or NULL if none
91 HTREEITEM ActiveCell() const { return m_hInCell; }
96 // Scroll to match our buddy
99 // Destroy any in-cell editing
100 void CancelCellEdit(bool bApplyChanges=true);
103 // ClassWizard generated virtual function overrides
104 //{{AFX_VIRTUAL(CCellView)
106 virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
107 virtual BOOL PreTranslateMessage(MSG* pMsg);
109 virtual void OnDraw(CDC* pDC); // overridden to draw this view
110 virtual void OnInitialUpdate(); // first time after construct
111 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
116 CString m_strInitialCell;
118 bool m_bComboSellPending;
119 CCell * m_pwndCell; // Window for the in-cell editing
120 HTREEITEM m_hInCell; // hItem being in-cell edited
121 virtual ~CCellView();
123 virtual void AssertValid() const;
124 virtual void Dump(CDumpContext& dc) const;
127 // Generated message map functions
128 //{{AFX_MSG(CCellView)
129 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
130 afx_msg void OnSize(UINT nType, int cx, int cy);
131 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
132 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
133 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
134 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
135 afx_msg void OnEditFind();
136 afx_msg void OnEditFindAgain();
137 afx_msg void OnUpdateEditFindAgain(CCmdUI* pCmdUI);
138 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
139 afx_msg void OnUpdateEditFind(CCmdUI* pCmdUI);
140 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
141 afx_msg void OnEditCopy();
142 afx_msg void OnEditCut();
143 afx_msg void OnEditPaste();
144 afx_msg void OnEditDelete();
145 afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
146 afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
147 afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
148 afx_msg void OnUpdateEditDelete(CCmdUI* pCmdUI);
149 afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
150 afx_msg LRESULT OnCancelEdit(WPARAM wParam, LPARAM);
152 DECLARE_MESSAGE_MAP()
155 /////////////////////////////////////////////////////////////////////////////
157 //{{AFX_INSERT_LOCATION}}
158 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
160 #endif // !defined(AFX_CELLVIEW_H__71506369_375A_11D2_80C1_00A0C949ADAC__INCLUDED_)