DXDialog.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1998-1999 DXGuide.  All Rights Reserved.
  2. // File: DXDialog.h
  3. #ifndef _DXDIALOG__H
  4. #define _DXDIALOG__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #include <afxtempl.h>
  9. #include "DXButton.h"
  10. #include "DIMouseState.h"
  11. class CDXGUIManager;
  12. class CDXDialog : public  CDXButton
  13. {
  14. public:
  15. enum DXDIALOG_TYPE
  16. {
  17. DXDIALOG_MENU,
  18. DXDIALOG_MODAL,
  19. };
  20. public:
  21. CDXDialog(void);
  22. virtual ~CDXDialog();
  23. public:
  24. bool Create(
  25. CDXGUIManager*  pGUIManager,
  26. int  nCursorIndex,
  27. DXDIALOG_TYPE  DialogType = DXDIALOG_MODAL);
  28. public:
  29. virtual bool IsPointIn(int  nX, int  nY);
  30. virtual void ClientToScreen(int&  nX, int&  nY);
  31. virtual void ClientToScreen(LPRECT  lprcClient, RECT&  rcScreen);
  32. virtual void ScreenToClient(int&  nX, int&  nY);
  33. bool Insert(CDXButton*  pDXButton);
  34. virtual void Draw(CDDSurface*  pDestSurface);
  35. virtual void DrawDialog(CDDSurface*  pDestSurface);
  36. public:
  37. void Update(void);
  38. int GetButtonNumber() const;
  39. virtual void OnOK(void);
  40. virtual void OnCancel(void);
  41. virtual bool OnButtonAction(int  nID);
  42. bool Popup(void);
  43. bool Hide(void);
  44. protected:
  45. void OnKeyUpdate(CDXButton*  pButton);
  46. protected:
  47. CTypedPtrArray<CObArray, CDXButton*> m_dxButtonArray;
  48. int m_nCursorIndex;
  49. CDXGUIManager* m_pGUIManager;
  50. CDIMouseState::MOUSE_BUTTON_STATE m_MouseButtonStateLast;
  51. public:
  52. DXDIALOG_TYPE m_DialogType;
  53. protected:
  54. int m_nLastX;
  55. int m_nLastY;
  56. public:
  57. #ifdef _DEBUG
  58. static ULONG m_ulDialogCounter;
  59. #endif // _DEBUG
  60. };
  61. #endif // _DXDIALOG__H