Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
914 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IDLE_DIALOG_H
  8. #define IDLE_DIALOG_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "win_idle.h"
  13. //
  14. // This is a base class that provides in-thread idle processing.
  15. //
  16. // To use it:
  17. // 1. derive from it
  18. // 2. Change your message map to point at this class instead of CDialog
  19. // 3. Call StartIdleProcessing to begin receiving idle calls.
  20. // 4. Override OnIdle().
  21. //
  22. class CIdleDialog : public CDialog
  23. {
  24. public:
  25. CIdleDialog( int id, CWnd *pParent );
  26. // Call this to start the idle processing.
  27. void StartIdleProcessing( DWORD msInterval );
  28. virtual void OnIdle() = 0;
  29. private:
  30. DECLARE_MESSAGE_MAP()
  31. afx_msg LONG OnStartIdle(UINT, LONG);
  32. CWinIdle m_cWinIdle;
  33. };
  34. #endif // IDLE_DIALOG_H