NB. built from project: source\classes\pwd\pwd

NB. provides jpwd form
NB.
NB. methods:
NB. create
NB.
NB. calls pwd_result on completion

coclass 'jpwd'

NB.*create v create pwd form
NB. form: create prompt [;title [;newpass prompt]]
NB.
NB. e.g. create 'Enter password';'Sys Config'
NB. e.g. create 'Enter password';'Sys Config';'Enter New Password';'Confirm New password'
NB.
NB. on OK calls pwd_result in creator locale

create=: a_run

destroy=: codestroy

A=: 0 : 0
pc a dialog owner;
xywh 4 11 128 10;cc prompt static;
xywh 3 22 125 11;cc edit edit ws_border es_autohscroll;
xywh 135 9 34 11;cc ok button;cn "OK";
xywh 135 23 34 11;cc cancel button;cn "Cancel";
pas 4 5;pcenter;
rem form end;
)

A2=: 0 : 0
pc a2 dialog owner;
xywh 4 13 128 9;cc s1 static;cn "prompt";
xywh 3 22 120 11;cc edit edit ws_border es_autohscroll;
xywh 4 40 128 9;cc s2 static;cn "New Password:";
xywh 3 49 120 11;cc newpass1 edit ws_border es_autohscroll;
xywh 4 67 128 9;cc s3 static;cn "Confirm New Password:";
xywh 3 76 120 11;cc newpass2 edit ws_border es_autohscroll;
xywh 135 9 34 11;cc ok button;cn "OK";
xywh 135 23 34 11;cc cancel button;cn "Cancel";
pas 4 5;pcenter;
rem form end;
)

NB. ========================================================
a_run=: 3 : 0
'p d t'=. 3{. boxopen y.
wd A
wd 'pn *',t,(0=#t)#'Input'
wd 'set prompt *',p
wd 'set edit *',d
wd 'setfocus edit'
wd 'pshow;'
)

NB. ========================================================
a_close=: 3 : 0
wd'pclose'
destroy''
)

NB. ========================================================
a_cancel_button=: a_close
a_edit_button=: a_ok_button

NB. ========================================================
NB. OK close, enables and selects our owner
a_ok_button=: 3 : 0
wd 'pclose'
try. pwd_result__COCREATOR edit catch. end.
destroy''
)
