UNLIMITED ComboBox, Very good!
#include "FiveWin.ch"
FUNCTION Test()
LOCAL oDlg , oCombo1, oExit, oLeft, oRight, oFnt, oFont
dbcreate("testdb.dbf",{{"feld1","C",10,0}})
USE
USE ("testdb.dbf") ALIAS "testdb" NEW EXCLUSIVE
testdb->(dbappend())
testdb->feld1 := replicate("A",len(testdb->feld1))
testdb->(dbappend())
testdb->feld1 := "ABCDEFGHIJ"
testdb->(dbappend())
testdb->feld1 := replicate("B",len(testdb->feld1))
testdb->(dbgotop())
SetGetColorFocus()
SkinButtons() // Show...
DEFINE FONT oFnt NAME "Ms Sans Serif" SIZE 0, 14 BOLD //UnderLine
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -14 BOLD //UnderLine
DEFINE DIALOG oDlg TITLE "Combobox CBS_DROPDOWN Search In..." ;
FROM 0,0 TO 304, 350 PIXEL COLORS CLR_BLACK, CLR_WHITE TRANSPARENT
oDlg:lHelpIcon := .F.
@ 1,2 SAY "Recno: "+alltrim(str(testdb->(recno()))) UPDATE
@ 2, 2 COMBOBOX oCombo1 VAR testdb->feld1 ;
PROMPTS { replicate("A",len(testdb->feld1)), ;
replicate("B",len(testdb->feld1))} OF oDlg SIZE 80, 80 ;
STYLE CBS_DROPDOWN UPDATE
oCombo1:oGet:bKeyChar = { | nKey | oCombo1:GetKeyChar( nKey ) } // Wow...
@ 3,2 SAY "Type a letter for search... God save the king." UPDATE ;
COLORS CLR_HRED, CLR_WHITE
@ 4, 8 BUTTON oLeft PROMPT "&Left" OF oDlg ;
ACTION if( testdb->(recno())>1,(testdb->(dbskip(-1) ), ;
oDlg:update()),msginfo("Begin of DB") )
oLeft:cToolTip := "Use Left For Incremental Search"
@ 4, 17 BUTTON oRight PROMPT "&Right" OF oDlg ;
ACTION if( testdb->(recno())<3,(testdb->(dbskip(1)), ;
oDlg:update()),msginfo("End of DB") )
oRight:cToolTip := "Use Right For Incremental Search"
@ 6,1 SAY "1. Go with > to the second record."+CRLF+ ;
"2. Go with > to the third record"+CRLF+ ;
"3. Go with < return to the second record"+CRLF+ ;
"4. Open the Combobox with the arrow"+CRLF+CRLF+;
"Now you see, that the second record also is 'AAAAAAAAAA'" ;
SIZE 200,50
@ 7.50, 12 BUTTON oExit PROMPT "&Exit" OF oDlg ;
ACTION ( oDlg:End() ) CANCEL UPDATE
oExit:cToolTip := "Exit"
SET FONT OF oLeft TO oFont
SET FONT OF oRight TO oFont
SET FONT OF oExit TO oFont
ACTIVATE DIALOG oDlg CENTERED
oFnt:End()
oFont:End()
USE
RETURN NIL