home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / LProgressIndicator & Friends / LProgressIndicator / LProgressIndicatorProxy.h < prev   
Encoding:
C/C++ Source or Header  |  1996-04-18  |  1.3 KB  |  71 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        LProgressIndicatorProxy.h
  3.  
  4.     Contains:    Subclass of LProgressIndicator which forwards all
  5.                 method calls to a different caller-specified
  6.                 LProgressIndicator subclass.
  7.                 
  8.     Version:    2.1
  9.  
  10.     Author:        Chris K. Thomas, ckt@best.com
  11.     
  12.     Copyright:    ©1995 Chris K. Thomas.  All Rights Reserved.
  13. */
  14.  
  15. #include "LProgressIndicator.h"
  16.  
  17. class LProgressIndicatorProxy:
  18.     public LProgressIndicator
  19. {
  20.     LProgressIndicator *mProxyTarget;
  21.     
  22. public:
  23.  
  24.     LProgressIndicatorProxy()
  25.     {
  26.         mProxyTarget = nil;
  27.     }
  28.     
  29.     LProgressIndicatorProxy(LProgressIndicator *inProxyTarget)
  30.     {
  31.         mProxyTarget = inProxyTarget;
  32.     }
  33.  
  34. //
  35. // ValueChanged implementation forwards all
  36. // value changes to mProxyTarget.  Note that if
  37. // we were called from CompletedThisMuch, all
  38. // necessary thresholding is already done on
  39. // the curValue, so calling ValueChanged
  40. // directly is OK.
  41. //
  42.  
  43.     virtual void ValueChanged()
  44.     {
  45.         if(mProxyTarget)
  46.         {
  47.             mProxyTarget->mMinValue = mMinValue;
  48.             mProxyTarget->mMaxValue = mMaxValue;
  49.             mProxyTarget->mCurValue = mCurValue;
  50.             mProxyTarget->ValueChanged();
  51.         }
  52.     }
  53.     
  54.     virtual void SetProxyTarget(LProgressIndicator *inProxyTarget)
  55.     {
  56.         mProxyTarget = inProxyTarget;
  57.     }
  58.     
  59.     virtual LProgressIndicator *GetProxyTarget()
  60.     {
  61.         return mProxyTarget;
  62.     }
  63.     
  64.     virtual void SetTaskType(ETaskType inTaskType)
  65.     {
  66.         if(mProxyTarget)
  67.             mProxyTarget->SetTaskType(inTaskType);
  68.     }
  69. };
  70.  
  71.