Text Autocompletion?

Text Autocompletion?

Postby reinaldocrespo » Wed Nov 29, 2006 12:46 am

Anybody?


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Antonio Linares » Wed Nov 29, 2006 7:05 am

Reinaldo,

Using the GET bChange data you can search on a database and if the beginning of a word is found then you can modify the GET contents.
regards, saludos

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

Postby Frank Demont » Wed Nov 29, 2006 3:07 pm

Code: Select all  Expand view
#include "FiveWin.ch"

//------------------------------------------------------------------------//

function Main()

   local oDlg
    local cText := "AUTOFILL"
   local oGet

   DEFINE DIALOG oDlg TITLE "Just a get"

   @ 2,  2 SAY "Date:" OF oDlg
   @ 2,  6 GET oGet VAR cText OF oDlg SIZE 40, 10 ;
      VALID ! Empty( cText) PICTURE "@K!"

         oGet:bChange := {|self|test(self , oGet)}

   @ 3,  7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
   @ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
   ACTIVATE DIALOG oDlg CENTERED
return nil
//------------------------------------------------------------------------//
Proc Test(nKey , OGet)
*******************
LOCAL a := {"ABCD" , "ACBCDE" , "ABDCD" , "ABCDEFGH"}
LOCAL Len
LOCAL cBuf , n  , nPos := oGet:nPos
IF nKey == 8 // Delete character
   RETURN
END
oGet:Assign()
cBuf := oGet:Varget()
Len := LEN(cBuf)
cBuf := LEFT(cBuf , nPos-1)
IF (n := ASCAN(a, cBuf)) > 0
   oGet:Varput(PAD(a[n],Len))
   oGet:Refresh()
   oGet:SetPos(nPos)
END
RETURN
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Postby reinaldocrespo » Thu Nov 30, 2006 1:56 pm

Antonio/Frank;

Thank you very, very much. Very useful.



Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 49 guests