FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse Multi Line Cell With Different Fonts
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: XBrowse Multi Line Cell With Different Fonts
Posted: Tue Sep 17, 2013 03:58 PM
nageswaragunupudi wrote:The above sample shows usage of oCol:bPaintText.

This offers total flexibility to the programmer and he can paint any cell in his own way.

There is another feature where two or more columns can be painted in a single cell.
By specifying something like
oBrw:aCols[ 1 ]:SetColsAsRows( 1, 2, 3 ), contents of columns 1,2,3 are painted as 3 rows in column 1 and columns 2 and 3 are not displayed. We can specify different fonts, colors, alignment, etc to these columns as usual, except that they are painted under one another as subrows of the cell instead of showing in adjacent columns.

Now let us apply formatting to the columns. Every 3rd columns has the same formatting.
For this just comment the line of code in the above sample
Code (fw): Select all Collapse
//         :aCols[ i ]:SetColsAsRows( i, i + 1, i + 2 )


Mr Rao
You can do what you explain if a column is text and the next column is an image?

Mr Rao
Es posible hacer lo mismo que usted explica si una columna es texto y la siguiente columna es una imagen?

Code (fw): Select all Collapse
         :aCols[ 1 ]:SetColsAsRows( 1, 2 )
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBrowse Multi Line Cell With Different Fonts
Posted: Tue Sep 17, 2013 04:01 PM
Mr Rao
You can do what you explain if a column is text and the next column is an image?


Yes.
Regards



G. N. Rao.

Hyderabad, India
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: XBrowse Multi Line Cell With Different Fonts
Posted: Tue Sep 17, 2013 06:44 PM
function TextoVertical()

   local oDlg, oBrw, nCol, oVert

   aImg     := ReadImages( "C:\\FWH\\FWH1203\\BITMAPS\\" )

  DEFINE FONT oVert NAME "SEGOE UI" SIZE 0,-12 NESCAPEMENT 900 //BOLD
                        // 522,560
   DEFINE DIALOG oDlg SIZE 500,540 PIXEL
   @ 10,10 XCBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      AUTOCOLS ARRAY aImg CELL NOBORDER   //LINES

   for nCol := 1 to 5 step 2
      WITH OBJECT oBrw:aCols[ nCol + 1 ]
         :nWidth        := 120
         :cDataType     := 'F'
         :nDataBmpAlign := AL_CENTER
      END
      WITH OBJECT oBrw:aCols[ nCol ]
         :oDataFont     := oVert
         :nWidth        := 24 //24
         :bPaintText    := { | oCol, hDC, cData, aRect, aColors, lHighLite | ;
                           DrawVertText( oCol, hDC, cData, aRect, aColors, lHighLite ) }
      END
      oBrw:aCols[ nCol ]:SetColsAsRows( nCol, nCol, nCol+1 )
      
   next  nCol

   WITH OBJECT oBrw
      :lHScroll         := .F.
      :nRowHeight       := 120
      :lRecordSelector  := .F.

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

return (0)

Mr. Rao
En este ejemplo, obtengo error al ejecutar el programa cuando pongo el codigo

In this example, I get error when running the program when I put the code

Code (fw): Select all Collapse
      oBrw:aCols[ nCol ]:SetColsAsRows( nCol, nCol, nCol+1 )

Time from start: 0 hours 0 mins 1 secs
Error occurred at: 17/09/2013, 20:40:33
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 0

Stack Calls

Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 529 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:COLATPOS( 0 )
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 531 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SELECTEDCOL( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT( 1275 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY( 1253 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1666 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11630 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3159 )

Si no pongo la funcion SetColsAsRows( , el programa funciona correctamente

If you put the function SetColsAsRows (the program works correctly

En qué me estoy equivocando?
Gracias

In what I'm wrong?
thanks

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBrowse Multi Line Cell With Different Fonts
Posted: Tue Sep 17, 2013 07:08 PM

1) Parameters should be ( nCol, nCol + 1 ) not ( nCol, nCol, nCol + 1 )

When you use this option, please do not use vertical fonts and also do not use bpainttext

2) When you specify vertical fonts xbrowse paints vertically. But you need to set columns nWidth and nHeight manually.

Regards



G. N. Rao.

Hyderabad, India
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: XBrowse Multi Line Cell With Different Fonts
Posted: Tue Sep 17, 2013 07:34 PM
Thanks Mr. Rao
What I stated working properly.
There was misconstrued my concepts, besides the error you mentioned me.
Obviously I can not do what I wanted.
This would have to have a method oBrw: aCols [nCol]: SetColsAsCols (nCol, nCol, nCol +1), like the one oBrw: aCols [nCol]: SetColsAsRows (nCol, nCol, nCol +1) to unite in formatting columns and rows as the current
My apologies and thanks again.

Gracias Mr. Rao
Lo que me ha indicado funciona correctamente.
Habia planteado mal mis conceptos, ademas del error que usted me ha indicado.
Es evidente que no puedo hacer lo que queria.
Para ello tendria que tener un metodo oBrw:aCols[ nCol ]:SetColsAsCols( nCol, nCol, nCol+1 ), como el que hay oBrw:aCols[ nCol ]:SetColsAsRows( nCol, nCol, nCol+1 ) para poder unir en formato columnas y no filas como el actual
Mis disculpas y gracias de nuevo.
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion