home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Applications / NeuroSim 1.0.2 / AGA Slider ƒ / Sources / UGrayscaleAppearance.h < prev   
Encoding:
Text File  |  1996-10-14  |  1.8 KB  |  59 lines  |  [TEXT/CWIE]

  1. //
  2. //    UGrayscaleAppearance.h
  3. //
  4. //    Utilities for supporting the Apple Grayscale Appearance for System 7.5
  5. //
  6. //    Note: The Attachments can't paint to the edges of dialogs.
  7. //    For dialogs, use ResEdit to set the Content Color of the WIND's wctb 
  8. //    to ga_Background = { 56797, 56797, 56797 }
  9. //
  10. //    Note: Most references to ga_2 or ga_Background might be ignored since
  11. //    the background will usually have been erased.
  12. // 
  13. //    Copyright © 1996 by James Jennings. All rights reserved.
  14. //
  15.  
  16. #pragma once
  17.  
  18. class UGrayscaleAppearance {
  19.     // really just a namespace for our basic utilities.
  20. public:
  21.     typedef enum {
  22.             ga_White     = 0xF,
  23.             ga_1        = 0xE,
  24.             ga_2        = 0xD,
  25.             ga_3        = 0xC,
  26.             ga_4        = 0xB,
  27.             ga_5        = 0xA,
  28.             ga_6        = 0x9,
  29.             ga_7        = 0x8,
  30.             ga_8        = 0x7,
  31.             ga_9        = 0x6,
  32.             ga_10        = 0x5,
  33.             ga_11        = 0x4,
  34.             ga_12        = 0x2,
  35.             ga_Black    = 0x0,
  36.             ga_Hilite    = ga_White,
  37.             ga_Background = ga_2,
  38.             ga_Shadow    = ga_6
  39.         //    For disclosure triangles, we'll need some blues
  40.         //    ga_A1    = 52428, 52428, 65535 = 0xC, 0xC, 0xF
  41.         //    ga_A2    = 39321, 39321, 65535 = 0x9, 0x9, 0xF
  42.         //    ga_A3    = 26214, 26214, 52428 = 0x6, 0x6, 0xC
  43.         //    ga_A4    = 13107, 13107, 39321 = 0x3, 0x3, 0x9
  44.             } EGAColor;
  45.     static void        GetColor( EGAColor in, RGBColor & out )
  46.                     { out.red = out.green = out.blue = in * 0x1111; }
  47.     static void        SetForeColor( EGAColor in )
  48.                     { RGBColor c; GetColor( in, c ); ::RGBForeColor( &c ); }
  49.     static void        SetBackColor( EGAColor in )
  50.                     { RGBColor c; GetColor( in, c ); ::RGBBackColor( &c ); }
  51.     
  52.     static void        PaintRect( Rect &inFrame, EGAColor inFill )
  53.                     { SetForeColor( inFill ); ::PaintRect( &inFrame ); }
  54.     static void        EraseRect( Rect &inFrame, EGAColor inFill = ga_Background )
  55.                     { SetBackColor( inFill ); ::EraseRect( &inFrame ); }
  56.     static void        FrameRect( const Rect &inFrame, 
  57.                         EGAColor inTopLeft, EGAColor inBottomRight, EGAColor inCorners);
  58. };
  59.