Page 1 of 1

Problem with EDIT_GET_LISTBOX: ADDITIONAL WORK REQUIRED

PostPosted: Sat Feb 27, 2016 7:52 pm
by byte-one
I found, that the value from the get in normal (not editing) mode are not visible. In the moment i will edit the get, this value becomes normal visible. If the value from the get is one of the items from the listbox the value is always visible!
This is in a browse from resource. In a browse from code is normal. But i cannot test if this is relevant!
In a older FWH (13) all was normal.

Re: Problem with EDIT_GET_LISTBOX in xBrowse

PostPosted: Sun Feb 28, 2016 8:02 am
by nageswaragunupudi
Can you please try this fix and offer your comments?

Please locate this line of code in Adjust() method of TXBrwColumn. You will find it in two places.
Code: Select all  Expand view
::bStrData  := { || XbrLbxLookUp( ::Value, ::aEditListBound, ::aEditListTxt ) }
 

Change this line as:
Code: Select all  Expand view
::bStrData  := { || XbrLbxLookUp( ::Value, ::aEditListBound, ::aEditListTxt, ::nEditType == EDIT_LISTBOX ) }
 

You need to change this at two places.

Next:
Please locate:
Code: Select all  Expand view
static function XbrLbxLookUp( uVal, aBound, aText )
 

Change this line as:
Code: Select all  Expand view
static function XbrLbxLookUp( uVal, aBound, aText, lBlank )
 


In this function, please locate this line:
Code: Select all  Expand view
  uRetVal  := Blank( aText[ 1 ] )
 

Change this as:
Code: Select all  Expand view
 
   DEFAULT lBlank := .t.    
   uRetVal  := If( lBlank, Blank( aText[ 1 ] ), cValToChar( uVal ) )
 

In case your problem is still not addressed by this change, please provide a small sample to reproduce the problem.

Re: Problem with EDIT_GET_LISTBOX in xBrowse

PostPosted: Sun Feb 28, 2016 4:21 pm
by byte-one
Mr. Rao, it seems, that this changes are ok! Thanks!

Re: Problem with EDIT_GET_LISTBOX in xBrowse

PostPosted: Thu Mar 03, 2016 2:09 pm
by byte-one
Mr. Rao, i make the following changes:

1. To add the size of the vert-scroll
Code: Select all  Expand view
nWidth   := Max( nWidth, CalcTextWH( ::oBrw, ::aEditListTxt, oFont )[ 1 ] + COL_EXTRAWIDTH + ;
                            IfNil( ::nBtnWidth, 10 ) + GetSysMetrics( 2 ))       //BYTE-ONE
 


2. To limit the listbox on small browses.
Code: Select all  Expand view
  nWidth := min(nWidth,::oBrw:BrwWidth())  //BYTE-ONE

Re: Problem with EDIT_GET_LISTBOX: ADDITIONAL WORK REQUIRED

PostPosted: Sun Mar 06, 2016 4:34 pm
by byte-one
Mr. Rao, have you seen this. Only small corrections.

And a other suggestion: Can we EDIT_LISTBOX and EDIT_GET_LISTBOX not include also in XbrEditMemo and a own dialog without border if wished? The advantage is, that the size are not limited to the size of xBrowse.

Re: Problem with EDIT_GET_LISTBOX: ADDITIONAL WORK REQUIRED

PostPosted: Mon Mar 07, 2016 1:03 am
by nageswaragunupudi
1. This was considered while adopting the changes. The padding provided is adequate to accommodate the scrollbar width (Windows default 17 pixels) also where necessary. By default, the auto-calculated column width and list-box width are exactly the same retaining backward compatibility in appearance of the listbox. You may check this in real cases.

Please test this sample:
Code: Select all  Expand view
  local aData := { { "Hello World", 5, "FiveTech SoftWare" }, { "FiveTech", 4, "Hello World" } }
   local aMonths[ 12 ]

   AEval( aMonths, { |u,i| aMonths[ i ] := { i, NToCMONTH( i ) } } )
   xbrowser aData SETUP ( oBrw:aCols[ 2 ]:nEditType := EDIT_LISTBOX, oBrw:aCols[ 2 ]:aEditListTxt := aMonths )
 


Image

2. This will be adopted.

Last suggestion: EDIT_GET_BUTTON is provided for such purposes.

Re: Problem with EDIT_GET_LISTBOX: ADDITIONAL WORK REQUIRED

PostPosted: Tue Apr 26, 2016 11:53 am
by byte-one
Mr. Rao, my impression is, that this point are not done!?
2. To limit the listbox on small browses.
nWidth := min(nWidth,::oBrw:BrwWidth()) //BYTE-ONE