Page 1 of 3
A better Listbox/Combobox
Posted: Sat Jan 10, 2009 3:51 pm
by raumi75
Hello,
I only use hmg for a few weeks now, but already, I am amazed, what I can do with my old clipper-code.
Of course, I still have some wishes left. The Listbox/Combobox-behaviour is something that could be improved.
When the user types a key, the first item that starts with that letter gets selected. But when the user types the second letter, it jumps to the first item that starts with that letter.
Much better would be the behaviour of the Firefox-Combobox: The second key gets interpreted as the second letter of the item. If you pause for a while, the key is interpreted as the first letter, again.
When dealing with long lists, it would make it so much more comfortable.
I am not sure, if you can change the Combobox, or if you just use the Windows API.
Have a nice weekend
Raumi75
Re: A better Listbox/Combobox
Posted: Sat Jan 10, 2009 6:21 pm
by Rathinagiri
Hi,
Thanks for trying HMG.
The feature you are mentioning, is already there Raumi.
The only thing is, you have to add the option "Sort".
This is the syntax for combobox from Roberto's reference.
Code: Select all
@ <nRow> ,<nCol>
COMBOBOX <ControlName>
[ OF | PARENT <ParentWindowName> ]
[ ITEMS <caItems> ]
[ ITEMSOURCE <ItemSourceField1> [ , <ItemSourceField2> ] ]
[ VALUE <nValue> ]
[ VALUESOURCE <ValueSourceField> ]
[ DISPLAYEDIT ]
[ WIDTH <nWodth> ]
[ HEIGHT <nHeight>]
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ ON ENTER <OnEnterProcedure> | <bBlock> ]
[ ON DISPLAYCHANGE <OnDisplayChangeProcedure> | <bBlock> ]
[ ON DROPDOWN <OnDropDownProcedure> | <bBlock> ]
[ ON CLOSEUP <OnCloseUpProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ BREAK ]
[ GRIPPERTEXT <cGripperText> ]
[ INVISIBLE ]
[ SORT ]
[ IMAGE <acImageNames> ]
[ DROPPEDWIDTH <nDroppedWidth> ]
In this, after invisible, you can see an option SORT.
Re: A better Listbox/Combobox
Posted: Sat Jan 10, 2009 9:22 pm
by raumi75
rathinagiri wrote:
The only thing is, you have to add the option "Sort".
Hello rathinagiri,
thank you for the quick reply. Great to hear that this feature is already implemented.
I just did not expect the SORT-option to do that.
Raumi75
Re: A better Listbox/Combobox
Posted: Sat Nov 09, 2013 8:48 pm
by tonton2
Bonsoir tout le monde,
où dois je mettre l'option "SORT" du COMBOBOX dans la grille suivante 'GRID09' à la ligne 54
grand merci a vous
Hi everyone,
Where must I put the "SORT" option COMBOBOX in the following grid 'GRID09' on line 54.
big thank you to you all
Code: Select all
/*
* HMG Grid Demo
* (c) 2005 Roberto Lopez
*/
#include "hmg.ch"
Function Main
Local aRows [20] [3]
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 400 ;
TITLE 'Mixed Data Type Grid Test' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP 'File'
MENUITEM 'Set Item' ACTION SetItem()
MENUITEM 'Get Item' ACTION GetItem()
END POPUP
END MENU
aRows [1] := {113.12,date(),1,1 , .t. }
aRows [2] := {123.12,date(),2,2 , .f. }
aRows [3] := {133.12,date(),3,3, .t. }
aRows [4] := {143.12,date(),1,4, .f. }
aRows [5] := {153.12,date(),2,5, .t. }
aRows [6] := {163.12,date(),3,6, .f. }
aRows [7] := {173.12,date(),1,7, .t. }
aRows [8] := {183.12,date(),2,8, .f. }
aRows [9] := {193.12,date(),3,9, .t. }
@ 10,10 GRID Grid_1 ;
WIDTH 620 ;
HEIGHT 330 ;
HEADERS {'Column 1','Column 2','Column 3','Column 4','Column 5'} ;
WIDTHS {140,140,140,140,140} ;
ITEMS aRows ;
EDIT ON CHANGE playbeep() ;
COLUMNCONTROLS { {'TEXTBOX','NUMERIC','$ 999,999.99'} , {'DATEPICKER','DROPDOWN'} ,{'COMBOBOX',{'One','Two','Three'}}, { 'SPINNER' , 1 , 20 } , { 'CHECKBOX' , 'Yes' , 'No' } } ;
CELLNAVIGATION
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
PROCEDURE SETITEM()
Form_1.Grid_1.Item (2) := { 123.45 , date() , 2 , 10 , .T. }
RETURN
Re: A better Listbox/Combobox
Posted: Sat Nov 09, 2013 9:58 pm
by esgici
Salaam aleik Tabet
tonton2 wrote:
Where must I put the "SORT" option COMBOBOX in the following grid 'GRID09' on line 54.
COLUMNCONTROLS property of GRID is a very handy feature.
But controls used in this property are limited versions of _real_ controls;
haven't all "specialties" ( properties, methods, events ) of them.
As an example, although when COMBOBOX control used alone has more than 30 "specialties", as a COLUMNCONTROL in GRID has only three:
Code: Select all
COMBOBOX
{ cControlType , acItems , axReturnValues }
cControlType 'COMBOBOX' (Required)
acItems (Required)
axReturnValues (Optional)
As a result : we can't use SORT ( and many other ) property of self-contained COMBOBOX, in the COMBOBOX as COLUMNCONTROL in GRID.
Maassalaam
Happy HMG

Re: A better Listbox/Combobox
Posted: Sun Nov 10, 2013 8:43 am
by tonton2
Alakum assalam,
Merci beaucoup mon ami
thank you very much my friend
Re: A better Listbox/Combobox
Posted: Tue Nov 12, 2013 3:12 pm
by tonton2
Hi to all the team,
can you be used in place of COMBOBOX => COMBOBOXSEARCH ?
if so, how do it?
Merci beaucoup
Re: A better Listbox/Combobox
Posted: Tue Nov 12, 2013 4:19 pm
by esgici
Hi Tabet
tonton2 wrote: can you be used in place of COMBOBOX => COMBOBOXSEARCH ?
if so, how do it?
Where ?
If in any form as a _normal_ control, yes;
if in GRID as a column control, no
A column control in GRID may be : TEXTBOX, DATEPICKER, COMBOBOX, SPINNER or CHECKBOX.
Happy HMG
Maassalam
Re: A better Listbox/Combobox
Posted: Tue Nov 12, 2013 5:52 pm
by tonton2
COLUMNCONTROLS { {'TEXTBOX','NUMERIC','$ 999,999.99'} , {'DATEPICKER','DROPDOWN'} ,{'COMBOBOX',{'One','Two','Three'}},
merci,
thank you so much now, I'll find another way to do it
Re: A better Listbox/Combobox
Posted: Tue Nov 12, 2013 6:07 pm
by tonton2
raumi75 wrote:Hello,
......
When the user types a key, the first item that starts with that letter gets selected. But when the user types the second letter, it jumps to the first item that starts with that letter.............; The second key gets interpreted as the second letter of the item.., etc...
.......
When dealing with long lists, it would make it so much more comfortable.
Raumi75
c'est ce que je veux faire dans la grille avec un equivalent de COMBOSEARCHBOX
this is what I want to do in the grid with an equivalent of a COMBOSEARCHBOX
Assalama