In CLASS TXBrwColumn
1. Remove PROTECTED to use this data
- Code: Select all Expand view
- DATA nColDividerWidth //PROTECTED // not yet implemented. //BYTE-ONE
2. Following changes to make listboxes widther as the xBrowse-column and a empty(::aEditListTxt) not make a runtime-error and the height of the listbox follows the fontsize
- Code: Select all Expand view
- DATA nLbxWidth INIT 0 //Width from Listbox //BYTE-ONE
- Code: Select all Expand view
- METHOD ShowBtnList( nKey ) CLASS TXBrwColumn
local aBound
local xValue
local hBrush
local nAt, nRow, nCol, nWidth, nHeight, aColors, oFont
local lWhen := ( ::bEditWhen == nil .or. Eval( ::bEditWhen, Self ) )
if ::aEditListTxt == nil .or. (valtype(::aEditListTxt)=="A" .and. len(::aEditListTxt)==0) //BYTE-ONE
MsgStop( "oCol:aEditListTxt not defined or oCol:aEditListTxt has len 0", "Fivewin: Class TXBrwColumn" ) //BYTE-ONE
return .f.
endif
if ::bOnPostEdit == nil
MsgStop( "oCol:bOnPostEdit not defined",;
"Fivewin: Class TXBrwColumn" )
return .f.
endif
::oBrw:nColSel := ::nPos
if ValType( ::aEditListTxt[ 1 ] ) == 'A'
::aEditListBound := ArrTranspose( ::aEditListTxt )[ 1 ]
::aEditListTxt := ArrTranspose( ::aEditListTxt )[ 2 ]
endif
aBound := IfNil( ::aEditListBound, AClone( ::aEditListTxt ) )
if ValType( xValue := ::Value ) == 'C'
xValue := Trim( xValue )
endif
if ( nAt := Ascan( aBound, xValue ) ) == 0
if ValType( xValue ) == 'C'
do while Len( xValue ) > 1 .and. nAt == 0
xValue := Left( xValue, Len( xValue ) - 1 )
nAt := AScan( aBound, xValue )
enddo
elseif ( nAt := AScan( aBound, { |u| xValue <= u } ) ) == 0
nAt := Len( aBound )
endif
endif
xValue := nil
nRow := ( ::oBrw:nRowSel * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() - 1
// nCol := ::nDisplayCol - 2
nWidth := max(::nWidth + 3,::nLbxWidth) //BYTE-ONE
// nCol := if( ::nDisplayCol - 2 + nWidth > ::oBrw:BrwWidth() , ::nDisplayCol + 2 + ::oBrw:BrwWidth() - nWidth,::nDisplayCol - 2 ) //BYTE-ONE
nCol := if( ::nDisplayCol - 2 + nWidth > ::oBrw:BrwWidth() , ::oBrw:BrwWidth() - nWidth,::nDisplayCol - 2 ) //BYTE-ONE
// nHeight := Len( ::aEditListTxt ) * ( FontHeight( ::oBrw, ::oBrw:oFont ) ) + 2
nHeight := Len( ::aEditListTxt ) * ( FontHeight( ::oBrw, if(::oEditFont == NIL ,::oBrw:oFont,If( ValType( ::oEditFont ) == 'B', Eval( ::oEditFont ), ::oEditFont )) ) ) + 2 //BYTE-ONE