MyBmpButton2.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #if !defined(AFX_MyBmpButton2_H__0DC23CE7_0F12_4F9D_8999_405748E72736__INCLUDED_)
  2. #define AFX_MyBmpButton2_H__0DC23CE7_0F12_4F9D_8999_405748E72736__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // MyBmpButton2.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. // MyBmpButton2 window CBitmapButton
  10. #include "shockwaveflash.h"
  11. //#include "ImageEx.h"
  12. class MyBmpButton2 : public CButton
  13. {
  14. BYTE m_blbottomdown;
  15. BOOL m_bPushDown;
  16. BOOL m_bSupportLX;
  17. DECLARE_DYNAMIC(MyBmpButton2)
  18. // Construction
  19. public:
  20. CString m_childpath;
  21. MyBmpButton2();
  22. void SizeToContent();
  23. void ReadBmp(BYTE **pData, CShockwaveFlash *pFlash, CWnd *pParent);
  24. void ReadBmpbak(BYTE **pData);
  25. BOOL AutoLoad(UINT nID, CWnd* pParent);
  26. BOOL LoadBitmaps(UINT lpszBitmapResource,UINT lpszBitmapResourceSel, UINT lpszBitmapResourceFocus,UINT lpszBitmapResourceDisabled);
  27. // Attributes
  28. public:
  29. DWORD m_bmpcount;
  30. Image *m_bmp;
  31. Image *m_bmpfocus;
  32. Image *m_bmpfocused;
  33. Image *m_bmpdisable;
  34. Image *m_bmpbak;
  35. Image *m_bmpfocusbak;
  36. Image *m_bmpfocusedbak;
  37. Image *m_bmpdisablebak;
  38. // ImageEx *m_bmpex;
  39. BYTE *m_bmpex;
  40. CShockwaveFlash m_flashctrl;
  41. // Operations
  42. public:
  43. // Overrides
  44. // ClassWizard generated virtual function overrides
  45. //{{AFX_VIRTUAL(MyBmpButton2)
  46. //}}AFX_VIRTUAL
  47. // Implementation
  48. public:
  49. void ReDrawParent();
  50. void SetLX();
  51. BOOL GetPushDown();
  52. void ChangePic(Image *img1, Image *img2, Image *img3, Image *img4);
  53. BOOL IsPushDown(){return m_bPushDown;}
  54. void SetPushDown(BOOL bPushDown=1);
  55. void DelOrigin();
  56. static void SaveFlash(BYTE *pData, DWORD leng, CString path=_T("") );
  57. void ReadBmp2(BYTE **pData, BYTE **pDes, DWORD &leng);
  58. static void ReadBK(BYTE **pData, BYTE **pDes, DWORD &leng);
  59. void Deletebak();
  60. void ReDraw();
  61. void SetSel(BOOL bSel);
  62. void MyDrawItem();
  63. int GetHeight(CBitmap *bmp);
  64. int GetWidth(CBitmap *bmp);
  65. virtual ~MyBmpButton2();
  66. // Generated message map functions
  67. protected:
  68. //{{AFX_MSG(MyBmpButton2)
  69. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  70. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  71. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  72. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  73. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  74. afx_msg void OnTimer(UINT nIDEvent);
  75. //}}AFX_MSG
  76. virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
  77. DECLARE_MESSAGE_MAP()
  78. };
  79. /////////////////////////////////////////////////////////////////////////////
  80. //{{AFX_INSERT_LOCATION}}
  81. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  82. #endif // !defined(AFX_MyBmpButton2_H__0DC23CE7_0F12_4F9D_8999_405748E72736__INCLUDED_)