View Issue Details

IDProjectCategoryView StatusLast Update
0020569LazarusLCLpublic2012-03-15 19:54
Reportermargu149Assigned ToVincent Snijders 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.30.2RC1Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0020569: TComboBox always AutoCompletes when DroppedDown
DescriptionDropped down combobox is always autocompleting even if AutoComplete is set to False. After that ItemIndex is not updated correctly.
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0020056 closedMartin Friebe DropDown, impossible to enter certain values, due to autoselect of existing entries 

Activities

Bart Broersma

2011-10-26 23:44

developer   ~0053488

What OS and widgetset are you using?

margu149

2011-10-27 08:43

reporter   ~0053492

i386 - win32 - Win32/64

Bart Broersma

2011-10-28 19:43

developer   ~0053559

Last edited: 2011-10-28 19:46

Did it do that in 0.9.30 also, or is it a regression?

It doesn't in trunk (r31810M) b.t.w.

I'll attach a sample program. Can you build with 0.9.30.2RC2 and 0.9.30, and run.
Then do the following:

Uncheck the checkbox Autocomplete
Select csDropDown from the radiogroup
In the combobox type one (1) 'b' (without the quotes).
What is the output in the console?
What is the text in the combobox after you typed the 'b'?
Exit the combobox (press Tab), what is the output in the console?

Repeat, but now with the checkbox Autocomplete checked.

2011-10-28 19:44

 

cbselect.zip (3,837 bytes)

Bart Broersma

2011-10-28 19:48

developer   ~0053560

Maybe related to 0016816 (?)

2011-10-29 15:22

 

cbtest.zip (2,818 bytes)

margu149

2011-10-29 15:23

reporter   ~0053579

I got "unit1.pp(9,22) Fatal: Can't find unit Win9xWsManager used by unit1"

I really hope that "Win9xWsManager" is not relevant to this case
because it seemed to build and run fine without it.

The results are the same for all three versions (0.9.30, 0.9.30.2RC1 and 0.9.30.2RC2)

If combobox was not dropped down everything worked as expected.
with Autocomplete unchecked
for 'b' console responded 'ComboBox1.OnChange: ItemIndex = -1 (nothing selected)' and text is 'b'
after exiting console responded 'ComboBox.Exit: ItemIndex = -1 (nothing selected)' and text is still 'b'


with Autocomplete checked
for 'b' console responded 'ComboBox1.OnChange: ItemIndex = -1 (nothing selected)' and text is 'bbb' (last 2 selected)
after exiting console responded 'ComboBox.Exit: ItemIndex = 4-> bbb' and text is 'bbb'

The problem occurs when the Autocomplete is unchecked and combobox is dropped down
for 'b' console responded 'ComboBox1.OnChange: ItemIndex = -1 (nothing selected)' and text is 'b'
after exiting console responded 'ComboBox.Exit: ItemIndex = -1 (nothing selected)' but text changed to 'bbb'

It seems that the problem with ItemIndex does not occur with static items.

I wrote a test program to illustrate the problem (cbtest).
I started the program and typed 'aa bb' into combobox and clicked Add
after that 'ccc' and Add
and after that 'aa' and Add.

This resulted in the following log (in memo1)
ComboBox1.OnEditingDone: ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = -1
ComboBox1.OnEditingDone: ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = -1
AddButton.OnClick: added 'aa bb'; ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = -1
ComboBox1.OnEditingDone: ComboBox1.Caption = 'ccc'; ComboBox1.ItemIndex = 0 ->'aa bb'
ComboBox1.OnEditingDone: ComboBox1.Caption = 'ccc'; ComboBox1.ItemIndex = 0 ->'aa bb'
AddButton.OnClick: added 'ccc'; ComboBox1.Caption = 'ccc'; ComboBox1.ItemIndex = 0 ->'aa bb'
ComboBox1.OnEditingDone: ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = 1 ->'ccc'
ComboBox1.OnEditingDone: ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = 1 ->'ccc'
AddButton.OnClick: added 'aa bb'; ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = 1 ->'ccc'

It seems that EditingDone is called twice
First when the drop down list closes
and the second when the combobox loses focus.

'aa' was changed to 'aa bb' as soon as drop down list closed

Bart Broersma

2011-10-29 17:09

developer   ~0053582

> I got "unit1.pp(9,22) Fatal: Can't find unit Win9xWsManager used by unit1"
> I really hope that "Win9xWsManager" is not relevant to this case

It isn't. It is only relevant if you work with win9x and any of the components does some Utf8UpperCase/Utf8Lowercase.

> The problem occurs when the Autocomplete is unchecked and combobox is
> dropped down for 'b' console responded
> 'ComboBox1.OnChange: ItemIndex = -1 (nothing selected)' and text is 'b'
> after exiting console responded
> 'ComboBox.Exit: ItemIndex = -1 (nothing selected)' but text changed to 'bbb'

Same in trunk.

Luiz Americo

2011-12-11 16:23

developer   ~0054944

Setting AutoDropDown and AutoSelect works fine here Lazarus 0.9.31 r34045 FPC 2.4.4 i386-win32-win32/win64

ComboBox1.OnEditingDone: ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = -1
AddButton.OnClick: added 'aa bb'; ComboBox1.Caption = 'aa bb'; ComboBox1.ItemIndex = -1
ComboBox1.OnEditingDone: ComboBox1.Caption = 'ccc'; ComboBox1.ItemIndex = -1
AddButton.OnClick: added 'ccc'; ComboBox1.Caption = 'ccc'; ComboBox1.ItemIndex = -1
ComboBox1.OnEditingDone: ComboBox1.Caption = 'aa'; ComboBox1.ItemIndex = -1
AddButton.OnClick: added 'aa'; ComboBox1.Caption = 'aa'; ComboBox1.ItemIndex = -1

Vincent Snijders

2012-03-15 19:53

manager   ~0057689

No feedback from reporter. Probably fixed in 0.9.31.

Issue History

Date Modified Username Field Change
2011-10-26 14:39 margu149 New Issue
2011-10-26 23:44 Bart Broersma LazTarget => -
2011-10-26 23:44 Bart Broersma Note Added: 0053488
2011-10-26 23:44 Bart Broersma Status new => feedback
2011-10-27 08:43 margu149 Note Added: 0053492
2011-10-28 19:43 Bart Broersma Note Added: 0053559
2011-10-28 19:44 Bart Broersma File Added: cbselect.zip
2011-10-28 19:46 Bart Broersma Note Edited: 0053559
2011-10-28 19:48 Bart Broersma Note Added: 0053560
2011-10-29 15:22 margu149 File Added: cbtest.zip
2011-10-29 15:23 margu149 Note Added: 0053579
2011-10-29 17:09 Bart Broersma Note Added: 0053582
2011-10-29 17:12 Bart Broersma Status feedback => confirmed
2011-11-17 20:25 Juha Manninen Relationship added related to 0020056
2011-12-11 16:23 Luiz Americo Note Added: 0054944
2011-12-11 16:23 Luiz Americo Status confirmed => feedback
2012-03-15 19:53 Vincent Snijders Status feedback => resolved
2012-03-15 19:53 Vincent Snijders Fixed in Version => 0.9.31 (SVN)
2012-03-15 19:53 Vincent Snijders Resolution open => fixed
2012-03-15 19:53 Vincent Snijders Assigned To => Vincent Snijders
2012-03-15 19:53 Vincent Snijders Note Added: 0057689