Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog Search
#1
Hey !

I'm doing this list of things that I want to do a search bar in a Dialog but hell, I can't make it work !!!!
I tried doing this with IStringMaps, with plane old strings, nothing man, I can't make it work but it seems so simple!
Can you please help me figure out what to do next?

So this is my code:

Function Dialog2
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages


str controls = "3 4"
str e3 e4 s1 s2 an ae search
str blnokia blericsson

if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 323 194 "Blacklist de Alarmes"
;3 Edit 0x54030080 0x200 14 40 300 14 ""
;4 Edit 0x54200844 0x20000 14 78 300 100 ""
;5 Static 0x54000000 0x0 114 24 100 13 "Escreve aqui o Alarme"
;6 Static 0x54000000 0x0 124 60 100 13 "Alarmes black list"
;7 Button 0x54032000 0x0 60 4 48 14 "Nokia"
;8 Button 0x54032000 0x0 8 4 48 14 "Ericsson"
;9 Button 0x54032000 0x0 34 22 48 14 "Search"
;END DIALOG
;DIALOG EDITOR: "" 0x2030506 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7
,blnokia=
,;bule one
,;blue two
,;blue three
,;black one
,;black two
,;red one
,TO_Enable(hDlg "7" 0)
,TO_Enable(hDlg "8" 1)
,blnokia.setwintext(id(4 hDlg))
,case 8
,blericsson=
,;white one
,;white two
,;white three
,;pink one
,;pink two
,;grey sixteen
,TO_Enable(hDlg "8" 0)
,TO_Enable(hDlg "7" 1)
,blericsson.setwintext(id(4 hDlg))
,case 9

,case IDOK
,case IDCANCEL
ret 1

What I want to do is for example, load the NOKIA list and type for example: "blue" and hit search.
After the read only box would give me only the three lines that contain the "blue" word.

How can I do that? I'm really going crazy over this

Thanks!!!!
#2
Code:
Copy      Help
;...
;messages2
str- blany
sel wParam
,case 7
,blany=
,;bule one
,;blue two
,;blue three
,;black one
,;black two
,;red one
,TO_Enable(hDlg "7" 0)
,TO_Enable(hDlg "8" 1)
,blany.setwintext(id(4 hDlg))
,case 8
,blany=
,;white one
,;white two
,;white three
,;pink one
,;pink two
,;grey sixteen
,TO_Enable(hDlg "8" 0)
,TO_Enable(hDlg "7" 1)
,blany.setwintext(id(4 hDlg))
,case 9
,goto gSearch

,case IDOK
,case IDCANCEL
ret 1
;gSearch
str s sSearch sFound
sSearch.getwintext(id(3 hDlg))
if sSearch.len
,foreach s blany
,,if(find(s sSearch)>=0) sFound.addline(s)
sFound.setwintext(id(4 hDlg))
ret
#3
Perfect!
As always, thank you Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)