Text on top of text

Text on top of text

Postby Natter » Mon Sep 30, 2024 7:27 pm

Hi,

Is it possible to glue 2 xBrowse columns together so that the text of the 1st one overlaps the text of the 2nd one
(I.e., the 1st column is transparent) ?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Text on top of text

Postby nageswaragunupudi » Wed Oct 02, 2024 1:27 am

Here is a sample.
3rd column is transparent and 2nd column overlaps.
You can change as you like.
Code: Select all  Expand view
function xbroverlap()

   local oDlg, oBrw, oFont, oFont2
   local aData := { ;
      { "ONE",   "TWO",   "THREE" }, ;
      { "FOUR",  "FIVE",  "SIX"   }, ;
      { "SEVEN", "EIGHT", "NINE"  } }

   DEFINE FONT oFont  NAME "Segoe UI" SIZE 0,-20 BOLD
   DEFINE FONT oFont2 NAME "IMPACT"   SIZE 0,-40

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE aData COLUMNS 1,2 ;
      HEADERS "One", "Two" ;
      COLSIZES 90,110 ;
      LINES NOBORDER


   WITH OBJECT oBrw

      :nRowHeight := 80

      :aCols[ 2 ]:bPaintText := < |oCol,hDC,cText,aRect|
         oBrw:SayText( oBrw:aRow[ 3 ], aRect, "", ;
            oFont2, CLR_HGRAY, nil, nil, 0x12800 )
         oBrw:SayText( cText, aRect, "", ;
            oFont, CLR_BLACK, nil, nil, 0x12800 )
       return nil
       >

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont, oFont2

return nil


Image

Is this what you are looking for?
Regards

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

Re: Text on top of text

Postby nageswaragunupudi » Wed Oct 02, 2024 7:39 am

Or, is this?
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oBrw, oFont, oFont2
   local aData := { ;
      { "ONE",   "TWO",   "THREE" }, ;
      { "FOUR",  "FIVE",  "SIX"   }, ;
      { "SEVEN", "EIGHT", "NINE"  } }

   DEFINE FONT oFont  NAME "Segoe UI" SIZE 0,-20 BOLD
   DEFINE FONT oFont2 NAME "IMPACT"   SIZE 0,-40

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE aData COLUMNS 1,2,3 ;
      HEADERS "One", "Two", "Three" ;
      COLSIZES 90,110 ;
      LINES NOBORDER

   WITH OBJECT oBrw
      :aCols[ 2 ]:SetColsAsRows( 2, 3 )
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont, oFont2

return nil


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
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 54 guests