FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Sun Jul 04, 2010 05:27 PM
DEAR ANTONIO,
I THINK this error on fwh10.6 corrected .. but




I have also the same error on xbrowse to show bitmap on xbrowse when I want use the windows seven effect

oCol:= oApp():AddCol()
oCol:AddResource("sort1")
oCol:AddResource("sort2")
oCol:AddResource( 'TREE_HARD')
oCol:AddResource( 'TREE_LAPTOP' )
oCol:AddResource( 'TREE_PRINTERS' )
oCol:AddResource( 'TREE_MONITOR' )
oCol:AddResource( 'TREE_KEYBOARD' )
oCol:AddResource( 'TREE_SWITCH' )
oCol:AddResource( 'TREE_MOUSE' )
oCol:AddResource( 'TREE_POCKET' )
oCol:AddResource( 'TREE_SCANNER' )
oCol:AddResource( 'TREE_PROJECT' )
oCol:AddResource( 'TREE_VCAM' )
oCol:AddResource( 'TREE_FCAM' )
oCol:AddResource( 'TREE_CAMERA' )

oCol:bBmpData := { || AScan( aItems, Trim( (oDHard)->type )) + 2 }
* oCol:bStrData := { || (oDHard)->type}
oCol:cHeader := "Tipo"
oCol:nWidth := 60
oCol:nHeadBmpNo := 2
oCol:nHeadBmpAlign := AL_RIGHT
oCol:oDataFont := oFontGrid
oCol:bLClickHeader :={ ||(Sel_Index(3,oDHard) , oApp():=3,oApp():refresh()) }

WITH OBJECT oApp():oGrid
:bChange := { || (nRecSel := oApp():BookMark,RefreshCont(oApp:oCont,oDHard)) }
:nRowDividerStyle := LINESTYLE_NOLINES
:nColDividerStyle := LINESTYLE_NOLINES
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:nStretchCol = STRETCHCOL_LAST
:SetBackGround(NIL,NIL)

END


AEval( oApp():aCols, { |oCol| ;
oCol:bPaintText := { |oCol, hDC, cData, aRect | ;
PaintCol( oCol, hDC, cData, aRect, nRecSel ) } ;
} )




oApp():CreateFromCode()


....

STATIC FUNCTION PaintCol( oCol, hDC, cData, aRect, nRecSel )

if nRecSel ==(oDHard)->( RecNo() )
GradientFill( hDC, aRect[ 1 ] - 2, aRect[ 2 ] - 3, aRect[ 3 ] + 1, aRect[ 4 ] + 5,;
{ { 1, RGB( 220, 235, 252 ), RGB( 193, 219, 252 ) } }, .T. )
SetBkMode( hDC, 1 )
RoundBox( hDC, 2, aRect[ 1 ] - 1, WndWidth( oCol:hWnd ) - 22, aRect[ 3 ] + 1, 2, 2,;
RGB( 235, 244, 253 ), 1 )
RoundBox( hDC, 1, aRect[ 1 ] - 2, WndWidth( oCol:hWnd ) - 21, aRect[ 3 ] + 2, 2, 2,;
RGB( 125, 162, 206 ), 1 )
endif

SetTextColor( hDC, 0 )
DrawTextEx( hDC, cData, aRect, oCol:nDataStyle )

return nil
FWH .. BC582.. xharbour
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Also Windows Seven Error Bitmap on Xbrowse
Posted: Mon Jul 05, 2010 06:59 AM
I try also with a sample but it not run ok

Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'

function Main()

   local oDlg, oBrw, oFont
   local aRowGrad, aSelGrad, aStdGrad,nRecSel

   local n := RGB( 157, 248, 255 )

   XbrNumFormat( 'E', .t. )

   aRowGrad := { { .5, RGB( 232, 241, 252 ), RGB(  232, 241, 252 ) }, ;
                 { .5, RGB( 210, 225, 244 ), RGB(  235, 243, 253 ) } }

   aSelGrad := { { .5, RGB( 255, 255, 251 ), RGB( 255, 237, 178 ) }, ;
                 { .5, RGB( 255, 218, 103 ), RGB( 255, 233, 162 ) } }

   USE CUSTOMER ALIAS CUST

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
      FONT oFont TITLE 'XBrowse Gradient Rows FWH 9.12'

   @ 10,10 XBROWSE oBrw OF oDlg ;
      SIZE -10,-10 PIXEL ;
      COLUMNS 'FIRST', 'HIREDATE', 'MARRIED', 'SALARY' ;
      ALIAS 'CUST' LINES NOBORDER

   oBrw:Married:SetCheck()  // Default FWH Bitmap is Alpha

   WITH OBJECT oBrw:First
      :AddBitmap( '\fwh\bitmaps\open2.bmp' ) // non-alpha bitmap
      :bBmpData   := { || 1 }
   END

   WITH OBJECT oBrw:HireDate
      :AddBitmap( '\fwh\bitmaps\Alphabmp\task.bmp' )  // alpha
      :bBmpData   := { || 1 }
   END

  WITH OBJECT oBrw
      :bChange          := { || nRecSel := oBrw:BookMark }
      :nRowDividerStyle := LINESTYLE_NOLINES
      :nColDividerStyle := LINESTYLE_NOLINES
      :nMarqueeStyle    := MARQSTYLE_HIGHLROW
   END


     WITH OBJECT oBrw
      :nStretchCol   := 1
      :nMarqueeStyle := 4
      :bClrSelFocus  := { || { CLR_BLACK, aSelGrad } }
      :bClrRowFocus  := { || { CLR_BLACK, aRowGrad } }
   END



   AEval( oBrw:aCols, { |oCol| ;
      oCol:bPaintText := { |oCol, hDC, cData, aRect | ;
                           PaintCol( oCol, hDC, cData, aRect, nRecSel ) } ;
      } )



   oBrw:CreateFromCode()


   ACTIVATE DIALOG oDlg CENTERED

   CLOSE CUST
   RELEASE FONT oFont

