home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / FUNCTION / WNDBOXES.C < prev    next >
C/C++ Source or Header  |  1994-05-04  |  3KB  |  115 lines

  1. #include <WinTen.h>
  2. #include <Windows.h>
  3. #include <ClipApi.h>
  4.  
  5. #define BLACK_PEN  7
  6.  
  7. //---------------------------------------------------------------------------//
  8.  
  9. void WndDrawBox( HDC hDC, RECT * rct, HPEN hPUpLeft, HPEN hPBotRit )
  10. {
  11.    HPEN hOldPen = SelectObject( hDC, hPUpLeft );
  12.  
  13.    MoveTo( hDC, rct->left, rct->bottom );
  14.    LineTo( hDC, rct->left, rct->top );
  15.    LineTo( hDC, rct->right, rct->top );
  16.    SelectObject( hDC, hPBotRit );
  17.    MoveTo( hDC, rct->left, rct->bottom );
  18.    LineTo( hDC, rct->right, rct->bottom );
  19.    LineTo( hDC, rct->right, rct->top - 1 );
  20.    SelectObject( hDC, hOldPen );
  21.  
  22. }
  23.  
  24. //---------------------------------------------------------------------------//
  25.  
  26. void WindowBoxIn( HDC hDC, RECT * pRect )
  27. {
  28.    HPEN hPen = CreatePen( PS_SOLID, 1, RGB( 128, 128, 128 ) );
  29.  
  30.    WndDrawBox( hDC, pRect, hPen, GetStockObject( WHITE_PEN ) );
  31.  
  32.    DeleteObject( hPen );
  33. }
  34.  
  35. //---------------------------------------------------------------------------//
  36.  
  37. void WindowBox( HDC hDC, RECT * pRect )
  38. {
  39.    HPEN hPen = CreatePen( PS_SOLID, 1, RGB( 128, 128, 128 ) );
  40.  
  41.    WndDrawBox( hDC, pRect, GetStockObject( WHITE_PEN ), hPen );
  42.  
  43.    DeleteObject( hPen );
  44. }
  45.  
  46. //---------------------------------------------------------------------------//
  47.  
  48. void WindowRaised( HDC hDC, RECT * pRect )
  49. {
  50.     HPEN hPen = CreatePen( PS_SOLID, 1, RGB( 128, 128, 128 ) );
  51.  
  52.     WndDrawBox( hDC, pRect, GetStockObject( WHITE_PEN ), hPen );
  53.  
  54.     DeleteObject( hPen );
  55. }
  56.  
  57. //---------------------------------------------------------------------------//
  58.  
  59. CLIPPER WNDBOXIN() // hDC, nTop, nLeft, nBottom, nRight
  60. {
  61.    RECT rct;
  62.  
  63.    rct.top    = _parni( 2 );
  64.    rct.left   = _parni( 3 );
  65.    rct.bottom = _parni( 4 );
  66.    rct.right  = _parni( 5 );
  67.  
  68.    WindowBoxIn( _parni( 1 ), &rct );
  69. }
  70.  
  71. //---------------------------------------------------------------------------//
  72.  
  73. CLIPPER WNDBOX() // ( hDC, nTop, nLeft, nBottom, nRight )
  74. {
  75.    RECT rct;
  76.  
  77.    rct.top    = _parni( 2 );
  78.    rct.left   = _parni( 3 );
  79.    rct.bottom = _parni( 4 );
  80.    rct.right  = _parni( 5 );
  81.  
  82.    WndDrawBox( _parni( 1 ), &rct,
  83.                GetStockObject( BLACK_PEN ),
  84.                GetStockObject( BLACK_PEN ) );
  85. }
  86.  
  87. //---------------------------------------------------------------------------//
  88.  
  89. CLIPPER WNDRAISED()  // ( hWnd, hDC )
  90. {
  91.    RECT rct;
  92.  
  93.    GetClientRect( _parni( 1 ), &rct );
  94.    --rct.bottom;
  95.    --rct.right;
  96.  
  97.    WindowRaised( _parni( 2 ), &rct );
  98. }
  99.  
  100. //---------------------------------------------------------------------------//
  101.  
  102. CLIPPER WNDBOXRAIS()  // ED()  //  hDC, nTop, nLeft, nBottom, nRight
  103. {
  104.    RECT rct;
  105.  
  106.    rct.top    = _parni( 2 );
  107.    rct.left   = _parni( 3 );
  108.    rct.bottom = _parni( 4 );
  109.    rct.right  = _parni( 5 );
  110.  
  111.    WindowRaised( _parni( 1 ), &rct );
  112. }
  113.  
  114. //---------------------------------------------------------------------------//
  115.