Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHAutoComplete
#18
Without the above functions,
In some cases, the match cannot be found, resulting in output errors

For example, typing qmd does not match QMD
[Image: b.gif]

Macro M2
Code:
Copy      Help
_s=
;abc
;ba
;QM
;QM3
;QMD
;cp
;es
;fw
;hw

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 ComboBox 0x54230641 0x0 8 8 96 122 ""
;4 Edit 0x54030080 0x200 116 8 96 12 ""
;5 Edit 0x54030080 0x204 116 32 96 12 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040B01 "*" "" "" ""

str controls = "3 4 5"
str cb3 e4 e5
cb3=_s
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
mes cb3


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_TIMER
,sel wParam
,,case 1
,,KillTimer hDlg wParam
,,str e3sf.getwintext(id(4 hDlg))
,,e3sf.setwintext(id(5 hDlg))
,,e3sf.setwintext(id(3 hDlg))
,,
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case EN_CHANGE<<16|4
,SetTimer hDlg 1 100 0
,case CBN_EDITCHANGE<<16|3
,sub.CB_AutoComplete lParam
ret 1

#sub CB_AutoComplete
function hcb

ifk(B) ret
ifk(X) ret
str s ss; int i
s.getwintext(hcb)
if(s.len)
,i=CB_FindItem(hcb s)
,if(i>=0)
,,CB_GetItemText(hcb i ss)
,,if(ss.len>s.len)
,,,ss.setwintext(hcb)
,,,SendMessage(hcb CB_SETEDITSEL 0 ss.len<<16|s.len)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)