DXEdit.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: DXEdit.h
- #ifndef _DXEDIT__H
- #define _DXEDIT__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #include "DXSpriteButton.h"
- class CDDTextSurface;
- class CDXIMDBar;
- class CDXEdit : public CDXSpriteButton
- {
- public:
- CDXEdit(void);
- virtual ~CDXEdit();
- public:
- bool Create(int nMaxLen,
- LPCTSTR lpszEditFontName,
- int nEditFontSize,
- COLORREF clrNormalText,
- COLORREF clrFocusedText,
- COLORREF clrBack,
- LPCTSTR lpszCaretName,
- int nLeft,
- int nTop,
- LPCRECT lprcBounds,
- CDXDialog* pParent,
- CDSBuffer* pSoundFocused,
- CDDDevice* pDDDevice,
- LPCTSTR lpszBMPName,
- CPackFileManager* pPackFileManager = NULL,
- bool bTrans = false,
- int nHoriBlocks = DXBUTTON_NUMBER_STATE);
- public:
- virtual void OnLButtonDown(int nMouseX, int nMouseY);
- virtual bool OnKeyDown(CDIKeyState* pKeyState);
- virtual void Draw(CDDSurface* pDestSurface);
- public:
- void SetText(LPCTSTR lpszText);
- CString GetText(void) const;
- protected:
- CDXSprite* m_pCaret;
- UINT m_uiLastBlinkTime;
- protected:
- CDXIMDBar* m_pDXIMDBar;
- bool m_bEnableIMD;
- CDDTextSurface* m_pTextSurface;
- CFont m_fontEdit;
- TCHAR* m_pData;
- int m_nMaxLen;
- int m_nCurPos;
- bool m_bInsertMode;
- COLORREF m_clrNormalText;
- COLORREF m_clrFocusedText;
- CRect m_rcText;
- int m_nCharWidth;
- int m_nCharHeight;
- protected:
- void DrawCaret(CDDSurface* pDestSurface);
- bool IsDBCSTrailByte(const char* pBase, const char* pCur) const;
- void StoreChar(TCHAR ch);
- void StoreDBCSChar(WORD wDBCSChar);
- private:
- WORD m_wDBCSChar;
- };
- #endif // _DXEDIT__H