Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gets value of the dynamic dialog control
#1
Hi,

The dialog's control in the code below is dynamically generated, I want to display the values of each control after closing the dialog, is this possible?

In the usual way, an error occurred at compile time

Thanks in advance for any advice and help
david

Macro Macro4
Code:
Copy      Help
str template=
;My name is $inp_Name$, My country is $inp_Country$, My age is $inp_Age$, thank you!

out
ARRAY(str) a
if(!findrx(template "\$(?:inp)_(.+?)\$" 0 4 a)) ret template

ARRAY(str) c.create(a.len+1)
c[0]="4"
str dd
dd.formata("BEGIN DIALOG[]0 '''' 0x90C80AC8 0x0 0 0 490 %i ''Manual Text Input''[]" a.len*30+40)
int i idEdit(4) idStatic(104) y(8)
for i 0 a.len
,dd.formata("%i Static 0x44000000 0x0 8 %i 214 10 ''%s''[]%i " idStatic y a[1 i].escape(1) idEdit)
,sel a[0 i][1]
,,case 'i' ;;$inp_
,,dd.formata("Edit 0x54030080 0x200 8 %i 208 13[]" y+12)
,,c[i+1]=a[0 i]
,if(i)
,,c[0].formata(" %i" idEdit)
,y+30
,idEdit+1
,idStatic+1
y+10
dd.formata("1 Button 0x54030001 0x4 116 %i 48 14 ''OK''[]2 Button 0x54030000 0x4 168 %i 48 14 ''Cancel''[]3 Edit 0x54231044 0x200 236 8 246 114 ''''[]END DIALOG" y y)

if(!ShowDialog(dd &sub.DlgProc &c[0])) end

mes e3
mes e4
mes e5
mes e6

#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,_s=template
,_s.setwintext(id(3 hDlg))
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread
Gets value of the dynamic dialog control - by Davider - 08-31-2022, 05:42 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)