home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / CGAStatusBar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.5 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. #ifndef __H_CGAStatusBar
  20. #define __H_CGAStatusBar
  21. #pragma once
  22.  
  23. /*======================================================================================
  24.     AUTHOR:            Ted Morris - 01 NOV 96
  25.  
  26.     DESCRIPTION:    Implements a class for drawing a status bar and associated status
  27.                     text.
  28.                     
  29.                     If the mUserCon is negative, specifies the width of the status bar
  30.                     in pixels. If positive, specifies a percentage (0..100) of the width
  31.                     of the pane for the width of the status bar.
  32.                     
  33.     MODIFICATIONS:
  34.  
  35.     Date            Person            Description
  36.     ----            ------            -----------
  37. ======================================================================================*/
  38.  
  39.  
  40. /*====================================================================================*/
  41.     #pragma mark INCLUDE FILES
  42. /*====================================================================================*/
  43.  
  44. #include <LGABox.h>
  45.  
  46.  
  47. /*====================================================================================*/
  48.     #pragma mark TYPEDEFS
  49. /*====================================================================================*/
  50.  
  51.  
  52. /*====================================================================================*/
  53.     #pragma mark CONSTANTS
  54. /*====================================================================================*/
  55.  
  56.  
  57. /*====================================================================================*/
  58.     #pragma mark CLASS DECLARATIONS
  59. /*====================================================================================*/
  60.  
  61. #pragma mark -
  62.  
  63. class CGAStatusBar : protected LGABox {
  64.  
  65. #if !defined(__MWERKS__) || (__MWERKS__ >= 0x2000)
  66.     typedef LGABox inherited;
  67. #endif
  68.                   
  69. public:
  70.  
  71.                         enum { class_ID = 'Gbar' };
  72.  
  73.                         CGAStatusBar(LStream *inStream);
  74.     virtual                ~CGAStatusBar(void);
  75.  
  76.     virtual    StringPtr    GetDescriptor(Str255 outDescriptor) const;
  77.     virtual    void        SetDescriptor(ConstStr255Param inDescriptor);
  78.  
  79.     virtual    Int32        GetValue(void) const;
  80.     
  81.                         enum { eIndefiniteValue = -1, eHiddenValue = -2, 
  82.                                eMaxValue = 100, eMinValue = 0,
  83.                                eMaxIndefiniteIndex = 15 };
  84.     virtual    void        SetValue(Int32 inValue);
  85.  
  86. protected:
  87.  
  88.     virtual    void        DrawBoxTitle(void);
  89.     virtual    void        DrawColorBorder(const Rect &inBorderRect,
  90.                                         EGABorderStyle inBorderStyle);
  91.     virtual    void        DrawBlackAndWhiteBorder(const Rect &inBorderRect,
  92.                                                 EGABorderStyle inBorderStyle);
  93.     void                DrawProgressBar(const Rect &inBorderRect, Boolean inUseColor);
  94.  
  95.  
  96.     virtual    void        CalcBorderRect(Rect &outRect);
  97.     virtual    void        CalcContentRect(Rect &outRect);
  98.     virtual    void        CalcTitleRect(Rect &outRect);
  99.     
  100.     // Instance variables
  101.     
  102.     Int16                mValue;
  103.     Int16                mCurIndefiniteIndex;
  104.     PixPatHandle        mIndefiniteProgessPatH;
  105.     UInt32                mNextIndefiniteDraw;
  106. };
  107.  
  108.  
  109. #endif // __H_CGAStatusBar
  110.