editable combobox and incremental search

editable combobox and incremental search

Postby Antonio Linares » Thu Sep 25, 2014 11:36 am

is someone using an editable combobox with incremental search ?

FWH supports incremental search on non editable comboboxes, and I am looking for a way to implement it, thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41411
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: editable combobox and incremental search

Postby karinha » Fri Sep 26, 2014 2:43 pm

UNLIMITED ComboBox, Very good!

Code: Select all  Expand view

#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
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7353
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: editable combobox and incremental search

Postby fraxzi » Tue Sep 30, 2014 6:21 am

oCombo1:oGet:bKeyChar = { | nKey | oCombo1:GetKeyChar( nKey ) } // Wow...


Image

I got this..
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: editable combobox and incremental search

Postby Antonio Linares » Tue Sep 30, 2014 8:34 am

Frances,

It seems as your FWH version does not include that method. You need an upgraded FWH, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41411
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: editable combobox and incremental search

Postby fraxzi » Tue Sep 30, 2014 8:59 am

Senyor Antonio,

:)

Exactly as I thought.

Hehehe.

I will justify. Send me price update as usual on my company email.


Kind regards.
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: editable combobox and incremental search

Postby Antonio Linares » Tue Sep 30, 2014 9:08 am

done,

thanks Frances! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41411
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests