home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / slider / cslider / cslider.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.8 KB  |  79 lines

  1. #ifndef _CSLIDER_
  2. #define _CSLIDER_
  3. //*********************************************************
  4. // Sliders - Slider Arm Handler Example
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  8. // All Rights Reserved.
  9. //*********************************************************
  10. #include <icslider.hpp>
  11. #include <iframe.hpp>
  12. #include <imcelcv.hpp>
  13. #include <isldahdr.hpp>
  14. #include <isplitcv.hpp>
  15. #include <istattxt.hpp>
  16.  
  17. class ColorWindow : public IFrameWindow {
  18. public:
  19.   ColorWindow ( );
  20.  
  21. ColorWindow
  22.  &setRed        ( unsigned char = 0 ),
  23.  &setGreen      ( unsigned char = 255 ),
  24.  &setBlue       ( unsigned char = 0 ),
  25.  &setBrightness ( unsigned long = 100 );
  26.  
  27. protected:
  28. ColorWindow
  29.  &updateColor            ( unsigned char red,
  30.                            unsigned char green,
  31.                            unsigned char blue ),
  32.  &updateBrightness       ( unsigned long ),
  33.  &showColorAndBrightness ( );
  34.  
  35. private:
  36.   ColorWindow ( const ColorWindow& );
  37. ColorWindow
  38.  &operator=   ( const ColorWindow& );
  39. ISplitCanvas
  40.   canvasClient;
  41. IStaticText
  42.   colorWindow;
  43. IMultiCellCanvas
  44.   sliderCanvas;
  45. ICircularSlider
  46.   brightnessSlider,
  47.   redGreenSlider;
  48.  
  49. class ArmHandler : public ISliderArmHandler{
  50.   public:
  51.     ArmHandler      ( ColorWindow* window );
  52.   protected:
  53.   virtual Boolean
  54.     positionChanged ( IControlEvent& event )
  55.     { return this->valueChange( event ); }
  56.   virtual Boolean
  57.     moving          ( IControlEvent& event )
  58.     { return this->valueChange( event ); }
  59.   virtual Boolean
  60.     valueChange ( IControlEvent& event );
  61.   private:
  62.   ColorWindow
  63.    *colorWindow;
  64.   }; // ColorWindow::ArmHandler
  65.  
  66. friend
  67.   class ArmHandler;
  68. ArmHandler
  69.   fArmHandler;
  70. unsigned char
  71.   fRed,
  72.   fGreen,
  73.   fBlue;
  74. unsigned long
  75.   fBrightness;
  76. }; // ColorWindow
  77.  
  78. #endif // _CSLIDER_
  79.