Jump to content
Fivewin Brasil

Autocomplete


emotta

Recommended Posts

Vejam o texto abaixo relacionado a última versão do FWH:

A intenção do Linares é combinar o AutoGet com o Get na próxima versão.

* New: Class TAutoGet developed by Daniel Garcia Gil. This is a GET that provides
suggestions while you type into the GET. Daniel developed this Class before
knowing of Marcelo Via's new similar class (that uses xbrowse) to this one.
Our intent is to combine both classes in next FWH versions, so we gest the best
functionality from them.

Please review samples\testaget.prg, testage2.prg...testage5.prg. Please review
include\autoget.ch to review its syntax and supported clauses.

Link to comment
Share on other sites

  • 2 months later...

Bom Dia pessoal!!!

Vi a necessidade de alterar uma linha nesta classe que fiz no meu para que mostre todos os produtos do vetor e tenha a opção do Scrool Vertical

Alterei a linha:

no : METHOD FillList() CLASS TListGet

// ::oWin:SetSize( ::nWidth, ( LEN( ::aData ) ) * GetTextHeight( ::hWnd ) + LEN( ::aData ) )
::oWin:SetSize( ::nWidth, ( ::lenDisplay * GetTextHeight( ::hWnd ) ) )
no : METHOD Initiate( hDlg ) CLASS TListGet
/// ::oBrw:lVScroll := .F.
::oBrw:lVScroll := .T.
Link to comment
Share on other sites

Eu uso o ComboEdit a anos, ja fiz algumas alterações nele e funciona bem.

Se servir pra alguem, tai o exemplo e a função


   Redefine Combobox oCb771_Cidades var vCb771_Cidades ;
            items aCb771_Cidades id 771 of oDlgBairros ;
            PICTURE "@!" STYLE CBS_DROPDOWN 

   oCb771_Cidades:oGet:bChange := ;
          {|nKey,nFlags,Self| ComboEdit( nKey,nFlags,Self,oCb771_Cidades,oDlgBairros)}



///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
FUNCTION ComboEdit(f_nKey,f_nFlags,f_oGet,f_oCbx,f_oDlgCont)
  Local cBuffer := "", lInsert := .f., nPosGet := f_oGet:nPos 
  Local nPos
  
  IF Set( _SET_INSERT )
     lInsert := .t.
  ENDIF
  
  IF f_nKey == 13
     f_oDlgCont:gonextCtrl(getfocus())
  ENDIF
  
  IF f_nKey == 9
     f_oDlgCont:goPrevCtrl(getfocus())
  ENDIF
  
  IF f_nKey >= 48 .and. f_nKey <= 128

    if f_oGet:lFocused
       cBuffer := Left(GetWindowText(f_oGet:hWnd), f_oGet:oGet:Pos -1)
    else
       Return nil
    endif

    nPos := f_oCbx:FindString(cBuffer,Len(cBuffer))

    IF nPos > 0

      f_oCbx:open()
      f_oCbx:Select(nPos)
      f_oGet:VarPut(f_oCbx:aItems[nPos])
      f_oGet:oGet:UpDateBuffer()
  
      IF lInsert .and. nPos > 0
         IF f_oGet:lfocused()
            f_oGet:oGet:Delete()
            f_oGet:oGet:UpDateBuffer()
         ENDIF
      ENDIF

      f_oGet:DispText()
      f_oGet:SetPos(nPosGet)

    ELSE
      f_oCbx:SendMsg(335, 0 )
      f_oGet:VarPut(cBuffer+space(len(f_oGet:oGet:VarGet())-len(cBuffer)))
      f_oGet:oGet:UpDateBuffer()
      f_oGet:DispText()
      f_oGet:SetPos(nPosGet)
    ENDIF
  
  ENDIF

Return Nil

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...