PDA

View Full Version : Procedure OnDropDown in Comboform class is still broken



Nils G. Svedmyr
17-Mar-2014, 01:40 PM
The comboform class still has the same old bug it (always?) have had.

Consider the following simple example:


Object oComboForm1 is a ComboForm
Set Size to 13 100
Set Location to 166 174
Set Entry_State to False

Procedure Combo_Fill_List
Send Combo_Add_Item "{Value 1}"
Send Combo_Add_Item "{Value 2}"
Send Combo_Add_Item "{Value 3}"
Send Combo_Add_Item "{Value 4}"
End_Procedure

Procedure OnChange
String sValue

Get Value to sValue
End_Procedure

Procedure OnCloseUp
String sValue

Get Value to sValue
End_Procedure

End_Object


Drop on a sample view, set break-points on the two "Get Value to sValue" lines; one in OnChange and the other in OnCloseUp

The value will be correct for OnChange but is "out of sync" for the OnCloseUp message, i.e. it trails behind showing the previous value, instead of the newly selected one. Sometimes the OnChange is not suitable to be used and the OnCloseUp event is needed.

Any change of this being fixed?

TIA!

Garret Mott
17-Mar-2014, 01:46 PM
I'd so love to see that fixed. I have a bunch of comboforms set to No Entry because I have to use OnChange.

Been there since (at least) 9.1 I believe.

Frank Cheng
18-Mar-2014, 10:48 AM
I wasn't aware of the bug, I gotta go back to all my source code to see if we "Get Value" inside OnCloseUp. In the mean time, here is a workaround

Instead of doing "Get Value" inside the event OnCloseUp, try using

Get WinCombo_Value (WinCombo_Current_Item(Self)) to sValue

Or you can augment the function Value in your subclass



Function Value Returns String
String sValue
If (Window_Handle(Self)) Get WinCombo_Value (WinCombo_Current_Item(Self)) to sValue
Else Forward Get Value to sValue
Function_Return sValue
End_Function


Frank Cheng

Nils G. Svedmyr
18-Mar-2014, 10:57 AM
Hi Frank,

Thanks. That is pretty much what I have in my subclasses. But working on a lot of different projects (most of the time not my projects) makes it easy to forget to add bugfixes like these and it will come back to bite you.

So it is therefor I ask DAW to finally fix this very old bug.

Allan Greis Eriksen
27-Mar-2014, 08:37 AM
+1