Page 1 of 1

FWH1111 SetDlgGradient

PostPosted: Sat Dec 17, 2011 5:49 am
by roberio
Antonio,
quando uso o SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )..... mostra o seguinte:

@ 001, 001 FOLDEREX ofld Items....:
Image


MsgRun( "Verificando informativos...", "Espere um momento", { || AbriWebMain(oWndP...:
Image

FWH1111[X]HARBOUR0131211.zip

Re: FWH1111 SetDlgGradient

PostPosted: Sat Dec 17, 2011 10:04 am
by Antonio Linares
Rogerio,

For the 1) this new Method in Class TDialog is required:

Code: Select all  Expand view
  METHOD SetSize( nWidth, nHeight, lRepaint ) INLINE ;
              Super:SetSize( nWidth, nHeight, lRepaint ),;
              If( aGradColors != nil, ::Gradient( aGradColors ),)


And we change Class TWindow Method Gradient() this way:
Code: Select all  Expand view
METHOD Gradient( aGradColors ) CLASS TWindow

   local hDC, hBmp, hBmpOld

   DEFAULT aGradColors := ::aGradColors
   
   if aGradColors == nil
      return nil
   endif  
   
   hDC = CreateCompatibleDC( ::GetDC() )
   hBmp = CreateCompatibleBitMap( ::hDC, ::nWidth, ::nHeight )
   hBmpOld = SelectObject( hDC, hBmp )

   GradientFill( hDC, 0, 0, ::nHeight, ::nWidth, aGradColors )

   ::oBrush:End()
   ::oBrush = TBrush():New()
   ::oBrush:hBitmap = hBmp
   ::oBrush:hBrush = CreatePatternBrush( hBmp )
   
   SelectObject( hDC, hBmpOld )

   ::ReleaseDC()

return nil  

Re: FWH1111 SetDlgGradient

PostPosted: Sat Dec 17, 2011 10:14 am
by Antonio Linares
Rogerio,

For the 2) this little change in required in source\function\msgrun.prg

Code: Select all  Expand view
    ACTIVATE DIALOG oDlg CENTER ;
          ON PAINT oDlg:Say( 11, 0, xPadC( oDlg:cMsg, nWidth ),,,, .T., .T. )


Thanks! :-)

Re: FWH1111 SetDlgGradient

PostPosted: Sat Dec 17, 2011 12:10 pm
by roberio
incluso con los cambios en el dialog y windows... y continĂºa con el mismo error en folderEX ...

msgrun funcionaba bien ahora.

rĂ¡pidamente resuelto de la siguiente manera: // rsrs
// SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

gracias

(obs: google tradutor)