1
0

AboutDialog.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * AboutDialog.h
  3. * -------------
  4. * Purpose: About dialog with credits, system information and a fancy demo effect.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. OPENMPT_NAMESPACE_BEGIN
  12. class RawGDIDIB;
  13. class CRippleBitmap: public CWnd
  14. {
  15. public:
  16. static constexpr DWORD UPDATE_INTERVAL = 15; // milliseconds
  17. protected:
  18. BITMAPINFOHEADER m_bi;
  19. std::unique_ptr<RawGDIDIB> m_bitmapSrc, m_bitmapTarget;
  20. std::vector<int32> m_offset1, m_offset2;
  21. int32 *m_frontBuf, *m_backBuf;
  22. DWORD m_lastFrame = 0; // Time of last frame
  23. DWORD m_lastRipple = 0; // Time of last added ripple
  24. bool m_frame = false; // Backbuffer toggle
  25. bool m_damp = true; // Ripple damping status
  26. bool m_activity = true; // There are actually some ripples
  27. bool m_showMouse = true;
  28. public:
  29. CRippleBitmap();
  30. ~CRippleBitmap();
  31. bool Animate();
  32. protected:
  33. void OnPaint();
  34. BOOL OnEraseBkgnd(CDC *) { return TRUE; }
  35. void OnMouseMove(UINT nFlags, CPoint point);
  36. void OnMouseHover(UINT nFlags, CPoint point) { OnMouseMove(nFlags, point); }
  37. void OnMouseLeave();
  38. DECLARE_MESSAGE_MAP()
  39. };
  40. class CAboutDlg: public CDialog
  41. {
  42. protected:
  43. CRippleBitmap m_bmp;
  44. CTabCtrl m_Tab;
  45. CEdit m_TabEdit;
  46. UINT_PTR m_TimerID = 0;
  47. static constexpr UINT_PTR TIMERID_ABOUT_DEFAULT = 3;
  48. public:
  49. static CAboutDlg *instance;
  50. ~CAboutDlg();
  51. // Implementation
  52. protected:
  53. BOOL OnInitDialog() override;
  54. void OnOK() override;
  55. void OnCancel() override;
  56. DECLARE_MESSAGE_MAP();
  57. void DoDataExchange(CDataExchange* pDX) override;
  58. afx_msg void OnTabChange(NMHDR *pNMHDR, LRESULT *pResult);
  59. void OnTimer(UINT_PTR nIDEvent);
  60. public:
  61. static mpt::ustring GetTabText(int tab);
  62. };
  63. OPENMPT_NAMESPACE_END