Incremental Search with Combo Box
Moderator: Rathinagiri
Incremental Search with Combo Box
Hi,
How can I use combobox with incremental search? My combobox use only the first letter of the item for searching.
Again, I am using combobox mainly within grid
TIA.
With best regards.
Sudip
How can I use combobox with incremental search? My combobox use only the first letter of the item for searching.
Again, I am using combobox mainly within grid
TIA.
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Incremental Search with Combo Box
I think for normal combo box we can have 'sort' enabled. For inplace edit combobox I had not verified the same. Are all of your combo box items are alphabetically arranged?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Incremental Search with Combo Box
Yes, I use sorted array with combo box.rathinagiri wrote:... Are all of your combo box items are alphabetically arranged?
Suppose the list is as follows.
Abcd
Acdb
Adbd
Bdcd
Cdbd
When I press "a", pointer goes to "Abcd". But if I press "ac" (very quickly), pointer goes to "Cdbd".
TIA.
Regards.
Sudip
With best regards,
Sudip
Sudip
Re: Incremental Search with Combo Box
Thank you very much!!!Roberto Lopez wrote:I usually solve that, with an OnChange procedure that takes value from edit control of the combo and search inside combo with a loop across all elements.sudip wrote: BTW, do you have any idea how to use incremental search in combobox. viewtopic.php?f=5&t=404
Again, I want to know that is it possible with the Combo Box used in Grid?
With best regards.
Sudip
With best regards,
Sudip
Sudip
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Incremental Search with Combo Box
Please take a look this trial :
My opinion is : I don't like it
Any comment ?
Regards
--
Esgici
Code: Select all
#include "minigui.ch"
PROC Main()
aCidades := {}
MakeData()
DEFINE WINDOW frmISCBX ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'Incremental Search in Combo Box' ;
MAIN
ON KEY ESCAPE ACTION frmISCBX.Release
DEFINE COMBOBOX cmbIncrS
ROW 10
COL 10
WIDTH 200
ITEMS aCidades
VALUE 1
DISPLAYEDIT .T.
ONDISPLAYCHANGE DoIncrSrch( this.DisplayValue )
END COMBOBOX // cmbIncrS
END WINDOW // frmISCBX
frmISCBX.CENTER
frmISCBX.ACTIVATE
RETURN // Main()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
PROC DoIncrSrch( xDispVal )
LOCAL nItemNo := ASCAN( aCidades, xDispVal )
IF nItemNo > 0
frmISCBX.cmbIncrS.Value := nItemNo
ENDIF nItemNo > 0
RETU // DoIncrSrch()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
PROC MakeData()
aCidades := { "Bagdad" ,;
"Berlim" ,;
"Blumenal" ,;
"Brasilia" ,;
"Buenos aires" ,;
"Canoas" ,;
"Caracas" ,;
"Lima" ,;
"Monte carlo" ,;
"Montreal" ,;
"New york" ,;
"Niger" ,;
"Panama" ,;
"Paris" ,;
"Pequim" ,;
"Rio de janeiro" ,;
"Roma" ,;
"Sao paulo" ,;
"Sidney" ,;
"Tokyo" ,;
"Toronto" }
RETURN // MakeData()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
Any comment ?
Regards
--
Esgici
Viva INTERNATIONAL HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Incremental Search with Combo Box
In this case, if we use 'sort .t.' incremental search is inbuilt. Isn't it?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Incremental Search with Combo Box
If you use SORT instead of ONDISPLAYCHANGE, yes.rathinagiri wrote:In this case, if we use 'sort .t.' incremental search is inbuilt. Isn't it?
If you use them together, no. When added SORT .T., Incr.Search still continue working.
And when extracted SORT, DISPLAYEDIT, and ONDISPLAYCHANGE, single letter search also continue working
Please try, test and clarify if possible. I feel confused
Regards
--
Esgici
Viva INTERNATIONAL HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Incremental Search with Combo Box
I too am confused now.
I never used Displayedit and ondisplaychange features.
I never used Displayedit and ondisplaychange features.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Incremental Search with Combo Box
Hi Esgici,
Again, 2 points :-
1) Will it run "without" using Display Edit. (sometimes Rathi and I think in similar way, I don't know why )
2) How can I use this technique in Grid -> Combo box.
Thank you very much.
With best regards.
Sudip
May I differ with you? I LIKE it very much And it will be very helpful to meMy opinion is : I don't like it
Any comment ?
Again, 2 points :-
1) Will it run "without" using Display Edit. (sometimes Rathi and I think in similar way, I don't know why )
2) How can I use this technique in Grid -> Combo box.
Thank you very much.
With best regards.
Sudip
With best regards,
Sudip
Sudip
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Incremental Search with Combo Box
Hi Sudip
So I don't know either possible using incremental search in that way in the COMBOBOX in GRID.
May be some low-level / undocumented features for achieving this.
Unfortunately all of that features and methods for using theme are completely out of my perspective.
Regards
--
Esgici
If "it" is incremental search, no; if it's single letter search, yes.sudip wrote: Will it run "without" using Display Edit ?
Regarding HMG documentation, COMBOBOX under COLUMNCONTROLS property of GRID have only one property /parameter : acItems; neither event, nor method.How can I use this technique in Grid -> Combo box ?
So I don't know either possible using incremental search in that way in the COMBOBOX in GRID.
May be some low-level / undocumented features for achieving this.
Unfortunately all of that features and methods for using theme are completely out of my perspective.
Regards
--
Esgici
Viva INTERNATIONAL HMG