Page 1 of 1
DC_VarToListBox function sets my PC Slow
Posted: Fri May 24, 2013 8:14 am
by digitsoft
Hi Roger
DC_VarToListBox function sets my PC Slow
Paulino Nolberto
A cordial greeting
Re: DC_VarToListBox function sets my PC Slow
Posted: Sat May 25, 2013 9:34 am
by Auge_Ohr
digitsoft wrote:DC_VarToListBox function sets my PC Slow
how big is you Array

hide Listbox when "fill" will speed up a lot.
Re: DC_VarToListBox function sets my PC Slow
Posted: Mon May 27, 2013 5:18 am
by digitsoft
Auge_Ohr wrote:digitsoft wrote:DC_VarToListBox function sets my PC Slow
how big is you Array

hide Listbox when "fill" will speed up a lot.
Hi Jimmy
It is an array of 10 Items to Maximo
The slow when I give presents him several times to load the DCCOMBOBOX Array
Paulino Nolberto
Regards
Re: DC_VarToListBox function sets my PC Slow
Posted: Thu May 30, 2013 4:18 pm
by rdonnay
I looked at the code and there is nothing there that looks unusual.
This may be a behavior of the XbpComboBox.
I have seen other problems with that class in the past.
It didn't generate events correctly.
Code: Select all
FUNCTION DC_VarToListBox( oXbp, aVar, aMarked )
LOCAL bVar, aArray, i, oListBox, aArrayLeft, aArrayRight
IF oXbp:isDerivedFrom('XbpComboBox')
oListBox := oXbp:XbpListBox
ELSEIF oXbp:isDerivedFrom('XbpListBox')
oListBox := oXbp
ELSEIF oXbp:isDerivedFrom('DC_XbpPickList')
oXbp:leftListBox:clear()
oListBox := oXbp:leftListBox
IF Valtype(aVar) = 'A'
aArrayLeft := aVar
ELSE
bVar := oXbp:leftAnchor
aArrayLeft := Eval(bVar)
ENDIF
oXbp:rightListBox:clear()
oListBox := oXbp:rightListBox
IF Valtype(aMarked) = 'A'
aArrayRight := aMarked
ELSE
bVar := oXbp:dataLink
aArrayRight := Eval(bVar)
ENDIF
oXbp:SetData(aArrayLeft,aArrayRight)
RETURN nil
ELSE
RETURN nil
ENDIF
oListBox:clear()
IF Valtype(aVar) = 'A'
aArray := aVar
ELSE
bVar := oXbp:listBlock
aArray := Eval(bVar)
ENDIF
IF Valtype(aArray) = 'A'
FOR i := 1 TO LEN(aArray)
oListBox:Additem(aArray[i])
NEXT
IF oXbp:isDerivedFrom('XbpPickList')
oXbp:SetData(aArray)
ELSEIF Valtype(aMarked) = 'A' // Preset the list
oListBox:setData(aMarked, .T.)
DC_VarFromListBox(oXbp)
ENDIF
ENDIF
RETURN nil
Re: DC_VarToListBox function sets my PC Slow
Posted: Fri May 31, 2013 7:30 am
by digitsoft
Thanks Roger
I check the code and when it reaches this line oListBox: clear ()
remains firzado
if the annulus using *** oListBox: clear () on the line the combo box
limpra not the array but is not frizzy.
Paulino Nolberto
Best Regards
rdonnay wrote:I looked at the code and there is nothing there that looks unusual.
This may be a behavior of the XbpComboBox.
I have seen other problems with that class in the past.
It didn't generate events correctly.
Code: Select all
FUNCTION DC_VarToListBox( oXbp, aVar, aMarked )
LOCAL bVar, aArray, i, oListBox, aArrayLeft, aArrayRight
IF oXbp:isDerivedFrom('XbpComboBox')
oListBox := oXbp:XbpListBox
ELSEIF oXbp:isDerivedFrom('XbpListBox')
oListBox := oXbp
ELSEIF oXbp:isDerivedFrom('DC_XbpPickList')
oXbp:leftListBox:clear()
oListBox := oXbp:leftListBox
IF Valtype(aVar) = 'A'
aArrayLeft := aVar
ELSE
bVar := oXbp:leftAnchor
aArrayLeft := Eval(bVar)
ENDIF
oXbp:rightListBox:clear()
oListBox := oXbp:rightListBox
IF Valtype(aMarked) = 'A'
aArrayRight := aMarked
ELSE
bVar := oXbp:dataLink
aArrayRight := Eval(bVar)
ENDIF
oXbp:SetData(aArrayLeft,aArrayRight)
RETURN nil
ELSE
RETURN nil
ENDIF
oListBox:clear()
IF Valtype(aVar) = 'A'
aArray := aVar
ELSE
bVar := oXbp:listBlock
aArray := Eval(bVar)
ENDIF
IF Valtype(aArray) = 'A'
FOR i := 1 TO LEN(aArray)
oListBox:Additem(aArray[i])
NEXT
IF oXbp:isDerivedFrom('XbpPickList')
oXbp:SetData(aArray)
ELSEIF Valtype(aMarked) = 'A' // Preset the list
oListBox:setData(aMarked, .T.)
DC_VarFromListBox(oXbp)
ENDIF
ENDIF
RETURN nil
Re: DC_VarToListBox function sets my PC Slow
Posted: Tue Jun 04, 2013 7:56 am
by digitsoft
Hi Roger
The problem was not the COMBOBOX Table or Database had a register in Blanc and the system to stay Very Slow
Thanks for your help
Paulino Nolberto
Regards