00001 #if !defined(AFX_GRIDCELLCOMBO_H__ECD42822_16DF_11D1_992F_895E185F9C72__INCLUDED_)
00002 #define AFX_GRIDCELLCOMBO_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
00035
00036 class CGridCellCombo : public CGridCell
00037 {
00038 friend class CGridCtrl;
00039 DECLARE_DYNCREATE(CGridCellCombo)
00040
00041 public:
00042 CGridCellCombo();
00043
00044
00045 public:
00046 virtual BOOL Edit(int nRow, int nCol, CRect rect, CPoint point, UINT nID, UINT nChar);
00047 virtual CWnd* GetEditWnd() const;
00048 virtual void EndEdit();
00049
00050
00051 public:
00052 virtual CSize GetCellExtent(CDC* pDC);
00053
00054
00055 public:
00056 void SetOptions(CStringArray& ar);
00057 void SetStyle(DWORD dwStyle) { m_dwStyle = dwStyle; }
00058 DWORD GetStyle() { return m_dwStyle; }
00059
00060 protected:
00061 virtual BOOL Draw(CDC* pDC, int nRow, int nCol, CRect rect, BOOL bEraseBkgnd = TRUE);
00062
00063 CStringArray m_Strings;
00064 DWORD m_dwStyle;
00065 };
00066
00067
00068
00070
00071
00072 #define IDC_COMBOEDIT 1001
00073
00074 class CComboEdit : public CEdit
00075 {
00076
00077 public:
00078 CComboEdit();
00079
00080
00081 public:
00082
00083
00084 public:
00085
00086
00087
00088
00089 virtual BOOL PreTranslateMessage(MSG* pMsg);
00090
00091
00092
00093 public:
00094 virtual ~CComboEdit();
00095
00096
00097 protected:
00098
00099 afx_msg void OnKillFocus(CWnd* pNewWnd);
00100 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00101 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00102
00103
00104 DECLARE_MESSAGE_MAP()
00105 };
00106
00108
00109
00110 class CInPlaceList : public CComboBox
00111 {
00112 friend class CComboEdit;
00113
00114
00115 public:
00116 CInPlaceList(CWnd* pParent,
00117 CRect& rect,
00118 DWORD dwStyle,
00119 UINT nID,
00120 int nRow, int nColumn,
00121 COLORREF crFore, COLORREF crBack,
00122 CStringArray& Items,
00123 CString sInitText,
00124 UINT nFirstChar);
00125
00126
00127 public:
00128 CComboEdit m_edit;
00129
00130
00131 public:
00132
00133
00134
00135
00136 protected:
00137 virtual void PostNcDestroy();
00138
00139
00140
00141 public:
00142 virtual ~CInPlaceList();
00143 void EndEdit();
00144
00145 protected:
00146 int GetCorrectDropWidth();
00147
00148
00149 protected:
00150
00151 afx_msg void OnKillFocus(CWnd* pNewWnd);
00152 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00153 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00154 afx_msg void OnDropdown();
00155 afx_msg UINT OnGetDlgCode();
00156 afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
00157
00158
00159
00160 DECLARE_MESSAGE_MAP()
00161
00162 private:
00163 int m_nNumLines;
00164 CString m_sInitText;
00165 int m_nRow;
00166 int m_nCol;
00167 UINT m_nLastChar;
00168 BOOL m_bExitOnArrows;
00169 COLORREF m_crForeClr, m_crBackClr;
00170 };
00171
00173
00174
00175
00176
00177 #endif // !defined(AFX_GRIDCELLCOMBO_H__ECD42822_16DF_11D1_992F_895E185F9C72__INCLUDED_)