93 lines
1.8 KiB
C++
93 lines
1.8 KiB
C++
#ifndef _TGAXISGRIDLISTCTRL_H__
|
|
#define _TGAXISGRIDLISTCTRL_H__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "afxtempl.h"
|
|
#include "InPlaceComboBox.h"
|
|
|
|
#define WM_EDIT_MESSAGE (WM_USER+101)
|
|
#define WM_ITEMEDITED WM_USER + 0X1004
|
|
|
|
class KTAxisGridEdit : public CEdit
|
|
{
|
|
public:
|
|
virtual BOOL PreTranslateMessage(MSG* pMsg)
|
|
{
|
|
if(pMsg->message == WM_KEYDOWN)
|
|
{
|
|
int nVK = (int)pMsg->wParam;
|
|
if(nVK == VK_RETURN || nVK == VK_SPACE || nVK == 0xBC)
|
|
{
|
|
GetParent()->SendMessage(WM_COMMAND,
|
|
MAKELPARAM(GetDlgCtrlID(), WM_EDIT_MESSAGE),
|
|
(LPARAM)GetSafeHwnd());
|
|
int nEndChar = LineLength();
|
|
SetSel(nEndChar, nEndChar);
|
|
return TRUE;
|
|
}
|
|
}
|
|
return CEdit::PreTranslateMessage(pMsg);
|
|
}
|
|
};
|
|
|
|
class KTAxisGridListCtrl : public CListCtrl
|
|
{
|
|
public:
|
|
KTAxisGridListCtrl();
|
|
virtual ~KTAxisGridListCtrl();
|
|
|
|
public:
|
|
|
|
//ÉèÖÃÖ»¶ÁµÄÁÐ
|
|
void SetReadOnlyColum(int nCol){m_arReadOnlyCol.Add(nCol);}
|
|
|
|
void DoInsert();
|
|
|
|
void DoDelete();
|
|
|
|
void DoCut();
|
|
|
|
void DoCopy();
|
|
|
|
void DoPaste();
|
|
|
|
public:
|
|
//{{AFX_VIRTUAL(KTAxisGridListCtrl)
|
|
//}}AFX_VIRTUAL
|
|
|
|
protected:
|
|
//{{AFX_MSG(KTAxisGridListCtrl)
|
|
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
|
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
|
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
|
afx_msg void OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult);
|
|
//}}AFX_MSG
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
private:
|
|
|
|
void HitItemTest(CPoint &point);
|
|
|
|
int HitTestEx(CPoint &point, int *col) const;
|
|
|
|
BOOL InReadOnlyColumn(int nCol);
|
|
|
|
BOOL SetClipboardText(LPTSTR lpszBuffer);
|
|
|
|
BOOL GetClipboardText(LPTSTR& lpszBuffer);
|
|
|
|
void EditSubLabel(int nItem, int nCol);
|
|
|
|
private:
|
|
CInPlaceComboBox *m_pComboBox;
|
|
CArray<int,int> m_arReadOnlyCol;
|
|
public:
|
|
int m_nInitFlag;
|
|
};
|
|
|
|
//{{AFX_INSERT_LOCATION}}
|
|
#endif
|