This seems to be working tolerably. Actually we need to use the bitmap. Instead I used gradient to approximate the colors of the bitmap used for the message bar.
Code: Select all
METHOD Paint() CLASS TMsgItem
local nCount, nClrBack
local nLeft := ::nLeft()
local hBmp, nBmpWidth := 0
local hDC := ::oMsgBar:GetDC()
if ::hBitmap1 != nil
hBmp = If( ::lActive, ::hBitmap1, ;
If( ::hBitmap2 != nil, ::hBitmap2, ::hBitmap1 ) )
nBmpWidth = nBmpWidth( hBmp )
DrawMasked( hDC, hBmp, 4, nLeft + 1 )
endif
/*
DrawMsgItem( hDC, ::cMsg,;
{ 5, nLeft + nBmpWidth, ::oMsgBar:nHeight-6, nLeft + ( ::nWidth - 7 ) },;
If( ::lActive, ::nClrText, ::nClrDisabled ),;
::nClrPane, ::oFont:hFont )
*/
Gradient( hDC, { 0, nLeft, ::omsgbar:nHeight / 4, nLeft + ::nWidth },;
nRGB( 227, 239, 255 ), nRGB( 201, 224, 255 ), .T. )
Gradient( hDC, { ( ::omsgbar:nHeight / 4 ) + 1, nLeft, ::omsgbar:nHeight, nLeft + ::nWidth },;
nRGB( 174, 209, 255 ), nRGB( 186, 216, 255 ), .T. )
::oMsgBar:Say( ::oMsgBar:nHeight / 4 - 2,;
nLeft + (::nWidth / 2) - GetTextWidth( hDC,::cMsg ), ::cMsg, ;
iif( ::lActive, ::nClrText, ::nClrDisabled ), ::nClrPane, ; // ::nClrPane is anyway ignored
::oFont, .T., .T. )
// WndBoxIn( hDC, 3, nLeft - 2, ::oMsgBar:nHeight-5, nLeft + ::nWidth - 6 ) // fwh
// WndBoxIn( hDC, 0, nLeft - 8, ::oMsgBar:nHeight - 1, nLeft - 7 ) // silvio
wndboxin( hDc, 0, nLeft-1, ::oMsgBar:nHeight, nLeft ) // present test values
// Instead of the above function I prefer to draw two vertical lines with highlight and dark pens
::oMsgBar:ReleaseDC()
return nil