Page 1 of 1

Text on another line

PostPosted: Mon Dec 25, 2023 8:25 pm
by Natter
Hi,

An array is viewed in the xBrowse. The xBrowse cell is 2 rows high.
I need to show basic information + additional information in the cell (with a different font).
What I do with FW_SayTextHilite().
How do I make this additional information appear on another line?

Re: Text on another line

PostPosted: Tue Dec 26, 2023 2:23 pm
by nageswaragunupudi
Code: Select all  Expand view
function xbrmultifont()

   local oFont1, oFont2

   DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-19 BOLD
   DEFINE FONT oFont2 NAME "VERDANA" SIZE 0,-19 ITALIC

   XBROWSER "CUSTOMER.DBF" ;
      COLUMNS "FIRST+CHR(13)+CHR(10)+LAST AS NAME", "CITY+CHR(13)+CHR(10)+STATE AS ADDRESS" ;
      SETUP ( ;
         oBrw:nDataLines := 2, ;
         oBrw:aCols[ 1 ]:aDataFont := { oFont1, oFont2 }, ;
         oBrw:aCols[ 2 ]:aDataFont := { oFont2, oFont1 } ;
         )


   RELEASE FONT oFont1, oFont2

return nil
 


Image

Re: Text on another line

PostPosted: Tue Dec 26, 2023 3:03 pm
by nageswaragunupudi
Another method:
Code: Select all  Expand view
function xbrmultifont()

   local oFont1, oFont2

   DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-19 BOLD
   DEFINE FONT oFont2 NAME "VERDANA" SIZE 0,-19 ITALIC

   XBROWSER "CUSTOMER.DBF" ;
      COLUMNS "FIRST AS NAME", "LAST", "CITY AS CITY-STATE", "STATE" ;
      SETUP ( ;
         oBrw:aCols[ 1 ]:oDataFont := oFont1, ;
         oBrw:aCols[ 2 ]:oDataFont := oFont2, ;
         oBrw:aCols[ 3 ]:oDataFont := oFont2, ;
         oBrw:aCols[ 4 ]:oDataFont := oFont1, ;
         oBrw:aCols[ 2 ]:bClrStd := ;
         oBrw:aCols[ 3 ]:bClrStd := { || { CLR_HRED, CLR_WHITE } }, ;
         oBrw:aCols[ 1 ]:SetColsAsRows( 1, 2 ), ;
         oBrw:aCols[ 3 ]:SetColsAsRows( 3, 4 ) ;
         )

   RELEASE FONT oFont1, oFont2

return nil
 


Image

Re: Text on another line

PostPosted: Tue Dec 26, 2023 7:30 pm
by Natter
Thanks, Rao, I got the idea!!! Yes, I can also use :SetColsAsRows( 3, 4 ). But I need to keep the glued column separate. So I did it through :bStrData. In this case, I got a gluing of 2 columns (separated by a CRLF),
but I could not show the rows in the cell in different colors/fonts :(

Re: Text on another line

PostPosted: Wed Dec 27, 2023 12:06 am
by nageswaragunupudi
Please give us a small sample and we will modify it.