inplaceedit.h

来自「一个非常好的WINCE界面」· C头文件 代码 · 共 89 行

H
89
字号
//InPlaceEdit.h
#if !defined(AFX_INPLACEEDIT_H__175AEDFF_731E_4721_8399_DE406A465861__INCLUDED_)
#define AFX_INPLACEEDIT_H__175AEDFF_731E_4721_8399_DE406A465861__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CInPlaceEdit : public CEdit
{
public:
    // Implementation

    // Returns the instance of the class
    static CInPlaceEdit* GetInstance(); 

    // Deletes the instance of the class
    static void DeleteInstance(); 

    // Creates the Windows edit control and attaches it to the object
    // Shows the edit ctrl
    BOOL ShowEditCtrl(DWORD dwStyle, const RECT& rCellRect, CWnd* pParentWnd, 
        UINT uiResourceID, int iRowIndex, int iColumnIndex,
        CString& strValidChars, CString& rstrCurSelection);

    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CInPlaceEdit)
public:
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    //}}AFX_VIRTUAL

    // Attributes
    // afx_msg void OnPaste(WPARAM wParam, LPARAM lParam);

protected: 
    // Generated message map functions
    //{{AFX_MSG(CInPlaceEdit)
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    //}}AFX_MSG

    DECLARE_MESSAGE_MAP()

private:
    // Implementation

    // Constructor
    CInPlaceEdit();

    // Hide the copy constructor and operator =
    CInPlaceEdit (CInPlaceEdit&) {}

    //operator = (CInPlaceEdit) {}
    CInPlaceEdit& operator = (const CInPlaceEdit& a) { return *this; }

    // Destructor
    virtual ~CInPlaceEdit();

    // Attributes

    // Index of the item in the list control
    int m_iRowIndex;

    // Index of the subitem in the list control
    int m_iColumnIndex;

    // To indicate whether ESC key was pressed
    BOOL m_bESC;

    // Valid characters
    CString m_strValidChars;

    // Singleton instance
    static CInPlaceEdit* m_pInPlaceEdit;

    // Previous string value in the edit control
    CString m_strWindowText;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_INPLACEEDIT_H__175AEDFF_731E_4721_8399_DE406A465861__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?