TFolderEx: How to change the background colour of a tab's pr

TFolderEx: How to change the background colour of a tab's pr

Postby hua » Tue Jan 03, 2023 8:19 am

Hi,

Image

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: TFolderEx: How to change the background colour of a tab's pr

Postby cmsoft » Tue Jan 03, 2023 11:25 am

Puedes cambiar los colores con la data:
aGradSel
aGradUnSel
aGradOverUnSel
aGradOver
aGradDis
Ejemplo:
Code: Select all  Expand view

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) } }
 
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: TFolderEx: How to change the background colour of a tab's pr

Postby hua » Wed Jan 04, 2023 2: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

Image

Code: Select all  Expand view

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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: TFolderEx: How to change the background colour of a tab's pr

Postby Antonio Linares » Wed Jan 04, 2023 7:03 am

Dear Hua,

Code: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 73 guests