FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TFolderEx: How to change the background colour of a tab's pr
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
TFolderEx: How to change the background colour of a tab's pr
Posted: Tue Jan 03, 2023 08:19 AM
Hi,



TIA
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: TFolderEx: How to change the background colour of a tab's pr
Posted: Tue Jan 03, 2023 11:25 AM
Puedes cambiar los colores con la data:
aGradSel
aGradUnSel
aGradOverUnSel
aGradOver
aGradDis
Ejemplo:
Code (fw): Select all Collapse
aGradSel       := { { 0.5, nRGB( 150, 215, 0 ), nRGB( 100, 173, 0 ) },;
                                 { 0.75,  nRGB( 150, 255, 255 ), nRGB( 150, 255, 255 ) } }

aGradUnSel     := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 240, 240, 240 ) },;
                                 { 0.5,  nRGB( 240, 240, 240 ), nRGB( 200, 200, 200 ) } }

aGradOverUnSel := { { 0.25, nRGB( 100, 149, 237 ), nRGB( 100, 149, 237 ) },;
                                 { 0.75,  nRGB( 255, 255, 255 ), nRGB( 200, 200, 200 ) } }

aGradOver      := { { 0.5,  nRGB( 200, 200, 200), nRGB( 240, 240, 240 ) },;
                                 { 0.5, nRGB( 240, 240, 240 ), nRGB( 255, 255, 255  ) }  }

aGradDis       := { { 1, nRGB( 211, 211, 211 ), nRGB( 190, 190, 190) } }
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: TFolderEx: How to change the background colour of a tab's pr
Posted: Wed Jan 04, 2023 02:22 AM
Thanks for the reply Cesar.

I am close to get the effect that I want (specific tabs have different colour) by amending PainTab() that I found in \SAMPLES.

But using this PainTab() method causes the highlight on the tab when hovering or when a tab is selected to not appear.
Anyone has any solution to that?

Also can someone shows the syntax to create a brush from resource instead of ReadBitmap() a file?
TIA


Code (fw): Select all Collapse
FUNCTION PaintTab( o, nOption )
   LOCAL hBrush, hBmp, nLastRow

   IF nOption <= 5
      hBmp = ReadBitmap( 0, ud_bmpDir()+"\browback.bmp" )
      hBrush = CreatePatternBrush( hBmp )
      DeleteObject( hBmp )
      nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 2 ] + o:nFolderHeight
      SetBrushOrgEx( o:hDC, 1, nLastRow + 2 )
      RETURN hBrush
   ENDIF

RETURN o:SetFldColors( o, nOption )
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TFolderEx: How to change the background colour of a tab's pr
Posted: Wed Jan 04, 2023 07:03 AM
Dear Hua,
Code (fw): Select all Collapse
#xcommand DEFINE BRUSH [ <oBrush> ] ;
             [ STYLE <cStyle> ] ;
             [ COLOR <nRGBColor> ] ;
             [ <file:FILE,FILENAME,DISK> <cBmpFile> ] ;
             [ <resource:RESOURCE,NAME,RESNAME> <cBmpRes> ] ;
             [ <grad:GRADIENT> <aGrad> ] ;
             [ <cResize:STRETCH,RESIZE,VERTICAL,VERT,HORIZONTAL,HORIZ> ] ;
       => ;
          [ <oBrush> := ] TBrush():New( [ Upper(<(cStyle)>) ], <nRGBColor>,;
             <cBmpFile>, <cBmpRes>, [<aGrad>], [ Upper(<(cResize)>) ] )
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion