Uniface User Forum

 View Only
  Thread closed by the administrator, not accepting new replies.
  • 1.  Uniface 4GL: Combobox

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Combobox

    Author: kevin_darbin@hargreaveslansdown.co.uk (kevindarbin)

    Autocomplete: When you type in the combo box, can the most relevant option in the dropdown list be displayed within the box



  • 2.  RE: Uniface 4GL: Combobox

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Hi Kevin, here is a (7.2.04) *.pro using the editfield fedit and the Listbox fListbox populated with the associative list Albert=Albert<;>Alfons=Alfons<;>Bart=Bart Trigger from Form: A_AUTOCOMPLETE ****** entry lp_AutoCopy 1 if (fListbox != "") 2-1 fEdit = fListbox 3-1 message/info "Copy done" 4-1 endif 5 end ; lp_AutoCopy ****** entry lp_AutoPosition 1 variables 2 string v_valrep, v_temp, v_edit, v_positem 3 numeric n_position 4 endvariables 5 message/hint "Autoposition for %%fEdit%%%" 6 getitem/id v_temp,$valrep(fLISTBOX),v_edit 7 if ($status > 0) ; hit 8-1 fListbox = v_temp 9-1 return(0) 10-1 else 11-1 v_positem = "" 12-1 v_valrep = $valrep(fListbox) 13-1 uppercase (v_valrep,v_valrep) 14-1 uppercase (fEdit,v_edit) 15-1 putitem v_valrep,-1,"%%v_edit%%%=%%v_edit%%%" 16-1 sort/list v_valrep 17-1 getitem/id v_temp,v_valrep,v_edit 18-1 getitem v_positem,$valrep(fLISTBOX),$status 19-1 if (v_positem = "") 20-2 getitem v_positem,$valrep(fLISTBOX),-1 21-2 endif 22-1 endif 23 fListbox = IDPART(v_positem) 24 return(0) 25 end ; lp_AutoPosition Trigger from Field: FEDIT.DUMMY.DUMMY ****** Y40:: 1 call LP_AUTOCOPY Trigger from Field: FEDIT.DUMMY.DUMMY ****** Y45:: 1 call do_macro 2 return(99) ****** entry do_macro 1 macro "^next^field^previous^field^last_text" Trigger from Field: FEDIT.DUMMY.DUMMY ****** Y53:: 1 call LP_AUTOPOSITION


    Author: ulrich-merkel (ulrichmerkel@web.de)