Text on another line

Text on another line

Postby Natter » Mon Dec 25, 2023 8:25 pm

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?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Text on another line

Postby nageswaragunupudi » Tue Dec 26, 2023 2:23 pm

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Text on another line

Postby nageswaragunupudi » Tue Dec 26, 2023 3:03 pm

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Text on another line

Postby Natter » Tue Dec 26, 2023 7:30 pm

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 :(
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Text on another line

Postby nageswaragunupudi » Wed Dec 27, 2023 12:06 am

Please give us a small sample and we will modify it.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests