Xbrowse : bitmap columns , lBmpStretch (FXH8.10)

Xbrowse : bitmap columns , lBmpStretch (FXH8.10)

Postby demont frank » Mon Nov 17, 2008 1:41 pm

Hello,

Trying to use lBmpstretch in a bitmapcolumn has no succes (am i the first to try it ?)

Code: Select all  Expand view
#include "FiveWin.ch"      //FWH8.10 !!!!!!!
#include "xbrowse.ch"

function Main()

   local oDlg, oBrw

   DEFINE DIALOG oDlg SIZE 300, 200

   @ 0, 0 XBROWSE oBrw OF oDlg ARRAY { { "one","two","three" , .T. , .F. } } AUTOCOLS
   oBrw:CreateFromCode()
    MakeBitmapCol(oBrw,4)
    MakeBitmapCol(oBrw,5)
    msgInfo(oBrw:aCols[5]:bStrData=nil)
   oBrw:bKeyDown = { || oDlg:SetText( Str( oBrw:nColSel ) ) }
   ACTIVATE DIALOG oDlg CENTER ON INIT (msgInfo(oBrw:aCols[5]:bStrData=nil) , oDlg:oClient := oBrw, oDlg:Resize() )

return nil

PROC MakeBitmapCol(oBrw,i)
**************************
LOCAL oCol
LOCAL x , y
oCol := oBrw:aCols[i] //oBrw:AddCol()
oCol:AddBmpFile( "BITMAPS\CHECKON.BMP" )
oCol:AddBmpFile( "BITMAPS\CHECKOFF.BMP" )
x := LEN(oCol:aBitMaps)
oCol:bBmpData   := {||IIF(ValType(oBrw:aArrayData[oBrw:nArrayAt,i])="L" , IIF(oBrw:aArrayData[oBrw:nArrayAt,i],x-1,x),0)}  //oCol:bStrData
oCol:bStrData   := nil
oCol:lBmpStretch := .T.
RETURN


ON INIT (msgInfo(oBrw:aCols[5]:bStrData=nil)) Shows .F. , probably is during initialisatien this block set (EVAL(oBrw:aCols[5]:bStrData) shows .F.)

In paint method can

Code: Select all  Expand view
if nBmpNo > 0 .and. nBmpNo <= Len( ::aBitmaps )
      .......
      if ::bStrData == nil
         nBmpCol  := Max( 0, nCol + nWidth / 2 )
         lStretch := ::lBmpStretch
      ........


never be executed.

A possible solution is in MakeBitmapCol(oBrw,i)

oCol:bStrData := {||""}

IN Xbrowse.prg , Paint :
Code: Select all  Expand view
if nBmpNo > 0 .and. nBmpNo <= Len( ::aBitmaps )
      .......
      if ::bStrData == nil .OR. EMPTY(EVAL(::bStrData))
         nBmpCol  := Max( 0, nCol + nWidth / 2 )
         lStretch := ::lBmpStretch
      ........


Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests