04-07-2009, 12:45 PM
this is my take on it.
Function Dialog2
Trigger F12
Function LB_GetList
Function LB_AutoComplete
Function Dialog2
Trigger F12
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4 5 6"
str lb3 lb4 lb5 lb6
lb3 = "hey[]you[]how[]are[]u"
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ListBox 0x54230101 0x200 0 0 96 48 ""
;4 ListBox 0x54230101 0x200 100 0 96 48 ""
;5 ListBox 0x54230101 0x200 0 52 96 48 ""
;6 ListBox 0x54230101 0x200 100 52 96 48 ""
;END DIALOG
;DIALOG EDITOR: "" 0x203000A "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case [LBN_SELCHANGE<<16|3 ,LBN_SELCHANGE<<16|4 ,LBN_SELCHANGE<<16|5, LBN_SELCHANGE<<16|6]
,_i=LB_SelectedItem(lParam)
,str s = LB_GetList(lParam)
,int t=GetWinId(lParam)
,sel t
,,case 3
,,,SendMessage(id(4 hDlg) LB_RESETCONTENT 0 0)
,,,SendMessage(id(5 hDlg) LB_RESETCONTENT 0 0)
,,,SendMessage(id(6 hDlg) LB_RESETCONTENT 0 0)
,,case 4
,,,SendMessage(id(6 hDlg) LB_RESETCONTENT 0 0)
,LB_AutoComplete(id(t+1 hDlg) _i s)
,case IDOK
,case IDCANCEL
ret 1
Function LB_GetList
function~ hDlg
int i
ARRAY(str) s
int count=LB_GetCount(hDlg)
for i 0 count
,LB_GetItemText(hDlg i _s)
,s[]= _s
ret s
Function LB_AutoComplete