return nil

  static function PaintCol( oCol, hDC, cData, aRect, nRecSel )

   if nRecSel == CUST->( RecNo() )
      GradientFill( hDC, aRect[ 1 ] - 2, aRect[ 2 ] - 3, aRect[ 3 ] + 1, aRect[ 4 ] + 5,;
                    { { 1, RGB( 220, 235, 252 ), RGB( 193, 219, 252 ) } }, .T. )
      SetBkMode( hDC, 1 )
      RoundBox( hDC, 2, aRect[ 1 ] - 1, WndWidth( oCol:oBrw:hWnd ) - 22, aRect[ 3 ] + 1, 2, 2,;
                RGB( 235, 244, 253 ), 1 )
      RoundBox( hDC, 1, aRect[ 1 ] - 2, WndWidth( oCol:oBrw:hWnd ) - 21, aRect[ 3 ] + 2, 2, 2,;
                RGB( 125, 162, 206 ), 1 )
   endif

   SetTextColor( hDC, 0 )
   DrawTextEx( hDC, cData, aRect, oCol:nDataStyle )

return nil
FWH .. BC582.. xharbour
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Wed Jul 07, 2010 06:15 AM

NAGES CAN YOU HELP ME PLEASE?

FWH .. BC582.. xharbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Wed Jul 07, 2010 12:25 PM

As of now, Windows7 look implemented through oCol:bPaintText is not compatible with bitmaps in columns. This works only without bitmaps.

Reason:
bPaintText is called by every column, after painting background and bitmaps. In the bPaintText we are painting gradient background over and above the bitmaps already painted.
Also this routine is called by every column. And everytime we are overpainting all columns with out gradient painting.

Therefore this approach is not compatible with other features like bitmaps. etc. You may use this for simple listboxes.

XBrowse has not yet implemented Windows7 look natively.

Or we need to subclass xbrowse and override methods oBrw:drawline, and ocol:paintdata

Regards



G. N. Rao.

Hyderabad, India
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Wed Jul 07, 2010 03:43 PM

But Daniel or Antonio ( Now I not rememberwho) sad to me it was correct into the last version...
I need to show transparent bitmaps and to have alternate colors into grid
It is possible to create with xbrowse now ?

FWH .. BC582.. xharbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Wed Jul 07, 2010 03:51 PM

To the best of my understanding, what is improved in the latest versions is painting of bitmaps ( alpha and non-alpha ) over gradient rows.

viewtopic.php?f=6t=18554p=97245hilit=DEFAULT#p97245

But the above windows7 look logic paints gradient over and above the bitmaps already painted by xbrowse.

&&&

Regards



G. N. Rao.

Hyderabad, India
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Thu Jul 08, 2010 06:01 AM

thanks Nao But this feature is need for the Windows Seven
Many customer want W7 instead Vista Windows and we must converte all applications on this system

FWH .. BC582.. xharbour
Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Thu Jul 08, 2010 01:26 PM

It seems to be a interesting matter. :shock:

Saludos/Regards,

José Murugosa

"Los errores en programación, siempre están entre la silla, el teclado y la IA!!"
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Mon Aug 02, 2010 03:31 PM
MdaSolution wrote:thanks Nao But this feature is need for the Windows Seven
Many customer want W7 instead Vista Windows and we must converte all applications on this system


Hi, MdaSolution. Has you resolved this problem with txbrowse gradient rows bitmap painting?
If yes, can you describes it here? My version is 9.09
Thanks

Nao:
I saw your solution en this forum, but it not works in my version 9.09. Can you help me?
Thanks
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Mon Aug 02, 2010 05:28 PM

NO.
but if you want resolve somethig read this
viewtopic.php?f=6&t=18554&p=97245&hilit=DEFAULT#p97245

FWH .. BC582.. xharbour
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Mon Aug 02, 2010 07:14 PM

Thanks Mdasolution
I've tried and it does not work in FWH 9.09

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: TO NAGES Also Windows Seven Error Bitmap on Xbrowse
Posted: Tue Aug 03, 2010 02:19 PM

Dear Francisco,
IT seems it is Important Topic...

Also in past....you must learn this :
"When it 'll be of public domain it can be resolved!"

FWH .. BC582.. xharbour

Continue the discussion