home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / OWLINC.PAK / GAUGE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  2.4 KB  |  80 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1992, 1993 by Borland International
  3. //   include\owl\gauge.h
  4. //   Defines class TGauge.  This defines the basic behavior
  5. //   of gauge controls.
  6. //----------------------------------------------------------------------------
  7. #if !defined(__OWL_GAUGE_H)
  8. #define __OWL_GAUGE_H
  9.  
  10. #if !defined(__OWL_CONTROL_H)
  11.   #include <owl\control.h>
  12. #endif
  13. #if !defined(__OWL_COLOR_H)
  14.   #include <owl\color.h>
  15. #endif
  16.  
  17. //
  18. //  class TGauge
  19. //  ----- ------
  20. //
  21. class _OWLCLASS TGauge : public TControl {
  22.   public:
  23.     TGauge(TWindow*        parent,
  24.            const char far* title,
  25.            int             id,
  26.            int X, int Y, int W, int H,
  27.            BOOL            isHorizontal = TRUE,
  28.            int             margin = 0,
  29.            TModule*        module = 0);
  30.  
  31.     //
  32.     // Getting & setting gauge properties
  33.     //
  34.     void          GetRange(int& min, int& max) const {min = Min; max = Max;}
  35.     int           GetValue() const {return Value;}
  36.     void          SetRange(int min, int max);
  37.     void          SetValue(int value);
  38.     void          SetLed(int spacing, int thickPercent = 90);
  39.     void          SetColor(TColor color) {BarColor = color;}
  40.  
  41.   protected:
  42.  
  43.     //
  44.     // Override TWindow virtual member functions
  45.     //
  46.     void          Paint(TDC& dc, BOOL erase, TRect& rect);
  47.  
  48.     //
  49.     // self sent by method Paint(). override this is if you want to
  50.     // implement a border style that isn't supported
  51.     //
  52.     virtual void   PaintBorder(TDC& dc);
  53.  
  54.     //
  55.     // message response functions
  56.     //
  57.     BOOL          EvEraseBkgnd(HDC);
  58.   
  59.   protected:
  60.     int           Min;        // Minimum value
  61.     int           Max;        // Maximum value
  62.     int           Value;      // Current value
  63.     int           Margin;     // margin between bevel & graphic
  64.     int           IsHorizontal;
  65.     int           LedSpacing; // Spacing of 'leds' in value units
  66.     int           LedThick;   // Thickness of leds in percent of spacing
  67.     TColor        BarColor;   // Bar or LED color, defaults to blue
  68.  
  69.   private:
  70.     //
  71.     // hidden to prevent accidental copying or assignment
  72.     //
  73.     TGauge(const TGauge&);
  74.     TGauge& operator=(const TGauge&);
  75.  
  76.   DECLARE_RESPONSE_TABLE(TGauge);
  77. };
  78.  
  79. #endif  // __OWL_GAUGE_H
  80.