00001 #if !defined(AFX_GRIDCELLMULTILINE_H__ECD42822_16DF_11D1_992F_895E185F9C72__INCLUDED_)
00002 #define AFX_GRIDCELLMULTILINE_H__ECD42822_16DF_11D1_992F_895E185F9C72__INCLUDED_
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00031
00032
00033 #include "../GridCtrl_src/GridCell.h"
00034 #include "../GridCtrl_src/GridCtrl.h"
00035
00036
00037 class CGridCellMultiLine : public CGridCell
00038 {
00039 friend class CGridCtrl;
00040 DECLARE_DYNCREATE(CGridCellMultiLine)
00041
00042 public:
00043 CGridCellMultiLine();
00044
00045
00046 public:
00047 virtual BOOL Edit(int nRow, int nCol, CRect rect, CPoint point, UINT nID, UINT nChar);
00048 virtual void EndEdit();
00049
00050
00051 public:
00052 void SetStyle(DWORD dwStyle) { m_dwStyle = dwStyle; }
00053 DWORD GetStyle() { return m_dwStyle; }
00054
00055 void SetHoldWidth(BOOL bHoldWidth = TRUE) { m_bHoldWidth = bHoldWidth; }
00056 BOOL GetHoldWidth() { return m_bHoldWidth; }
00057
00058
00059 CSize GetTextExtentEx(int width, LPCTSTR str, CDC* pDC = NULL);
00060 CSize GetCellExtentEx(int width,CDC* pDC);
00061
00062
00063 protected:
00064 virtual BOOL Draw(CDC* pDC, int nRow, int nCol, CRect rect, BOOL bEraseBkgnd = TRUE);
00065
00066 CStringArray m_Strings;
00067 DWORD m_dwStyle;
00068 BOOL m_bHoldWidth;
00069 };
00070
00071
00075
00076
00077 class CInPlaceMultiLine : public CEdit
00078 {
00079
00080 public:
00081 CInPlaceMultiLine(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID,
00082 int nRow, int nColumn, CString sInitText, UINT nFirstChar);
00083
00084
00085 public:
00086
00087
00088 public:
00089 void EndEdit();
00090 CSize GetTextExtentMultiLine(int width, LPCTSTR szText, CDC* pDC );
00091
00092
00093
00094
00095 public:
00096 virtual BOOL PreTranslateMessage(MSG* pMsg);
00097 protected:
00098 virtual void PostNcDestroy();
00099
00100
00101
00102 public:
00103 virtual ~CInPlaceMultiLine();
00104
00105
00106 protected:
00107
00108 afx_msg void OnKillFocus(CWnd* pNewWnd);
00109 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00110 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00111 afx_msg UINT OnGetDlgCode();
00112
00113 DECLARE_MESSAGE_MAP()
00114
00115 private:
00116 CWnd* m_pParentGC;
00117 int m_nRow;
00118 int m_nColumn;
00119 CString m_sInitText;
00120 UINT m_nLastChar;
00121 BOOL m_bExitOnArrows;
00122 CRect m_Rect;
00123
00124 BOOL m_bInEditModus;
00125 };
00126
00128
00129
00130
00131
00132 #endif // !defined(AFX_GRIDCELLMULTILINE_H__ECD42822_16DF_11D1_992F_895E185F9C72__INCLUDED_)