I have some questions about Cell-Bitmaps
in design-mode.
I start with a empty browse.
Next, i send a Bitmap to xbrowse.
The cell-height is not adjusted.
Refresh, update doesn't help
When I close the dialog und reopen it.
The cell-height is ok.
Now, i can fill the browser with different bitmaps.
When the end of the browser is reached,
is it possible, to clear the bmp-array ?
- Code: Select all Expand view
// -- xBROWSE 1, I send fonts, colors, bitmaps, styles and more --------
PRIVATE aTEST[12][3]
aTEST[1] := { " 1", "Test1", "Test1" }
aTEST[2] := { " 2", "Test2", "Test2" }
aTEST[3] := { " 3", "Test3", "Test3" }
aTEST[4] := { " 4", "Test4", "Test4" }
aTEST[5] := { " 5", "Test5", "Test5" }
aTEST[6] := { " 6", "Test6", "Test6" }
aTEST[7] := { " 7", "Test7", "Test7" }
aTEST[8] := { " 8", "Test8", "Test8" }
aTEST[9] := { " 9", "Test9", "Test9"}
aTEST[10] := { "10", "Test10", "Test10" }
aTEST[11] := { "11", "Test11", "Test11" }
aTEST[12] := { "12", "Test12", "Test12" }
oLbx1 := TXBrowse():New( oDlg7 )
oLbx1:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx1:nColDividerStyle := LINESTYLE_BLACK
oLbx1:nRowDividerStyle := LINESTYLE_BLACK
oLbx1:SetArray( aTEST )
oLbx1:lHScroll := .T.
oLbx1:lVScroll := .T.
// Define alternating row colors
oLbx1:bClrStd := {|| IF ( EVAL ( oLbx1:bKeyno, NIL, oLbx1 ) %2 == 0, ;
{ CLR_BLACK, e_BRCOLOR1 }, { CLR_BLACK, e_BRCOLOR2 } ) }
for nFor := 1 to Fcount()
oLbx1:aCols[ nFor ]:cHeader := Padr("Font 1", 10)
oLbx1:aCols[ nFor ]:oDataFont = xBFont1
next
oLbx1:CreateFromResource( 110 )
// The Button to send Cell-Bitmaps to browser 1
// -----------------------------------------------------
REDEFINE BUTTONBMP oBtn8 ID 260 OF oDlg7 ;
ACTION ( cNewBITM := ;
cGetFile32("BMP-Files (*.bmp) | *.bmp","Select BMP-File"), ;
IIF( empty( cNewBITM ), ;
MsgAlert( "No file selected !","ATTENTION" ), NIL ), ;
e_BRBMP := cFileNoExt( cNewBITM ), oBR_BMP:Refresh(), ;
xBNEWF1(oLbx1,oLbx2,xBFont1,xBFont2), ;
oDlg7:Update() ) ;
BITMAP "color_5" PROMPT " &Cell-Bmp" TEXTRIGHT
oBtn8:cToolTip = { "Shows the" + CRLF + "Bitmap" + CRLF + ;
"of the Cell", "Cell-Bitmap", 1, CLR_BLACK, 14089979 }
// ----- The Function to rebuild BROWSER 1 -----------------------
FUNCTION xBNEWF1(oLbx1,oLbx2,xBFont1,xBFont2)
oLbx1:hColPen := CreatePen( PS_SOLID, e_BRPEN, CLR_BLACK )
oLbx1:hRowPen := CreatePen( PS_SOLID, e_BRPEN, CLR_BLACK )
// BR_STYLE 1 = Horz. + Vert
// BR_STYLE 2 = Horz.
// BR_STYLE 3 = Vert
LINE + CELL - Combinations
// Horizontal + Vertical - Cell-devider with Cell-style
// ---------------------------------------------------------
IF BR_STYLE = 1
IF BR_LINE = 1
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 2
oLbx1:nColDividerStyle := LINESTYLE_BLACK
oLbx1:nRowDividerStyle := LINESTYLE_BLACK
ENDIF
IF BR_LINE = 3
oLbx1:nColDividerStyle := LINESTYLE_DARKGRAY
oLbx1:nRowDividerStyle := LINESTYLE_DARKGRAY
ENDIF
IF BR_LINE = 4
oLbx1:nColDividerStyle := LINESTYLE_FORECOLOR
oLbx1:nRowDividerStyle := LINESTYLE_FORECOLOR
ENDIF
IF BR_LINE = 5
oLbx1:nColDividerStyle := LINESTYLE_LIGHTGRAY
oLbx1:nRowDividerStyle := LINESTYLE_LIGHTGRAY
ENDIF
IF BR_LINE = 6
oLbx1:nColDividerStyle := LINESTYLE_INSET
oLbx1:nRowDividerStyle := LINESTYLE_INSET
ENDIF
IF BR_LINE = 7
oLbx1:nColDividerStyle := LINESTYLE_RAISED
oLbx1:nRowDividerStyle := LINESTYLE_RAISED
ENDIF
ENDIF
// Horizontal Cell devider with Cell-style
// -------------------------------------------
IF BR_STYLE = 2
IF BR_LINE = 1
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 2
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_BLACK
ENDIF
IF BR_LINE = 3
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_DARKGRAY
ENDIF
IF BR_LINE = 4
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_FORECOLOR
ENDIF
IF BR_LINE = 5
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_LIGHTGRAY
ENDIF
IF BR_LINE = 6
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_INSET
ENDIF
IF BR_LINE = 7
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_RAISED
ENDIF
ENDIF
// Vertical Cell-devider with Cell-style
// ----------------------------------------
IF BR_STYLE = 3
IF BR_LINE = 1
oLbx1:nColDividerStyle := LINESTYLE_NOLINES
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 2
oLbx1:nColDividerStyle := LINESTYLE_BLACK
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 3
oLbx1:nColDividerStyle := LINESTYLE_DARKGRAY
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 4
oLbx1:nColDividerStyle := LINESTYLE_FORECOLOR
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 5
oLbx1:nColDividerStyle := LINESTYLE_LIGHTGRAY
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 6
oLbx1:nColDividerStyle := LINESTYLE_INSET
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_LINE = 7
oLbx1:nColDividerStyle := LINESTYLE_RAISED
oLbx1:nRowDividerStyle := LINESTYLE_NOLINES
ENDIF
ENDIF
for n = 1 to 3
oLbx1:aCols[ n ]:cHeader = Padr("Font 1", 10)
oLbx1:aCols[ n ]:oDataFont = xBFont1
oLbx1:aCols[ n ]:bClrStd := {|| { BR_TCOLOR, ;
IF ( EVAL ( oLbx1:bKeyno, NIL, oLbx1 ) %2 == 0, ;
BR_COLOR1, BR_COLOR2 ) } }
IF !empty(e_BRBMP)
// No Cell-Hight-Adjustment !!
// --------------------------------
cBMP := ALLTRIM(e_BRBMP) + ".BMP"
oLbx1:aCols[ 1 ]:AddBmpFile(cBMP)
oLbx1:aCols[ 1 ]:bBmpData := {|| oLbx1:nArrayAt }
ELSE
oLbx1:aCols[ 1 ]:bBmpData := NIL // Hide Cell-Bitmap
ENDIF
next
oLbx1:Refresh()
RETURN( NIL )
Regards
Uwe[/img]