06-15-2015, 05:09 PM
Just try this:
Function testss
Function testss
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 48 64 48 14 "<<"
;4 Button 0x54032000 0x0 100 64 48 14 ">>"
;5 Edit 0x54030080 0x200 48 48 46 12 ""
;6 Edit 0x54030080 0x200 100 48 48 12 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040108 "" "" "" ""
str controls = "5 6"
str e5 e6
if(!ShowDialog("testss" &testss &controls)) ret
ret
int A B
str sP1 sP2 sP12 sP22 s0
str sInc sDec sInc2 sDec2
int+ iP1 iP2 iP12 iP22
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,sP1.getwintext(id(5 hDlg))
,sP2.getwintext(id(6 hDlg))
,iP2=val(sP2)
,A = iP2-val(sP1)
,iP1=val(sP1)-A
,out iP1
,if iP1=iP2
,,sP1 = iP1-1
,,sP1.setwintext(id(5 hDlg))
,,sP2 = iP2-1
,,sP2.setwintext(id(6 hDlg))
,else if iP1<=0
,,s0=1
,,s0.setwintext(id(5 hDlg))
,,sP1.setwintext(id(6 hDlg))
,,ret
,else
,,out iP1
,,sDec=iP1
,,sDec.setwintext(id(5 hDlg))
,;-----------------------------------------------
,,iP2=val(sP1)
,,sDec2=iP2
,,sDec2.setwintext(id(6 hDlg))
,case 4
,sP12.getwintext(id(5 hDlg))
,sP22.getwintext(id(6 hDlg))
,iP22=val(sP22)
,B = iP22-val(sP12)
,iP12=iP22+B
,if iP12=iP22
,,sInc=iP12+1
,,sInc.setwintext(id(6 hDlg))
,,sInc2=iP22+1
,,sInc2.setwintext(id(5 hDlg))
,else
,,sInc=iP12
,,sInc.setwintext(id(6 hDlg))
,;-----------------------------------------------
,,sInc2=iP22
,,sInc2.setwintext(id(5 hDlg))
,case IDOK
,case IDCANCEL
ret 1