The texts below are offered, so that the time building the application can be reduced by cutting text from the sections below and pasting the text into the various dialog-windows when "action logic" for the various events is entered.
d:'$d(^macbeth("Person")) ^demoinit
s demosrch=0
n i,x
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. s x(i)=$p(^macbeth("Person",i),"|",1)
k ^$w(%CurrWin,"G","DropDown1","CHOICE")
k ^$w(%CurrWin,"G","DropDown1","VALUE")
m ^$w(%CurrWin,"G","DropDown1","CHOICE")=x
n i,n,t,x
s n=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
q:$g(demolast)=n
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. s t=$p(^macbeth("Person",i),"|",1)
. s:t[n x(i)=t
. q
k ^$w(%CurrWin,"G","DropDown1","CHOICE")
k ^$w(%CurrWin,"G","DropDown1","VALUE")
m ^$w(%CurrWin,"G","DropDown1","CHOICE")=x
s demolast=n
n i,x
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. s x(i)=$p(^macbeth("Person",i),"|",1)
k ^$w(%%CurrWin,"G","DropDown1","CHOICE")
k ^$w(%%CurrWin,"G","DropDown1","VALUE")
m ^$w(%%CurrWin,"G","DropDown1","CHOICE")=x
n i,n,t,x
s n=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
q:$g(demolast)=n
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. s t=$p(^macbeth("Person",i),"|",1)
. s:t[n x(i)=t
. q
k ^$w(%%CurrWin,"G","DropDown1","CHOICE")
k ^$w(%%CurrWin,"G","DropDown1","VALUE")
m ^$w(%%CurrWin,"G","DropDown1","CHOICE")=x
s demolast=n
d I^%msgbox("Creating Text Box")
d I^%msgbox("This goes in the box","This on top")
n i,n,t,x
s n=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
q:$g(demolast)=n
s ^$w(%%CurrWin,"PTYPE")="M,WAIT"
Hang 10
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. s t=$p(^macbeth("Person",i),"|",1)
. s:t[n x(i)=t
. q
k ^$w(%%CurrWin,"G","DropDown1","CHOICE")
k ^$w(%%CurrWin,"G","DropDown1","VALUE")
m ^$w(%%CurrWin,"G","DropDown1","CHOICE")=x
s demolast=n
s ^$w(%%CurrWin,"PTYPE")="Z,POINTER"
s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") %%DoWin(SecondWindow)
s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s demosrch(demosrch)=demonum %%OpenWin(SecondWindow[demosrch])
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x s demosrch(demosrch)=demonum %%OpenWin(SecondWindow[demosrch],,x)
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s ^$w(%%CurrWin,"G","Button1","ACTIVE")=1 s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x s demosrch(demosrch)=demonum %%OpenWin(SecondWindow[demosrch],,x)
n i,n,t,x
s n=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
q:$g(demolast)=n
s ^$w(%%CurrWin,"PTYPE")="M,WAIT"
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. s t=$p(^macbeth("Person",i),"|",1)
. s:t[n x(i)=t
. q
k ^$w(%%CurrWin,"G","DropDown1","CHOICE")
k ^$w(%%CurrWin,"G","DropDown1","VALUE")
m ^$w(%%CurrWin,"G","DropDown1","CHOICE")=x
s ^$w(%%CurrWin,"G","Button1","ACTIVE")=0
s demolast=n
s ^$w(%%CurrWin,"PTYPE")="Z,POINTER"
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x s demosrch(demosrch)=demonum %%OpenWin(ThirdWindow[demosrch],,x)
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x %%OpenWin(FourthWindow[demosrch],,x)
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x %%OpenWin(FifthWindow[demosrch],,x)
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x %%OpenWin(SithWindow[demosrch],,x)
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x %%OpenWin(SeventhWindow[demosrch],,x)
n x s demonum=^$w(%%CurrWin,"G","DropDown1","VALUE") s demosrch=demosrch+1 s x=demosrch#10+2_0,x="POS="_x_","_x %%OpenWin(EighthWindow[demosrch],,x)
n x
s demonum=^$o(^macbeth("Person",""),-1)+1
s ^macbeth("Person",demonum)="New Person"
s x=demosrch#10+2_0,x="POS="_x_","_x
%%OpenWin(FifthWindow[demosrch],,x)
n x
s x=$p(^macbeth("Person",demonum),"|",1)
s ^$w(%%CurrWin,"G","Label1","TITLE")=x
n x
s x=$p(^macbeth("Person",demonum),"|",2)
s ^$w(%%CurrWin,"G","Label2","TITLE")=x
n x
s x=$g(^macbeth("ICO",demonum))
s x=$s(x="":"No picture available",1:x)
s ^$w(%%CurrWin,"G","Label3","TITLE")=x
n x
s x=$g(^macbeth("ICO",demonum))
i x="" s ^$w(%%CurrWin,"G","Picture1","VISIBLE")=0 q
%%Set(Picture1.Picture,"F,"_x)
labelsiz(gadget,font,size) n lp,w,ws
; lp = label position
; w = window information
; ws = window size
s ws=^$w(%%CurrWin,"SIZE")
s lp=^$w(%%CurrWin,"G",gadget,"POS")
s w("SIZE")=$p(ws,",",1)-(2*$p(lp,",",1))
s w("SIZE")=w("SIZE")_","_size_","_$p(ws,",",3)
s w("TFFACE")=font
s w("TFSIZE")=size
m ^$w(%%CurrWin,"G",gadget)=w
q
n x
d labelsiz("Label1","Arial",18)
s x=$p(^macbeth("Person",demonum),"|",1)
s ^$w(%%CurrWin,"G","Label1","TITLE")=x
n x
d labelsiz("Label2","Arial",14)
s x=$p(^macbeth("Person",demonum),"|",2)
s ^$w(%%CurrWin,"G","Label2","TITLE")=x
n x
d labelsiz("Label3","Courier",9)
s x=$g(^macbeth("ICO",demonum))
s x=$s(x="":"No picture available",1:x)
s ^$w(%%CurrWin,"G","Label3","TITLE")=x
d labelsiz("Label1","Arial",18)
d labelsiz("Label2","Arial",14)
d labelsiz("Label3","Courier",9)
d labelsiz("Label1","Arial",18)
d labelsiz("Label2","Arial",14)
d labelsiz("Label3","Courier",9)
d labelsiz("Label1","Arial",18)
d labelsiz("Label2","Arial",14)
d labelsiz("Label3","Courier",9)
n t,x
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
n t,x
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
n w
s w("SIZE")=^$w(%%CurrWin,"SIZE")
s w("POS")="0,0,ZDLG"
s w("TITLE")=""
s w("VALUE")=$$getall^demodisp(demonum)
m ^$w(%%CurrWin,"G","Document1")=w
n x s x=^$w(%%CurrWin,"SIZE") s ^$w(%%CurrWin,"G","Document1","SIZE")=x
n x s x=^$w(%%CurrWin,"SIZE") s ^$w(%%CurrWin,"G","Document1","SIZE")=x
n x s x=^$w(%%CurrWin,"SIZE") s ^$w(%%CurrWin,"G","Document1","SIZE")=x
n t,x
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
n x
s x=$p($g(^macbeth("EMail",demonum)),"|",1)
s ^$w(%%CurrWin,"G","TextBox1","VALUE")=x
n x
s x=$p($g(^macbeth("EMail",demonum)),"|",2)
s ^$w(%%CurrWin,"G","TextBox2","VALUE")=xt
n x
s x=$p($g(^macbeth("EMail",demonum)),"|",3)
s ^$w(%%CurrWin,"G","TextBox3","VALUE")=x
n e1,e2,e3,x
s e1=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
s e2=$g(^$w(%%CurrWin,"G","TextBox2","VALUE"))
s e3=$g(^$w(%%CurrWin,"G","TextBox3","VALUE"))
s ^macbeth("EMail",demonum)=e1_"|"_e2_"|"_e3
q
s ^$w(%%CurrWin,"G","Label1","TITLE")=demonum
n e1,e2,e3,x
s demonum=^$w(%%CurrWin,"G","Label1","TITLE")
s e1=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
s e2=$g(^$w(%%CurrWin,"G","TextBox2","VALUE"))
s e3=$g(^$w(%%CurrWin,"G","TextBox3","VALUE"))
s ^macbeth("EMail",demonum)=e1_"|"_e2_"|"_e3
q
n t,x
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
s ^$w(%%CurrWin,"YUNIQ")=demonum
n x
s x=^macbeth("Person",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",1)
n x
s x=^macbeth("Person",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",2)
n x
s x=^macbeth("Person",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",3)
n e1,e2,e3,x
s demonum=^$w(%%CurrWin,"YUNIQ")
s e1=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
s e2=$g(^$w(%%CurrWin,"G","TextBox2","VALUE"))
s e3=$g(^$w(%%CurrWin,"G","CheckBox1","VALUE"))
s ^macbeth("Person",demonum)=e1_"|"_e2_"|"_e3
q
n t,x
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
s ^$w(%%CurrWin,"YUNIQ")=demonum
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",1)
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",2)
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",3)
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",4)
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",5)
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",6)
n x
s x=^macbeth("Address",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",7)
n e1,e2,e3,e4,e5,e6,e7,x
s demonum=^$w(%%CurrWin,"YUNIQ")
s e1=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
s e2=$g(^$w(%%CurrWin,"G","TextBox2","VALUE"))
s e3=$g(^$w(%%CurrWin,"G","TextBox3","VALUE"))
s e4=$g(^$w(%%CurrWin,"G","TextBox4","VALUE"))
s e5=$g(^$w(%%CurrWin,"G","TextBox5","VALUE"))
s e6=$g(^$w(%%CurrWin,"G","TextBox6","VALUE"))
s e7=$g(^$w(%%CurrWin,"G","TextBox7","VALUE"))
s ^macbeth("Address",demonum)=e1_"|"_e2_"|"_e3_"|"_e4_"|"_e5_"|"_e6_"|"_e7
q
n t,x
s demonum=1
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
s ^$w(%%CurrWin,"YUNIQ")=demonum
n x
s x=$g(^macbeth("Phone",demonum))
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",1)
n x
s x=$g(^macbeth("Phone",demonum))
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",2)
n x
s x=$g(^macbeth("Phone",demonum))
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",3)
n x
s x=$g(^macbeth("Phone",demonum))
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",4)
n x
s x=$g(^macbeth("Phone",demonum))
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",5)
n x
s x=$g(^macbeth("Phone",demonum))
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=$p(x,"|",6)
n i,x
s i="" f s i=$o(^macbeth("Person",i)) q:i="" d
. q:i=demonum
. s x(i)=$p(^macbeth("Person",i),"|",1)
. q
k ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")
k ^$w(%%CurrWin,"G",%%CurrCtl,"CHOICE")
m ^$w(%%CurrWin,"G",%%CurrCtl,"CHOICE")=x
s x=$p($g(^macbeth("Phone",demonum)),"|",8)
s:x'="" ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=x
q
n e1,e2,e3,e4,e5,e6,e7,e8,x
s demonum=^$w(%%CurrWin,"YUNIQ")
s e1=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
s e2=$g(^$w(%%CurrWin,"G","TextBox2","VALUE"))
s e3=$g(^$w(%%CurrWin,"G","TextBox3","VALUE"))
s e4=$g(^$w(%%CurrWin,"G","TextBox4","VALUE"))
s e5=$g(^$w(%%CurrWin,"G","TextBox5","VALUE"))
s e6=$g(^$w(%%CurrWin,"G","TextBox6","VALUE"))
s e8=$g(^$w(%%CurrWin,"G","DropDown1","VALUE"))
s e7="" s:e8 e7=$p($g(^macbeth("Phone",e8)),"|",2)
s ^macbeth("Phone",demonum)=e1_"|"_e2_"|"_e3_"|"_e4_"|"_e5_"|"_e6_"|"_e7_"|"_e8
q
n t,x
s x=^macbeth("Person",demonum)
s t=$p(x,"|",1),x=$p(x,"|",2)
s:x'="" t=t_", "_x
s ^$w(%%CurrWin,"TITLE")=t
s ^$w(%%CurrWin,"YUNIQ")=demonum
n x
s x=^macbeth("ICO",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=x
n x
s x=^macbeth("GIF",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=x
n x
s x=^macbeth("BMP",demonum)
s ^$w(%%CurrWin,"G",%%CurrCtl,"VALUE")=x
n e1,e2,e3,x
s demonum=^$w(%%CurrWin,"YUNIQ")
s e1=$g(^$w(%%CurrWin,"G","TextBox1","VALUE"))
s e2=$g(^$w(%%CurrWin,"G","TextBox2","VALUE"))
s e3=$g(^$w(%%CurrWin,"G","CheckBox1","VALUE"))
f x="ICO","GIF","BMP" k ^macbeth(x,demonum)
s:e1'="" ^macbeth("ICO",demonum)=e1
s:e2'="" ^macbeth("GIF",demonum)=e2
s:e3'="" ^macbeth("BMP",demonum)=e3
q
%%DoWin(FirstWindow)
n in,out,x
s in("DBNAME")="c:\...your...directory...\macbeth.m"
s in("LOCAL_ACCESS")="M"
d LMOUNT^%msv(.in,.out)
s x=out("VGNAME")
k in,out
s x=$tr($zu(0),",","^")_"^"_x_"^"_x_"^"_x"_^"_x
s x=x_"^5^^STRING^macbeth^8"
s in("TRANSLATE")=x
d ENTRAN^%msv(.in)
%%DoWin(FirstWindow)