05-20-2010, 02:48 PM
I figured out how to do what i was looking for
Im not sure if it is the right way !? maybe u can clean it up a bit
Function Dialog2
Function to refresh the box
Function Refresh
As i already said im not sure if that is the right way and im still learning so maybe this code gives u a smile
but it works..
best regards
Im not sure if it is the right way !? maybe u can clean it up a bit
Function Dialog2
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90CA0AC8 0x0 0 0 183 82 "Dialog"
;3 ComboBox 0x54230243 0x0 10 26 94 213 ""
;6 Button 0x54032000 0x0 110 26 48 14 "Refresh"
;7 Button 0x54032007 0x0 4 4 170 62 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030202 "*" "" ""
str controls = "3"
str cb3
cb3= "&Select List"
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,ARRAY(str) a; int i
,GetFilesInFolder a "$desktop$\" "*.txt"
,for i 0 a.len
,,_s=a[i]
,,_s.getfilename
,,CB_Add id(3 hDlg) _s
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_CLOSEUP<<16|3
,str s s2
,int hcb=id(3 hDlg)
,_i =(CB_SelectedItem(id(3 hDlg) s)>= 0)
,s.from("$desktop$\" s ".txt")
,s2.getfile(s)
,err ret
,SendMessage hcb CB_RESETCONTENT 0 0
,foreach s s2
,,CB_Add hcb s
,CB_SelectItem hcb 0
,case 6
,mac "Refresh"
,case IDOK
,case IDCANCEL
ret 1Function to refresh the box
Function Refresh
int hDlg=win("Dialog" "#32770")
int hcb=id(3 hDlg)
SendMessage hcb CB_RESETCONTENT 0 0
ARRAY(str) a; int i
GetFilesInFolder a "$desktop$\" "*.txt"
for i 0 a.len
,_s=a[i]
,_s.getfilename
,CB_Add hcb "Select List"
,CB_Add hcb _s
,CB_SelectItem hcb 0As i already said im not sure if that is the right way and im still learning so maybe this code gives u a smile
but it works..best regards
