Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute the selected item in turn
#4
Function Function_LB_multiSelect_Dialog
Code:
Copy      Help
ARRAY(str)- lb_selected
str L=
;;sub.m1
;;sub.m2
;;sub.m3
;;sub.m4
;;sub.m5

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;5 ListBox 0x54230109 0x200 64 16 96 86 ""
;3 Button 0x54032000 0x0 9 116 56 14 "Run Selected"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040802 "*" "" "" ""

str controls = "5"
str lb5
lb5=L
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
out
lb5=lb_selected
out lb5

#sub DlgProc v
function# hDlg message wParam lParam
int hlb
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
hlb=id(5 hDlg)
sel wParam
,case IDOK
,LB_GetSelectedItems(hlb 0 lb_selected)
,case IDCANCEL
,case 3 ;;Run Selected
,LB_GetSelectedItems(hlb 0 lb_selected)
,_s=lb_selected
,str ss
,foreach ss _s
,,ss.trim
,,opt waitmsg 1
,,sel ss
,,,case "sub.m1"
,,,sub.m1
,,,case "sub.m2"    
,,,sub.m2
,,,case "sub.m3"
,,,sub.m3
,,,case "sub.m4"
,,,sub.m4
,,,case "sub.m5"
,,,sub.m5
ret 1

#sub m1

MES m.timeout=5; m.style="OCa"; m.default='C'
mes("this is m1" "" m)


#sub m2

MES m.timeout=5; m.style="OCa"; m.default='C'
mes("this is m2" "" m)


#sub m3

MES m.timeout=5; m.style="OCa"; m.default='C'
mes("this is m3" "" m)


#sub m4

MES m.timeout=5; m.style="OCa"; m.default='C'
mes("this is m4" "" m)


#sub m5

MES m.timeout=5; m.style="OCa"; m.default='C'
mes("this is m5" "" m)

need this function as well

Function LB_GetSelectedItems
Code:
Copy      Help
;/
function# hwnd [ARRAY(int)&ai] [ARRAY(str)&as]

;Gets selected items in a multisel listbox control.
;Returns number of selected items.

;hwnd - control handle.
;ai - array variable that receives indices of selected items. Optional, can be 0.
;as - array variable that receives text of selected items. Optional, can be 0.

;REMARKS
;The control must belong to current process. Use eg in dialog procedures.


if(&ai) ai=0
if(&as) as=0

int i n
n=SendMessage(hwnd LB_GETSELCOUNT 0 0); if(n<1) ret
if &ai or &as
,ARRAY(int) _ai; if(!&ai) &ai=_ai
,ai.create(n)
,n=SendMessage(hwnd LB_GETSELITEMS n &ai[0]); if(n<0) n=0
,if(n!ai.len) ai.redim(n)
,if &as
,,as.create(n)
,,for(i 0 n) LB_GetItemText(hwnd ai[i] as[i])
ret n


Messages In This Thread
Execute the selected item in turn - by win - 04-15-2019, 10:46 PM
RE: Execute the selected item in turn - by win - 04-17-2019, 01:19 AM
RE: Execute the selected item in turn - by win - 04-17-2019, 12:13 PM
RE: Execute the selected item in turn - by Kevin - 04-18-2019, 11:53 PM
RE: Execute the selected item in turn - by win - 04-19-2019, 12:08 AM
RE: Execute the selected item in turn - by Kevin - 04-19-2019, 12:36 AM
RE: Execute the selected item in turn - by win - 04-19-2019, 01:15 AM
RE: Execute the selected item in turn - by Kevin - 04-19-2019, 02:24 AM
RE: Execute the selected item in turn - by win - 04-19-2019, 02:39 AM
RE: Execute the selected item in turn - by Kevin - 04-19-2019, 02:40 AM
RE: Execute the selected item in turn - by win - 04-19-2019, 02:43 AM
RE: Execute the selected item in turn - by win - 04-19-2019, 11:04 PM
RE: Execute the selected item in turn - by Kevin - 04-20-2019, 12:32 AM
RE: Execute the selected item in turn - by win - 04-20-2019, 01:00 AM
RE: Execute the selected item in turn - by Kevin - 04-20-2019, 02:02 AM
RE: Execute the selected item in turn - by win - 04-20-2019, 02:44 AM
RE: Execute the selected item in turn - by win - 04-23-2019, 01:47 AM
RE: Execute the selected item in turn - by win - 04-27-2019, 04:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)