04-08-2005, 01:52 PM
You need a smart dialog, that is, with a dialog procedure.
Macro:
Function Dialog4545:
Note: when pasting, use Edit -> Other formats -> paste escaped, or this dialog will not work.
Macro:
str a=
;Peter
;John
;Anne
;Albert
str b=
;101
;220
;335
;465
ARRAY(str)- numbers
numbers=b
str controls = "3 4"
str cb3 e4
cb3=a
if(!ShowDialog("Dialog4545" &Dialog4545 &controls)) retFunction Dialog4545:
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;This function allows to execute code whenever some event
;(dialog created, button clicked, etc) occurs in dialog.
;The code must follow appropriate case statements.
;To add case statements for various messages (events), you
;can use the Events button in the Dialog Editor. Read more in Help.
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 135 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ComboBox 0x54230343 0x4 12 48 96 213 ""
;4 Edit 0x54030880 0x204 120 48 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010601 "" ""
ret
;messages
sel message
,case WM_INITDIALOG DT_Init(hDlg lParam); ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
ARRAY(str)- numbers
sel wParam
,case CBN_SELENDOK<<16|3
,_i=CB_SelectedItem(lParam)
,numbers[_i].setwintext(id(4 hDlg))
,
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1Note: when pasting, use Edit -> Other formats -> paste escaped, or this dialog will not work.
