DCCOMBOBOX ... REFRESH
Posted: Fri Jun 15, 2012 5:38 am
Hi, Roger.
If a DCCOMBOBOX/DROPDOWNLIST has a REFRESH clause, something strange is happening if the items for the listbox are somehow similar. As you can see in this sample, the items are "Tom 2", "Tom 21" and "Tom". With REFRESH on, it's almost impossible to briefly select "Tom" - the listbox shows "Tom 2" anyway, but "Tom" IS selected (look at the DCSAY). I was wondering if this has something to do with SET EXACT (see button), but this seems to be not true. I already looked through functions used like DC_VarFromListBox() and DC_GetDatalink, but I didn't find any code comparing portions.
If a DCCOMBOBOX/DROPDOWNLIST has a REFRESH clause, something strange is happening if the items for the listbox are somehow similar. As you can see in this sample, the items are "Tom 2", "Tom 21" and "Tom". With REFRESH on, it's almost impossible to briefly select "Tom" - the listbox shows "Tom 2" anyway, but "Tom" IS selected (look at the DCSAY). I was wondering if this has something to do with SET EXACT (see button), but this seems to be not true. I already looked through functions used like DC_VarFromListBox() and DC_GetDatalink, but I didn't find any code comparing portions.
Code: Select all
FUNCTION Main()
LOCAL GetList := {}, oDialog, aTest := {'Tom 2', 'Tom 21', 'Tom'}, cTest := aTest[1], lExact := .F.
@ 1,1 DCCOMBOBOX cTest LIST aTest SIZE 25,15 TYPE XBPCOMBO_DROPDOWNLIST REFRESH /* ITEMSELECTED {||DC_GetRefresh(GetList)} */
@ 3,1 DCSAY {||cTest} SIZE 10,1
@ 4,1 DCSAY {||'EXACT is '+IF(Set(_SET_EXACT),'on','off')} SIZE 10,1
@ 6,1 DCPUSHBUTTON CAPTION {||IF(lExact,'Exact off','Exact on')} SIZE 12,1 ;
ACTION {||lExact := !lExact,Set(_SET_EXACT,lExact),DC_GetRefresh(GetList)}
DCREAD GUI ADDBUTTONS TITLE 'Test' FIT PARENT @oDialog
RETURN nil
PROC AppSys() ; RETURN