ComboBox search problem

ComboBox search problem

Postby Otto » Sun May 18, 2008 12:07 pm

Hello Antonio,
My comboboxes do not search.
I have a problem with combobox and I don’t know what’s wrong.
The combobox is defined as DROPDOWN
(DROPDOWNLIST works ok).


I watched with Spy but I can’t find where the error could be.

Thanks in advance
Otto


Image
Image
Image
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby James Bott » Sun May 18, 2008 12:42 pm

Otto,

>The combobox is defined as DROPDOWN

This style is for data entry of a new item that is not in the list. I don't know that the incremental search ever worked with this style. I haven't thought about it, but if the user is entering a new item, then maybe the incremental search isn't useful.

I am confused since in your private email you said that an older version did work. What version was this? Was it using the incremental search or just a single character jump to the first match?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Otto » Sun May 18, 2008 1:23 pm

Hello James,
thank you for your answer.

In FW this combobox (DROPDOWN) works you can search and you can insert new data.
In my mail I mixed up Dropdown and DropdownList. Only list works.
I had a look into WINDOW-class.
DROPDOWNLIST = a TCOMBOBOX and DROPDOWN’s ClassName is TGet


METHOD KeyDown( nKey, nFlags ) CLASS TWindow

local bKeyAction := SetKey( nKey )

msginfo(str(nKey) +" keydown " +str(nFlags)+" "+Upper( ::ClassName() ) )

if Upper( ::ClassName() ) != "TGET" .and. ::bKeyDown != nil
return Eval( ::bKeyDown, nKey, nFlags )
endif





From the 16 bit DLL
CONTROL "", 1080, "COMBOBOX", CBS_DROPDOWN | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 64, 74, 288, 67


FiveWIN code
REDEFINE COMBOBOX oCbxB VAR cComboB ITEMS aComboB ID 1080 OF oFld:aDialogs [ 1 ]



Image
Image
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Sun May 18, 2008 1:43 pm

Hello James,

I think the KeyDown method in COMBOBOX class is missing.
If you copy the code of the method KeyChar to a new
METHOD KeyDown( nKey, nFlags ) CLASS TComboBox
all is working.
Do you think this could be a solution.
Regards,
Otto
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby James Bott » Sun May 18, 2008 3:29 pm

Otto,

I still need to know the answers to my questions. Which version of FW was the Combobox working as you expected?

How was it working? Was it just jumping to the first occurance of a single letter typed by the user? This was how the old Clipper version worked and earlier versions of FW's combobox. Sometime last year, someone modified TCombobox to do incremental searching (user keeps typing multiple characters and the first mach is found). I don't think the DROPDOWN style ever worked this way.

Fixing it will not be a simple as you suggest. Multiple keys need to be handled including the backspace key. I'm not sure about the logic of this since a user might be able to backspace over an existing item--then what do we do, remove the item from the list, or leave it? There are probably more issues too.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Otto » Sun May 18, 2008 3:44 pm

Hello James,

In my mail I mixed up Dropdown and DropdownList. Only list works.
You are right that Dropdown didn't work.
Regards,
Otto
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby James Bott » Sun May 18, 2008 8:57 pm

Otto,

>In my mail I mixed up Dropdown and DropdownList. Only list works.
>You are right that Dropdown didn't work.

Understood.

But, I still need the answers to my above questions.

If we are going to add (or fix) this feature, we need to come to an aggreement on how it should work. Since incremental searching is how the DROPDOWNLIST works now, it would seem that incremental searching should also be how DROPDOWN works. Possibly there should be a flag so both work the old way or both work the new way.

And we also need to figure out how to handle backspacing and possible removal of data in the list by the user. I have never used this style so I don't know how it used to work. It seems complex since if the user adds or removes data, then the original data source has to be updated.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Otto » Sun May 18, 2008 9:19 pm

Hello James,
I think it should be a kind of an auto complete function.
I am uncertain to how exactly the search should work. But I am sure about that there should be one.
Regards,
Otto
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests