Text on another line

Post Reply
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Text on another line

Post 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?
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Text on another line

Post by nageswaragunupudi »

Code: Select all | Expand

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: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Text on another line

Post by nageswaragunupudi »

Another method:

Code: Select all | Expand

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

Re: Text on another line

Post 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 :(
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Text on another line

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
Post Reply