Antonio Linares wrote:You may use the Class TComboBox from the previous FWH build.
Antonio,
I have insert any modification for incremental or previous use.
If insert the new clause INCREMENTAL the incremental search is active
without new clause the Combobox search is the previous version.
Modify this:
in fivewin.ch:
#xcommand @ <nRow>, <nCol> COMBOBOX [ <oCbx> VAR ] <cVar> ;
[ <it: PROMPTS, ITEMS> <aItems> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <dlg:OF,WINDOW,DIALOG> <oWnd> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ ON CHANGE <uChange> ] ;
[ VALID <uValid> ] ;
[ <color: COLOR,COLORS> <nClrText> [,<nClrBack>] ] ;
[ <pixel: PIXEL> ] ;
[ FONT <oFont> ] ;
[ <update: UPDATE> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <uWhen> ] ;
[ <design: DESIGN> ] ;
[ BITMAPS <acBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ] ;
[ STYLE <nStyle> ] ;
[ <pict: PICT, PICTURE> <cPicture> ];
[ ON EDIT CHANGE <uEChange> ] ;
[ <search: INCREMENTAL, SEARCH, INCR_SEARCH> ] ;
=> ;
[ <oCbx> := ] TComboBox():New( <nRow>, <nCol>, bSETGET(<cVar>),;
<aItems>, <nWidth>, <nHeight>, <oWnd>, <nHelpId>,;
[{|Self|<uChange>}], <{uValid}>, <nClrText>, <nClrBack>,;
<.pixel.>, <oFont>, <cMsg>, <.update.>, <{uWhen}>,;
<.design.>, <acBitmaps>, [{|nItem|<uBmpSelect>}], <nStyle>,;
<cPicture>, [<{uEChange}>], [<.search.>] )
#xcommand REDEFINE COMBOBOX [ <oCbx> VAR ] <cVar> ;
[ <items: PROMPTS, ITEMS> <aItems> ] ;
[ ID <nId> ] ;
[ <dlg:OF,WINDOW,DIALOG> <oWnd> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ ON CHANGE <uChange> ] ;
[ VALID <uValid> ] ;
[ <color: COLOR,COLORS> <nClrText> [,<nClrBack>] ] ;
[ <update: UPDATE> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <uWhen> ] ;
[ BITMAPS <acBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ] ;
[ STYLE <nStyle> ] ;
[ <pict: PICT, PICTURE> <cPicture> ];
[ ON EDIT CHANGE <uEChange> ] ;
[ <search: INCREMENTAL, SEARCH, INCR_SEARCH> ] ;
=> ;
[ <oCbx> := ] TComboBox():ReDefine( <nId>, bSETGET(<cVar>),;
<aItems>, <oWnd>, <nHelpId>, <{uValid}>, [{|Self|<uChange>}],;
<nClrText>, <nClrBack>, <cMsg>, <.update.>, <{uWhen}>,;
<acBitmaps>, [{|nItem|<uBmpSelect>}], <nStyle>, <cPicture>,;
[<{uEChange}>], [<.search.>] )
in Combobox.prg
// at the top
#define MY_INCREMENTAL_SEARCH .F.
...
CLASS TComboBox FROM TControl
...
DATA lIncrSearch
...
METHOD New( nRow, nCol, bSetGet, aItems, nWidth, nHeight, oWnd, nHelpId,;
bChange, bValid, nClrFore, nClrBack, lPixel, oFont,;
cMsg, lUpdate, bWhen, lDesign, acBitmaps, bDrawItem, nStyle,;
cPict, bEChange, lIncSearch ) CLASS TComboBox
...
DEFAULT ...,;
lIncSearch := MY_INCREMENTAL_SEARCH
...
::lIncrSearch := lIncSearch
...
METHOD ReDefine( nId, bSetGet, aItems, oWnd, nHelpId, bValid, ;
bChange, nClrFore, nClrBack, cMsg, lUpdate, ;
bWhen, acBitmaps, bDrawItem, nStyle, cPict, ;
bEChange, lIncSearch ) CLASS TComboBox
...
DEFAULT ...,;
lIncSearch := MY_INCREMENTAL_SEARCH
...
::lIncrSearch := lIncSearch
...
METHOD KeyChar( nKey, nFlags ) CLASS TComboBox
...
IF ::lIncrSearch
// Incremental search
// Actual code 70x version
else
// previous method
Return Super:KeyChar( nKey, nFlags )
endif
Return Nil
if you want i send to your private mail the source.