home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / CLASSES / MSGBAR.PRG < prev    next >
Text File  |  1994-06-12  |  2KB  |  75 lines

  1. #include "FiveWin.ch"
  2.  
  3. #define COLOR_BTNFACE   15
  4. #define COLOR_BTNSHADOW 16
  5.  
  6. static lRegistered := .f.
  7.  
  8. //----------------------------------------------------------------------------//
  9.  
  10. CLASS TMsgBar FROM TWindow
  11.  
  12.    DATA   cMsgDef
  13.    DATA   lCentered
  14.  
  15.    METHOD New( oWnd, cPrompt, lCentered ) CONSTRUCTOR
  16.    METHOD Adjust()
  17.                                                                // erase
  18.    METHOD Paint() INLINE MsgPaint( ::hWnd, ::cMsg, ::cMsgDef, .t.,;
  19.                                    ::lCentered )
  20.  
  21.    METHOD SetMsg( cText )
  22.  
  23.  
  24. ENDCLASS
  25.  
  26. //----------------------------------------------------------------------------//
  27.  
  28. METHOD New( oWnd, cPrompt, lCentered ) CLASS TMsgBar
  29.  
  30.    local oRect := oWnd:GetCliRect()
  31.  
  32.    DEFAULT cPrompt := "", lCentered := .f.
  33.  
  34.    ::nClrPane  = COLOR_BTNFACE + 1
  35.    ::oWnd      = oWnd
  36.    ::cMsg := ::cMsgDef  := cPrompt
  37.    ::nStyle    = nOR( WS_VISIBLE, WS_CHILD, WS_OVERLAPPED, WS_BORDER )
  38.    ::nLeft     = -1
  39.    ::nTop      = oRect:nBottom - 25
  40.    ::nBottom   = oRect:nBottom
  41.    ::nRight    = oRect:nRight  + 1
  42.    ::oBrush    = TBrush():New( , nRGB( 192, 192, 192 ), )
  43.    ::lCentered = lCentered
  44.  
  45.    if ! lRegistered
  46.       ::Register()
  47.       lRegistered = .t.
  48.    endif
  49.  
  50.    ::Create()
  51.  
  52. return nil
  53.  
  54. //----------------------------------------------------------------------------//
  55.  
  56. METHOD Adjust() CLASS TMsgBar
  57.  
  58.    local rctParent := ::oWnd:GetCliRect()
  59.  
  60.    ::SetCoors( TRect():New( rctParent:nBottom - 25, rctParent:nLeft - 1,;
  61.                             rctParent:nBottom, rctParent:nRight ) )
  62. return nil
  63.  
  64. //----------------------------------------------------------------------------//
  65.  
  66. METHOD SetMsg( cText ) CLASS TMsgBar
  67.  
  68.    if cText != ::cMsg
  69.       MsgPaint( ::hWnd, ::cMsg := cText, ::cMsgDef, .f., ::lCentered )
  70.    endif
  71.  
  72. return nil
  73.  
  74. //----------------------------------------------------------------------------//
  75.