Página 1 de 1

TBrowseMod group header text color

Publicado: Mié Nov 08, 2023 5:01 pm
por Timm
Hi!

How can I change the text color of TBrowseMod group headers?

Best regards, Timm

Re: TBrowseMod group header text color

Publicado: Jue Nov 09, 2023 6:35 pm
por Pedro Gil
Hi!

I'm not sure if I understood your question correctly but you have the following properties in the TBrowseMod class:

PROPERTY nClrHeaderPane
PROPERTY nClrHeaderText
PROPERTY nClrHeaderDivider
PROPERTY nClrHeaderHotPane
PROPERTY nClrHeaderHotText
PROPERTY nClrHeaderSelPane
PROPERTY nClrHeaderEditText
PROPERTY nClrHeaderEditPane
PROPERTY nClrHeaderEditTextFocus
PROPERTY nClrHeaderEditPaneFocus

Greetings!

Re: TBrowseMod group header text color

Publicado: Vie Nov 10, 2023 8:09 am
por Timm
Hi Pedro,

many thanks for your answer!

I am searching for something like nClrGroupHeaderEditText in order to change the color of this text:

2023-11-10 08_00_40-COPPIO.png
2023-11-10 08_00_40-COPPIO.png (23.5 KiB) Visto 1511 veces

I tried it with this:

Código: Seleccionar todo

METHOD BrwArtikelDrawGroupHeader( oSender, oSt, cGroup, nRecord, hDC, aRect ) CLASS TForm1

   SetTextColor( hDC, RGB( 47, 53, 65 ) )   // this does not work
   SelectObject( hDC, ::oFontBold:Handle )

RETURN Nil
Best regards, Timm

Re: TBrowseMod group header text color

Publicado: Vie Nov 10, 2023 4:39 pm
por ignacio
Hello,

Try manipulating oBrowseMod:oSupra. Is TheaderMod control.

Regards,

Re: TBrowseMod group header text color

Publicado: Sab Nov 11, 2023 8:35 am
por Timm
Hi,

manipulating oBrowseMod:oSupra did not work so I modified this:

Código: Seleccionar todo

METHOD PaintGroupHeader( hDC, nItem, aRect, nRecord ) CLASS XBrwModGrid
...
         nClrT := ::nClrText
         nClrP := ::nClrPane
         lRet  := :OnDrawGroupHeader( oSt, @cGrp, nRecord, hDC, aTmp, @nClrT, @nClrP )
...
RETURN NIL
The event OnDrawGroupFooter already has the parameters nClrText and nClrPane.
Perhaps you can add them also to OnDrawGroupHeader?

Best regards, Timm

Re: TBrowseMod group header text color

Publicado: Sab Nov 11, 2023 9:12 am
por ignacio
Sorry. My mistake, I thought you were referring to column groupings.

I did not include those parameters on the header because I thought there were not necessary. But, no problem to include them. BTTW I prefer that hDC and aRect continue to be the last parameters even if it brakes some code (that surely will not happen). So, this will be the way that is already modified in the source code:

EVENT OnDrawGroupHeader( oSender, oSt, BYREF cGroup, nRecord, BYREF nClrText, BYREF nClrPane, hDC, aRect )

Regards

Re: TBrowseMod group header text color

Publicado: Dom Nov 12, 2023 9:31 am
por Timm
Thank you, Ignacio!