⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seedit.h

📁 一个自定义的SPIN控件
💻 H
字号:
#if !defined(AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)
#define AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// InPlaceEdit.h : header file
//
// Written by Chris Maunder (chrismaunder@codeguru.com)
// Copyright (c) 1998.
//
// The code contained in this file is based on the original
// CInPlaceEdit from http://www.codeguru.com/listview/edit_subitems.shtml
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. If 
// the source code in  this file is used in any commercial application 
// then acknowledgement must be made to the author of this file 
// (in whatever form you wish).
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability for any damage/loss of business that
// this product may cause.
//
// Expect bugs!
// 
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into this
// file. 
//
// ..........................................................................
// CSEEdit is based on Chris Maunder' CInplaceEdit. In order to avoid frequently
// dynamicly creating CInplaceEdit ctrl, I introduced two new member methods
// 1, BOOL CSEEdit::Create( DWORD dwStyle, CWnd* pParentWnd, UINT nID )
//		"Create" Creates and initializes the CSEEdit ctrl. 
// 2, void CSEEdit::ShowAt( DWORD dwStyle, CRect& rect, CString strInit, UINT nFirstChar )
//		"ShowAt" Will make the control be visible in the "CRect& rect" with initial text
//		"strInit". You can change the ctrl's style by passing a valid style in "dwStyle"
// How to use CSEEdit object as inplaced edit ctrl:
// First call the constructor CSEEdit, then call the Create to create the CSEEdit ctrl
// do not including WS_VISIBLE style in "dwStyle". Call "ShowAt " method to show the ctrl
// at "CRect rect". If you create the CSEEdit object on the heap by using "new" function,
// you must call delete to destruct the object.
//										huangchaoyi@263.net
// ..........................................................................
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// CSEEdit window
 
class CSEEdit : public CEdit
{
	DECLARE_DYNCREATE(CSEEdit)
// Construction
public:
	CSEEdit();

    BOOL Create( DWORD dwStyle, CWnd* pParentWnd, UINT nID );

// Attributes
public:
 
// Operations
public:
	void EndEdit(CWnd* pNewWnd);
	void ShowAt( DWORD dwStyle, CRect rect, CString strInit, UINT nFirstChar );

// Overrides
     // ClassWizard generated virtual function overrides
     //{{AFX_VIRTUAL(CSEEdit)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);	
	//}}AFX_VIRTUAL
 
// Implementation
public:
     virtual ~CSEEdit();
 
// Generated message map functions
protected:
    //{{AFX_MSG(CSEEdit)
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
    DECLARE_MESSAGE_MAP()

protected:
    UINT    m_nLastChar;
    CString m_sInitText;
};
 
/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)

⌨️ 快捷键说明

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