home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / CPatternProgressBar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.1 KB  |  110 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #pragma once
  20.  
  21. #include <LPane.h>
  22. #include <LString.h>
  23. #include <URegions.h>
  24.  
  25. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  26. //
  27. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  28.  
  29. class CSharedPatternWorld;
  30.  
  31. class CPatternProgressBar : public LPane
  32. {
  33.     public:
  34.  
  35.         enum {
  36.             eIndefinite = -1,
  37.             eSeamless = -2
  38.         };
  39.  
  40.         enum { class_ID = 'PtPb' };
  41.                                 CPatternProgressBar(LStream* inStream);
  42.         virtual                    ~CPatternProgressBar();
  43.  
  44.         virtual    void            SetValue(Int32 inValue);
  45.         virtual    Int32            GetValue(void) const;
  46. //        virtual    void            SetValueRange(const Range32T& inRange);
  47.         virtual    void            SetToIndefinite(void);
  48.         virtual    void            SetSeamless(void);
  49.  
  50.         virtual    void             Draw(RgnHandle inSuperDrawRgnH);
  51.         virtual void            ResizeFrameBy(
  52.                                         Int16             inWidthDelta,
  53.                                         Int16            inHeightDelta,
  54.                                         Boolean            inRefresh);
  55.     protected:
  56.  
  57.         virtual void            ActivateSelf(void);
  58.         virtual void            DeactivateSelf(void);
  59.     
  60.         virtual    void            FinishCreateSelf(void);
  61.         virtual    void            DrawSelf(void);
  62.  
  63.         virtual    void            DrawIndefiniteBar(const Rect& inBounds);
  64.         virtual    void            DrawSeamlessBar(const Rect& inBounds);
  65.         virtual    void            DrawPercentageBar(const Rect& inBounds);
  66.         
  67.         virtual    void            RecalcPoleMasks(void);
  68.  
  69.         Int32                     mValue;
  70.         Uint32                    mValueRange;
  71.  
  72.         Int32                    mPatOffset;
  73.         Int32                    mPatWidth;
  74.  
  75.         CSharedPatternWorld*    mPatternWorld;
  76.         Int16                    mOrientation;
  77.         StRegion                mFillMask;
  78.         StRegion                mTopBevelMask;
  79.         StRegion                mBottomBevelMask;
  80. };
  81.  
  82.  
  83. inline void CPatternProgressBar::SetToIndefinite(void)
  84.     {    SetValue(eIndefinite);            }
  85. inline void CPatternProgressBar::SetSeamless(void)
  86.     {    SetValue(eSeamless);            }    
  87.     
  88.     
  89. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  90. //
  91. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  92.  
  93. class CPatternProgressCaption : public CPatternProgressBar
  94. {
  95.     public:
  96.  
  97.         enum { class_ID = 'PtPc' };
  98.                                 CPatternProgressCaption(LStream* inStream);
  99.     
  100.         virtual void            SetDescriptor(ConstStringPtr inDescriptor);
  101.         virtual void            SetDescriptor(const char* inCDescriptor);
  102.         virtual StringPtr        GetDescriptor(Str255 outDescriptor) const;
  103.  
  104.     protected:    
  105.  
  106.         virtual    void            DrawSelf(void);
  107.  
  108.         TString<Str255>            mText;
  109.         ResIDT                    mTraitsID;
  110. };