DXDialog.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: DXDialog.h
- #ifndef _DXDIALOG__H
- #define _DXDIALOG__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #include <afxtempl.h>
- #include "DXButton.h"
- #include "DIMouseState.h"
- class CDXGUIManager;
- class CDXDialog : public CDXButton
- {
- public:
- enum DXDIALOG_TYPE
- {
- DXDIALOG_MENU,
- DXDIALOG_MODAL,
- };
- public:
- CDXDialog(void);
- virtual ~CDXDialog();
- public:
- bool Create(
- CDXGUIManager* pGUIManager,
- int nCursorIndex,
- DXDIALOG_TYPE DialogType = DXDIALOG_MODAL);
- public:
- virtual bool IsPointIn(int nX, int nY);
- virtual void ClientToScreen(int& nX, int& nY);
- virtual void ClientToScreen(LPRECT lprcClient, RECT& rcScreen);
- virtual void ScreenToClient(int& nX, int& nY);
- bool Insert(CDXButton* pDXButton);
- virtual void Draw(CDDSurface* pDestSurface);
- virtual void DrawDialog(CDDSurface* pDestSurface);
- public:
- void Update(void);
- int GetButtonNumber() const;
- virtual void OnOK(void);
- virtual void OnCancel(void);
- virtual bool OnButtonAction(int nID);
- bool Popup(void);
- bool Hide(void);
- protected:
- void OnKeyUpdate(CDXButton* pButton);
- protected:
- CTypedPtrArray<CObArray, CDXButton*> m_dxButtonArray;
- int m_nCursorIndex;
- CDXGUIManager* m_pGUIManager;
- CDIMouseState::MOUSE_BUTTON_STATE m_MouseButtonStateLast;
- public:
- DXDIALOG_TYPE m_DialogType;
- protected:
- int m_nLastX;
- int m_nLastY;
- public:
- #ifdef _DEBUG
- static ULONG m_ulDialogCounter;
- #endif // _DEBUG
- };
- #endif // _DXDIALOG__H