home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / oleview / shadow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  4.4 KB  |  118 lines

  1. /*
  2.  * These defines are used in the uiFlags and uiStyle parameters to
  3.  * the TDUTIL functions.
  4.  */
  5.  
  6. // This is a part of the Microsoft Foundation Classes C++ library.
  7. // Copyright (C) 1992-1998 Microsoft Corporation
  8. // All rights reserved.
  9. //
  10. // This source code is only intended as a supplement to the
  11. // Microsoft Foundation Classes Reference and related
  12. // electronic documentation provided with the library.
  13. // See these sources for detailed information regarding the
  14. // Microsoft Foundation Classes product.
  15.  
  16. #define DRAW3D_IN           0x0100     // effect looks indented
  17. #define DRAW3D_OUT          0x0200     // effect 'sticks out'
  18. #define DRAW3D_CREASE       0x0400     // for that 'creased' look
  19.  
  20. #define DRAW3D_TOPLINE      0x0800
  21. #define DRAW3D_BOTTOMLINE   0x1000
  22. #define DRAW3D_LEFTLINE     0x2000
  23. #define DRAW3D_RIGHTLINE    0x4000
  24.  
  25. /*
  26.  * Very useful set of macros for dealing with the 'base' 16 colors
  27.  */
  28. #ifndef _RGB_H_
  29. #define _RGB_H_
  30.    #define RGBBLACK     RGB(0,0,0)
  31.    #define RGBRED       RGB(128,0,0)
  32.    #define RGBGREEN     RGB(0,128,0)
  33.    #define RGBBLUE      RGB(0,0,128)
  34.    #define RGBBROWN     RGB(128,128,0)
  35.    #define RGBMAGENTA   RGB(128,0,128)
  36.    #define RGBCYAN      RGB(0,128,128)
  37.    #define RGBLTGRAY    RGB(192,192,192)
  38.    #define RGBGRAY      RGB(128,128,128)
  39.    #define RGBLTRED     RGB(255,0,0)
  40.    #define RGBLTGREEN   RGB(0,255,0)
  41.    #define RGBLTBLUE    RGB(0,0,255)
  42.    #define RGBYELLOW    RGB(255,255,0)
  43.    #define RGBLTMAGENTA RGB(255,0,255)
  44.    #define RGBLTCYAN    RGB(0,255,255)
  45.    #define RGBWHITE     RGB(255,255,255)
  46. #endif
  47.  
  48. /* tdDraw3DRect()
  49.  *
  50.  * Draws a rectangle (non-filled) that has 3D effects.
  51.  *
  52.  *    lprc     Defines the rectangle in client coordinates
  53.  *    uiWidth  Specifies the width of the lines that make up the rectangle.
  54.  *    wFlags   Either DRAW3D_IN or DRAW3D_OUT.  May be combined with
  55.  *             DRAW3D_CREASED (uiWidth is ignored).
  56.  */
  57. VOID WINAPI tdDraw3DRect( HDC hdc, LPRECT lprc, UINT uiWidth, UINT wFlags );
  58.  
  59. /* tdDraw3DLine()
  60.  *
  61.  * Draws a component of a 3D rectangle.  The tdDraw3DRect() function uses
  62.  * this function to draw the rectangles.  This function is optimized
  63.  * for speed.  For one pixel wide lines it uses ExtTextOut(), for others
  64.  * it use Polygon() ('cause line ends are not square).
  65.  *
  66.  *    x, y     Defines the line in client coordinates
  67.  *    uiWidth   Specifies the width of the lines that make up the rectangle.
  68.  *    wFlags   May be a combination of either DRAW3D_IN or DRAW3D_OUT and
  69.  *             DRAW3D_TOP, DRAW3D_LEFT, DRAW3D_BOTTOM, or DRAW3D_RIGHT.
  70.  */
  71. VOID WINAPI tdDraw3DLine( HDC hdc, UINT x, UINT y, UINT nLen, UINT uiWidth, UINT wFlags );
  72.  
  73.  
  74. /* tdDrawFaceFrame()
  75.  *
  76.  * Draws a rectangle using the current background color.  This function
  77.  * is useful for drawing fast rectangles (it' uses ExtTextOut() for speed).
  78.  *
  79.  * Restrictions are that it does not do patterned lines, or fill the
  80.  * rectangle.  But it's a hell of a lot faster than Rectangle().
  81.  *
  82.  * tdDrawRect() is really a macro that calls tdDrawFaceFrame() which
  83.  * is mis-named (blame curtisp).
  84.  */
  85. #define tdDrawRect tdDrawFaceFrame
  86. VOID WINAPI tdDrawFaceFrame( HDC hdc, LPRECT lprc, UINT uiWidth );
  87.  
  88.  
  89. /* tdDraw3DCrease()
  90.  *
  91.  * Draws a 3D 'crease' effect using the specified rectangle.  This
  92.  * effect is often used for 3d group boxes.  uiFlags dictates whether
  93.  * the crease is indented (DRAW3D_IN) or sticks out (DRAW_3DOUT).
  94.  */
  95. VOID WINAPI tdDraw3DCrease( HDC hdc, LPRECT lprc, UINT uiFlags ) ;
  96.  
  97. /* tdGetHighlightColor()
  98.  *
  99.  * TDUTIL uses the concept of a normal color, highlight color, and shadow
  100.  * color to do it's drawing.  Both the highlight color and shadow colors
  101.  * are derived from the normal color.  This function takes a 'normal'
  102.  * color, and returns the appropriate highlight color.
  103.  *
  104.  * For example if RGBLTGRAY is passed in as rgb, RGBWHITE will be returned.
  105.  */
  106. COLORREF WINAPI tdGetHighlightColor( COLORREF rgb ) ;
  107.  
  108. /* tdGetShadowColor()
  109.  *
  110.  * TDUTIL uses the concept of a normal color, highlight color, and shadow
  111.  * color to do it's drawing.  Both the highlight color and shadow colors
  112.  * are derived from the normal color.  This function takes a 'normal'
  113.  * color, and returns the appropriate shadow color.
  114.  *
  115.  * For example if RGBLTGRAY is passed in as rgb, RGBGRAY will be returned.
  116.  */
  117. COLORREF WINAPI tdGetShadowColor( COLORREF rgb ) ;
  118.