SET MESSAGE ERROR

SET MESSAGE ERROR

Postby Silvio » Tue Dec 18, 2007 1:27 am

Dear Antonio,

Image


I have only modify on the method paint tmsgitem this line

Code: Select all  Expand view

WndBoxIn( hDC, 0, nLeft - 8, ::oMsgBar:nHeight - 1, nLeft - 7 )



and on the application I insert this command
Code: Select all  Expand view
SET MESSAGE OF ::oWndMain TO  ::cAppName NOINSET  2007


the message are not trasparent

On the tmsgiten original NOT run ok the command NOINSET ...why ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Tue Dec 18, 2007 9:38 am

Silvio,

You may use SetBkMode( hDC, TRANSPARENT ) in function DRAWMSGITEM(), but the problem is that the background will not be erased, when you change the msgitem text.

We need to fix it, copying the portion of the msgbar image where the item is (using BitBlt()) to the item background. Its on our todo list
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby nageswaragunupudi » Tue Dec 18, 2007 11:02 am

I am able to paint the msgitem text in transparent mode, but unable to repaint the background. I am not good in graphics. I failed both using bitmap and gradient.

Eagerly awaiting the improvement from FWH
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Silvio » Tue Dec 18, 2007 11:04 am

thanks
I thinked you'already corrected the problem on 7.12...
I'm trying to correct it but I have some problems
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby nageswaragunupudi » Tue Dec 18, 2007 11:34 am

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  Expand view
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


This is the result
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby nageswaragunupudi » Tue Dec 18, 2007 11:47 am

Changed the gradient function slightly. This gives relatively a better look. Till we can paint background with bitmap instead of gradient.

Code: Select all  Expand view
      Gradient( hDC, { 0, nLeft, ::omsgbar:nHeight / 3, nLeft + ::nWidth },;
                nRGB( 227, 239, 255 ), nRGB( 201, 224, 255 ), .T. )
      Gradient( hDC, { ( ::omsgbar:nHeight / 3 ) + 1, nLeft, ::omsgbar:nHeight, nLeft + ::nWidth },;
                nRGB( 174, 209, 255 ), nRGB( 186, 216, 255 ), .T. )



Looks:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Silvio » Tue Dec 18, 2007 11:51 am

Dear friend,
I see many errors
try with

SET MESSAGE OF oWnd TO FWCOPYRIGHT 2007 NOINSET DATE CLOCK
DEFINE MSGITEM OF oWnd:oMsgBar SIZE 100 prompt " Test TEST"
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby nageswaragunupudi » Tue Dec 18, 2007 11:58 am

here it is

Image

Anyway you are welcome to improve it. This is a quick work from me.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Silvio » Tue Dec 18, 2007 12:12 pm

Look my picture
Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby nageswaragunupudi » Tue Dec 18, 2007 12:16 pm

Ok Sorry
Please replace this line instead of the previous code. There was a minor mistake in centering the message
Code: Select all  Expand view
      ::oMsgBar:Say( ::oMsgBar:nHeight / 4 - 2,;
             nLeft + (::nWidth - GetTextWidth( hDC,::cMsg ))/2, ::cMsg, ;
             iif( ::lActive, ::nClrText, ::nClrDisabled ), ::nClrPane, ;
             ::oFont, .T., .T. )


use this code instead of the old one i posted
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby nageswaragunupudi » Tue Dec 18, 2007 12:44 pm

Mr Silvio

Because I do not use bitmaps with msgitems I did not bother about bitmaps. Better thing would be to move the gradient code to the top and paint the bitmaps transparently. I know you use bitmaps.

Hope you dont mind sharing your final working code with bitmaps too.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Silvio » Tue Dec 18, 2007 12:50 pm

Now it is as yours
thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Tue Dec 18, 2007 2:12 pm

DEFINE MSGITEM oMsgItem2;
OF oWnd:oMsgBar ;
PROMPT "Test with Bitmaps" ;
SIZE 100 ;
BITMAP "EUSUARIO", "EUSUARIO";
TOOLTIP " " + i18n("Acerca de...") + " ";
ACTION MsgInfo( "Test with Bitmaps" )


BUT THIS COMMAND NOT RUN
I CANNOT SEE THE BITMAP
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby nageswaragunupudi » Tue Dec 18, 2007 3:32 pm

As I said earlier, I did not take care of bitmap painting. But suggested what could be done. Anyway I am posting the revised paint method to paint bitmaps also.
Code: Select all  Expand view

METHOD Paint(lown) CLASS TMsgItem

   local nCount, nClrBack
   local nLeft := ::nLeft()
   local hBmp, nBmpWidth := 0
   local hDC

   hDC := ::oMsgBar:GetDC()

   if ::omsgbar:l2007

      Gradient( hDC, { 0, nLeft, ::omsgbar:nHeight / 3, nLeft + ::nWidth },;
                nRGB( 227, 239, 255 ), nRGB( 201, 224, 255 ), .T. )
      Gradient( hDC, { ( ::omsgbar:nHeight / 3 ) + 1, nLeft, ::omsgbar:nHeight, nLeft + ::nWidth },;
                nRGB( 174, 209, 255 ), nRGB( 186, 216, 255 ), .T. )
   endif

   if ::hBitmap1 != nil
      hBmp = If( ::lActive, ::hBitmap1, ;
                 If( ::hBitmap2 != nil, ::hBitmap2, ::hBitmap1 ) )
      nBmpWidth  = nBmpWidth( hBmp )
      DrawMasked( hDC, hBmp, 4, nLeft + 1 )
   endif


   if ::omsgbar:l2007

      ::oMsgBar:Say( ::oMsgBar:nHeight / 4 - 2,;
             nLeft + (::nWidth - GetTextWidth( hDC,::cMsg ))/2, ::cMsg, ;
             iif( ::lActive, ::nClrText, ::nClrDisabled ), ::nClrPane, ;
             ::oFont, .T., .T. )
      wndboxin( hDc, 0, nLeft-1, ::oMsgBar:nHeight, nLeft )   // present test values


   else


      DrawMsgItem( hDC, ::cMsg,;
                { 5, nLeft + nBmpWidth, ::oMsgBar:nHeight-6, nLeft + ( ::nWidth - 7 ) },;
                If( ::lActive, ::nClrText, ::nClrDisabled ),;
                ::nClrPane, ::oFont:hFont )

      WndBoxIn( hDC, 3, nLeft - 2, ::oMsgBar:nHeight-5, nLeft + ::nWidth - 6 ) // fwh

   endif


   ::oMsgBar:ReleaseDC()


return nil

Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby nageswaragunupudi » Tue Dec 18, 2007 3:39 pm

here is how it looks

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests