Source code of Windows XP (NT5)
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.

66 lines
932 B

  1. // Copyright (C) 1997 Microsoft Corporation
  2. //
  3. // Progress Indicator class
  4. //
  5. // 12-29-97 sburns
  6. #include "headers.hxx"
  7. #include "indicate.hpp"
  8. ProgressIndicator::ProgressIndicator(
  9. HWND parentDialog,
  10. int messageTextResID)
  11. :
  12. parentDialog(parentDialog_)
  13. {
  14. LOG_CTOR(ProgressIndicator);
  15. ASSERT(Win::IsWindow(parentDialog));
  16. ASSERT(messageTextResID > 0);
  17. messageText = Win::GetDlgItem(parentDialog, messageTextResID);
  18. ASSERT(Win::IsWindow(messageText));
  19. showState = true;
  20. showControls(false);
  21. }
  22. ProgressIndicator::~ProgressIndicator()
  23. {
  24. LOG_DTOR(ProgressIndicator);
  25. }
  26. void
  27. ProgressIndicator::Update(const String& message)
  28. {
  29. showControls(true);
  30. Win::SetWindowText(messageText, message);
  31. }
  32. void
  33. ProgressIndicator::showControls(bool newState)
  34. {
  35. if (newState != showState)
  36. {
  37. Win::ShowWindow(messageText, newState);
  38. showState = newState;
  39. }
  40. }