Antonio
YES .. your suggestions worked .. however, it appears that there is another line of code that continues to create the original button .. here are the changes I made to the xBrowse code :
Method PaintCell
- Code: Select all Expand view
if nType == EDIT_LISTBOX .or. nType == EDIT_GET_LISTBOX
::oBtnElip:Hide()
::oBtnList:Move( nButtonRow, nButtonCol, nBtnWidth + 1, nHeight, .f.) // ButtonGet
::oBtnList:Show()
::oBtnList:GetDC()
if ::lBtnTransparent
::oBtnList:SetColor( aColors[ 1 ],aColors[ 2 ] )
else
FillRect( hDC, {nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + nBtnWidth + 1 } ,; // ButtonGet
::oBtnList:oBrush:hBrush )
endif
::oBtnList:Paint()
::oBtnList:ReleaseDC()
else
::oBtnList:Hide()
* ::oBtnElip:Move( nButtonRow, nButtonCol, nBtnWidth + 1, nHeight, .f.) // ButtonGet
::oBtnElip:Move( nButtonRow, nButtonCol-60, nBtnWidth + 40, nHeight, .f.) // Ricks changes
::oBtnElip:Show()
::oBtnElip:GetDC()
if ::lBtnTransparent
::oBtnElip:SetColor( aColors[ 1 ],aColors[ 2 ] )
else
FillRect( hDC, {nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + nBtnWidth + 1 },; // ButtonGet
::oBtnElip:oBrush:hBrush )
endif
::oBtnElip:Paint()
::oBtnElip:ReleaseDC()
endif
Method CreateButtons and ChangeBitmap
- Code: Select all Expand view
//----------------------------------------------------------------------------//
METHOD CreateButtons() CLASS TXBrwColumn
local aColors
if ::oBtnList != nil .and. ::oBtnElip != nil
::oBtnList:Hide()
::oBtnElip:Hide()
return nil
endif
if ::oBrw:lCreated
aColors := Eval( ::bClrHeader )
if ::oBtnList != nil
::oBtnList:End()
endif
if ::oBtnElip != nil
::oBtnElip:End()
endif
@ 0,0 BTNBMP ::oBtnList RESOURCE "" OF ::oBrw NOBORDER SIZE 0,0
::oBtnList:hBitmap1 := FwDArrow()
::oBtnList:bAction := { || ::ShowBtnList() }
::oBtnList:SetFont( If( ValType( ::oDataFont ) == "B", Eval( ::oDataFont, Self ), ::oDataFont ) )
::oBtnList:SetColor( aColors[ 1 ], aColors[ 2 ] )
@ 0,0 BTNBMP ::oBtnElip OF ::oBrw NOBORDER SIZE 0,0
* ::oBtnElip:cCaption := "..."
::oBtnElip:cCaption := "Label" // antonio change
::oBtnElip:bAction := {|| ::RunBtnAction() }
::oBtnElip:SetFont( If( ValType( ::oDataFont ) == "B", Eval( ::oDataFont, Self ), ::oDataFont ) )
::oBtnElip:SetColor( aColors[ 1 ], aColors[ 2 ] )
if ::nBtnBmp > 0 .and. !empty( ::aBitMaps )
if ::nBtnBmp > len( ::aBitMaps )
::nBtnBmp := len( ::aBitMaps )
endif
::ChangeBitMap( )
endif
::oBtnList:Hide()
::oBtnElip:Hide()
endif
return nil
//------------------------------------------------------------------------------
METHOD ChangeBitmap( ) CLASS TXBrwColumn // BtnGet
msginfo( "ChangeBitmap")
if ::nBtnBmp > 0 .and. len( ::aBitmaps ) >= ::nBtnBmp
::oBtnElip:hBitmap1 := ::aBitMaps[::nBtnBmp, BITMAP_HANDLE ]
::oBtnList:hBitmap1 := ::aBitMaps[::nBtnBmp, BITMAP_HANDLE ]
* ::oBtnElip:cCaption := ""
::oBtnElip:cCaption := "label" // antonio change
else
::oBtnElip:hBitmap1 := 0
::oBtnList:hBitmap1 := 0
* ::oBtnElip:cCaption := "..."
::oBtnElip:cCaption := "label" // antonio change
endif
::oBrw:refresh()
return nil
Here is the same code adding the Bitmap ..
- Code: Select all Expand view
// serial number
ADD oCol to oLbxB AT 8 HEADER 'Serial Num' size 75
oLbxB:aCols[ 8 ]:nEditType := EDIT_GET_BUTTON
oLbxB:aCols[ 8 ]:bEditBlock := {|row, col, oCol| _SerBrow( nRepairNumber,;
oRsInvDetail:Fields("Inventory Id"):Value,;
oRsInvDetail:Fields("Qty"):Value,oRsInvDetail,;
oBtn1,oBtn2,oBtn3,oBtn4,oBtn5 ) }
oLbxB:aCols[ 8 ]:addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task.bmp" )
oLbxB:aCols[ 8 ]:lBtnTransparent := .t.
oLbxB:aCols[ 8 ]:nBtnBmp := 1
I sincerely appreciate your Help!
Rick Lipkin
ps .. I have been trying out different options .. Is it possible to modify my :addbmpfile line with something like oLbxB:aCols[8]:If( oRs:Fields("whatever"):Value = .t., addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task.bmp" ,addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task1.bmp")) .. ?