MSM-ViEW Product = Builder ProductVersion = 2.0.0 Format = Export FormatVersion = 1.1 Workshop = __A,__A Workbench = 3500372;704443612 Date = 30 MAR 99 Time = 8:35 PM Begin Window ClientDoc GUI.MSM Active = 1 CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MinButton = 1 PosLeft = 0 PosRecall = 0 PosTop = 0 PosUnits = ZDLG Resizable = 0 SizeHeight = 147.5 SizeRecall = 0 SizeUnits = ZDLG SizeWidth = 143 Title = "Client " Type = ZMDICHILD Units = ZDLG Visible = 1 WinHeight = 163 WinUnits = ZDLG WinWidth = 149 Begin Control btnExecute BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 96 PosTop = 128 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Execute Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Set(docData.LINKACTION,"EXECUTE") -------- End End End Begin Control btnPoke BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 52 PosTop = 128 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Poke Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Set(docData.LINKACTION,"POKE") -------- End End End Begin Control btnRequest BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 8 PosTop = 128 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Request Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Set(docData.LINKACTION,"REQUEST") -------- End End End Begin Control docData DOCUMENT Active = 1 Border = 1 DisplayOnly = 0 PosLeft = 8 PosTop = 76 PosUnits = ZDLG ScrollHeight = 0 ScrollHorz = 0 ScrollUnits = ZDLG ScrollVert = 1 ScrollWidth = SizeHeight = 48 SizeUnits = ZDLG SizeWidth = 128 Title = Data as Document: Type = DOCUMENT VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 15 N g,ev,mode ; Begin in AUTOMATIC mode S mode="AUTOMATIC" %%SetSel(rbsLinkMode,mode,A) ; Set the DDE attributes for the control ; Source and Item S g("LINKSOURCE")=%%IOVar("Source"),g("LINKITEM")=%%IOVar("Item") S g("LINKMODE")=mode ; Perform an initial fetch S g("LINKACTION")="REQUEST" ; Establish a timeout S g("LINKTIMEOUT")=30 ; Set callbacks to monitor events F ev="LINKACTION","LINKNOTIFY","LINKUPDATE","LINKCLOSE" S g("EVENT",ev)="LinkEvt^"_$T(+0) %%MergeCtl(docData,g) -------- End End End Begin Control rbsLinkMode RADIO Active = 1 Border = 1 DisplayOnly = 0 FillDirection = V PosLeft = 8 PosTop = 44 PosUnits = ZDLG RowCol = COL RowColSize = 2 SizeHeight = 20 SizeUnits = ZDLG SizeWidth = 128 Title = Link Mode Type = RADIO Value = 1 VarName = VarPermanent = 0 Begin Choice 1 AppId = AUTOMATIC Title = &Automatic End Begin Choice 2 AppId = MANUAL Title = &Manual End Begin Choice 3 AppId = NOTIFY Title = &Notify End Begin Choice 4 AppId = NONE Title = N&one End Begin Event EvSELECT -------- Begin Document ActionLogic 4 N mode %%GetSel(rbsLinkMode,mode,A) S mode=$O(mode("")) %%Set(docData.LINKMODE,mode) -------- End End End Begin Control txtItem TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 1 MaxLength = PosLeft = 24 PosTop = 19.5 PosUnits = ZDLG SizeHeight = 10 SizeWidth = 112 Title = Item: TitlePos = LEFT Type = TEXT ValidateParams = ValidateType = VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 1 %%Set(,%%IOVar("Item")) -------- End End End Begin Control txtSource TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 1 MaxLength = PosLeft = 24 PosTop = 4 PosUnits = ZDLG SizeHeight = 10 SizeWidth = 112 Title = Source: TitlePos = LEFT Type = TEXT ValidateParams = ValidateType = VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 1 %%Set(,%%IOVar("Source")) -------- End End End Begin Event Ev10 ----- Begin Document ActionLogic 1 %%Set(..Title,"Client #"_%%IOVar("ChildNo")) ----- End End Begin Event Ev90 ----- Begin Document ActionLogic 8 LinkEvt ; ; Callback for DDE events D LOG^EVENTSg ; If server signals connection-close, shut down this client window ; Uses MWAPI code because this is not a normal WS-managed Action Logic section Q:%%EvType'="LINKCLOSE" ETRIGGER ^$W(%%EvWindow,"EVENT","CLOSE") Q ----- End End End Begin Window ClientTxt GUI.MSM Active = 1 CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MinButton = 1 PosLeft = 0 PosRecall = 0 PosTop = 0 PosUnits = ZDLG Resizable = 0 SizeHeight = 111 SizeRecall = 0 SizeUnits = ZDLG SizeWidth = 143 Title = "Client " Type = ZMDICHILD Units = ZDLG Visible = 1 WinHeight = 126.5 WinUnits = ZDLG WinWidth = 149 Begin Control btnExecute BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 96 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Execute Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Set(txtData.LINKACTION,"EXECUTE") -------- End End End Begin Control btnPoke BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 52 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Poke Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Set(txtData.LINKACTION,"POKE") -------- End End End Begin Control btnRequest BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 8 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Request Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Set(txtData.LINKACTION,"REQUEST") -------- End End End Begin Control rbsLinkMode RADIO Active = 1 Border = 1 DisplayOnly = 0 FillDirection = V PosLeft = 8 PosTop = 44 PosUnits = ZDLG RowCol = COL RowColSize = 2 SizeHeight = 20 SizeUnits = ZDLG SizeWidth = 128 Title = Link Mode Type = RADIO Value = 1 VarName = VarPermanent = 0 Begin Choice 1 AppId = AUTOMATIC Title = &Automatic End Begin Choice 2 AppId = MANUAL Title = &Manual End Begin Choice 3 AppId = NOTIFY Title = &Notify End Begin Choice 4 AppId = NONE Title = N&one End Begin Event EvSELECT -------- Begin Document ActionLogic 4 N mode %%GetSel(rbsLinkMode,mode,A) S mode=$O(mode("")) %%Set(txtData.LINKMODE,mode) -------- End End End Begin Control txtData TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 0 MaxLength = PosLeft = 8 PosTop = 76 PosUnits = ZDLG SizeHeight = 10 SizeWidth = 128 Title = Data as Text: Type = TEXT ValidateParams = ValidateType = VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 14 N g,ev,mode %%GetSel(rbsLinkMode,mode,A) S mode=$O(mode("")) ; Set the DDE attributes for the control ; Source and Item S g("LINKSOURCE")=%%IOVar("Source"),g("LINKITEM")=%%IOVar("Item") S g("LINKMODE")=mode ; Perform an initial fetch S g("LINKACTION")="REQUEST" ; Establish a timeout S g("LINKTIMEOUT")=30 ; Set callbacks to monitor events F ev="LINKACTION","LINKNOTIFY","LINKUPDATE","LINKCLOSE" S g("EVENT",ev)="LinkEvt^"_$T(+0) %%MergeCtl(txtData,g) -------- End End End Begin Control txtItem TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 1 MaxLength = PosLeft = 24 PosTop = 19.5 PosUnits = ZDLG SizeHeight = 10 SizeWidth = 112 Title = Item: TitlePos = LEFT Type = TEXT ValidateParams = ValidateType = VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 1 %%Set(,%%IOVar("Item")) -------- End End End Begin Control txtSource TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 1 MaxLength = PosLeft = 24 PosTop = 4 PosUnits = ZDLG SizeHeight = 10 SizeWidth = 112 Title = Source: TitlePos = LEFT Type = TEXT ValidateParams = ValidateType = VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 1 %%Set(,%%IOVar("Source")) -------- End End End Begin Event Ev10 ----- Begin Document ActionLogic 1 %%Set(..Title,"Client #"_%%IOVar("ChildNo")) ----- End End Begin Event Ev90 ----- Begin Document ActionLogic 8 LinkEvt ; ; Callback for DDE events D LOG^EVENTSg ; If server signals connection-close, shut down this client window ; Uses MWAPI code because this is not a normal WS-managed Action Logic section Q:%%EvType'="LINKCLOSE" ETRIGGER ^$W(%%EvWindow,"EVENT","CLOSE") Q ----- End End End Begin Window Connections GUI.MSM Active = 1 AlwaysOnTop = 0 CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MinButton = 0 PosJustifyH = C PosJustifyV = C PosLeft = 0 PosRecall = 0 PosTop = 0 PosUnits = ZDLG Resizable = 0 SizeHeight = 112.5 SizeRecall = 0 SizeUnits = ZDLG SizeWidth = 132.5 Title = Connections Type = APPLICATION Units = ZDLG Visible = 1 WinHeight = 128 WinUnits = ZDLG WinWidth = 138.5 Begin Control btnClose BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 72 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Close Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Return -------- End End End Begin Control btnDisconnect BUTTON Active = 0 CanContain = 0 Cancel = 0 Picture = PosLeft = 20 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeWidth = 40 Title = Disconnect Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 5 N id %%GetSel(lbConn,id) S id="" F S id=$O(id(id)) Q:id="" K ^$DI($PD,"LINKID",id) D LoadList -------- End End End Begin Control lbConn LIST Active = 1 ChoiceField = ChoiceVar = DisplayOnly = 0 MaxSelect = 0 PosLeft = 8 PosTop = 12 PosUnits = ZDLG SizeHeight = 67 SizeUnits = ZDLG SizeWidth = 116 Title = Connections and Roles Type = LIST VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 1 D LoadList -------- End End Begin Event Ev30v3 -------- Begin Document ActionLogic 1 %%Enable(btnDisconnect,%%Prop(Value)) -------- End End End Begin Event Ev90 ----- Begin Document ActionLogic 7 LoadList N id M id=^$DI($PD,"LINKID") S id="" F S id=$O(id(id)) Q:id="" S id(id)=id_$C(9)_id(id) %%ResetChoice(lbConn,id) %%Disable(btnDisconnect) Q ----- End End End Begin Window Events GUI.MSM Active = 1 AlwaysOnTop = 0 CompNameRtn = EVENTS CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MinButton = 1 PosLeft = 0 PosRecall = 1 PosTop = 0 PosUnits = ZDLG Resizable = 1 ScrollBars = 0 SizeHeight = 84.5 SizeRecall = 1 SizeUnits = ZDLG SizeWidth = 144 Title = Events Type = ZMDICHILD Units = ZDLG Visible = 1 WinHeight = 100 WinUnits = ZDLG WinWidth = 150 Begin Event Ev10 ----- Begin Document ActionLogic 17 N g,einfos,i,txt,wid S einfos=$$einfos S g("TYPE")="TABLE",g("POS")="0,0,CHAR",g("FRAMED")=0 %%Get(..FFACE,g("FFACE")) %%Get(..FSIZE,g("FSIZE")) %%Get(..FSTYLE,g("FSTYLE")) F i=1:1:$L(einfos,",") D . S txt=$P(einfos,",",i) . S g("CHOICE",0,i)=txt . S wid=$WTWIDTH(txt,g("FFACE"),g("FSIZE"),g("FSTYLE"),"PIXEL")+10 . S g("COL",i,"COLWIDTH")=wid_",PIXEL" S g("SIZE")="100,100,REL" S g("ROW",1)="" S g("YNEXT")=1 S g("HROWID")=0 S g("LEFTSHOW")=1 %%MergeCtl(Tbl,g) ----- End End Begin Event Ev90 ----- Begin Document ActionLogic 13 einfos() Q "SEQUENCE,TYPE,WINDOW,ELEMENT,LINKID,LINKSOURCE,LINKITEM,LINKSTATUS,LINKREASON,LINKCOMMAND" ; LOG ; Q:'%%Prop(Events.Tbl.Visible) N einfos,i,line,g S einfos=$$einfos F i=1:1:$L(einfos,",") S line(i)=$G(^$E($P(einfos,",",i))) %%Get(Events.Tbl.YNEXT,i) %%Set(Events.Tbl.YNEXT,i+1) M g("CHOICE",i)=line %%MergeCtl(Events.Tbl,g) %%Set(Events.Tbl.TOPSHOW,i) Q ----- End End Begin Event EvMAX ----- Begin Document ActionLogic 1 %%Set(Tbl.SIZE,%%Prop(..SIZE)) ----- End End Begin Event EvRESIZE ----- Begin Document ActionLogic 1 %%Set(Tbl.SIZE,%%Prop(..SIZE)) ----- End End Begin Event EvRESTORE ----- Begin Document ActionLogic 1 %%Set(Tbl.SIZE,%%Prop(..SIZE)) ----- End End End Begin Window Main GUI.MSM Active = 1 AlwaysOnTop = 0 CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MenuBar = % MinButton = 0 PosLeft = 0 PosRecall = 1 PosTop = 0 PosUnits = ZDLG Resizable = 1 SizeHeight = 193.5 SizeRecall = 1 SizeUnits = ZDLG SizeWidth = 306.5 Title = DDE Sample Type = ZMDI Units = ZDLG Visible = 1 WinHeight = 218.5 WinUnits = ZDLG WinWidth = 312.5 Begin Event Ev10 ----- Begin Document ActionLogic 3 ; Use the instance-unique part of $SY to set my Service name S ^$DI($PD,"LINKSERVICE")="MSM"_$P($SY,";",2) %%Set(..Title,%%Prop(..Title)_" - "_^$DI($PD,"LINKSERVICE")) ----- End End Begin Menu % Begin MChoice 1 Submenu = %A Title = &Action End Begin MChoice 2 Submenu = %B Title = &Window Begin Event EvSELECT ----------- Begin Document ActionLogic 1 %%MDIExtendMenu ----------- End End End End Begin Menu %A Visible = 1 Begin MChoice 1 Submenu = %AA Title = &New Window End Begin MChoice 2 Title = &Monitor Events Begin Event EvSELECT ----------- Begin Document ActionLogic 1 %%OpenWin(Events) ----------- End End End Begin MChoice 3 Title = &Manage Connections Begin Event EvSELECT ----------- Begin Document ActionLogic 1 %%DoWin(Connections,,%%CurrWin) ----------- End End End Begin MChoice 4 Title = E&xit Begin Event EvSELECT ----------- Begin Document ActionLogic 1 %%Return ----------- End End End End Begin Menu %AA Begin MChoice 1 Title = &Text Client Begin Event EvSELECT ----------- Begin Document ActionLogic 8 N params %%DoWin(Target,.params) Q:%%RetCode'=%%RetNormal S ChildNo("C")=$G(ChildNo("C"))+1 S params("ChildNo")=ChildNo("C") %%OpenWin(ClientTxt[ChildNo("C")],.params) %%MDICascade %%SetFocus(ClientTxt[ChildNo("C")].) ----------- End End End Begin MChoice 2 Title = &Document Client Begin Event EvSELECT ----------- Begin Document ActionLogic 8 N params %%DoWin(Target,.params) Q:%%RetCode'=%%RetNormal S ChildNo("C")=$G(ChildNo("C"))+1 S params("ChildNo")=ChildNo("C") %%OpenWin(ClientDoc[ChildNo("C")],.params) %%MDICascade %%SetFocus(ClientDoc[ChildNo("C")].) ----------- End End End Begin MChoice 3 Title = &Server Begin Event EvSELECT ----------- Begin Document ActionLogic 6 N settings S ChildNo("S")=$G(ChildNo("S"))+1 S settings("LINKTOPIC")="S"_ChildNo("S") %%OpenWin(Server[ChildNo("S")],,.settings) %%MDICascade %%SetFocus(Server[ChildNo("S")].) ----------- End End End End Begin Menu %B Visible = 1 Begin MChoice 1 Title = &Cascade Begin Event EvSELECT ----------- Begin Document ActionLogic 1 %%MDICascade ----------- End End End End End Begin Window Server GUI.MSM Active = 1 AlwaysOnTop = 0 CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MinButton = 1 PosLeft = 0 PosRecall = 0 PosTop = 0 PosUnits = ZDLG Resizable = 0 SizeHeight = 102.5 SizeRecall = 0 SizeUnits = ZDLG SizeWidth = 144 Title = Server Type = ZMDICHILD Units = ZDLG Visible = 1 WinHeight = 118 WinUnits = ZDLG WinWidth = 150 Begin Control Document DOCUMENT Active = 1 Border = 1 DisplayOnly = 0 PosLeft = 8 PosTop = 56 PosUnits = ZDLG ScrollHeight = 0 ScrollHorz = 0 ScrollUnits = ZDLG ScrollVert = 1 ScrollWidth = SizeHeight = 40 SizeUnits = ZDLG SizeWidth = 128 Title = Item: Document Type = DOCUMENT VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 4 N g,ev F ev="LINKCLOSE","LINKPOKE","LINKREQUEST" S g("EVENT",ev)="LinkEvt^"_$T(+0) %%MergeCtl(Document,g) %%Set(,"A document can contain multiple lines."_$C(13,10)_"When a TEXT gadget links to this, only the first line (up to the first CR/LF) will be transferred into it.") -------- End End End Begin Control Text TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 0 MaxLength = PosLeft = 8 PosTop = 36 PosUnits = ZDLG SizeHeight = 10 SizeWidth = 128 Title = Item: Text Type = TEXT ValidateParams = ValidateType = Value = A line of text VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 3 N g,ev F ev="LINKCLOSE","LINKPOKE","LINKREQUEST" S g("EVENT",ev)="LinkEvt^"_$T(+0) %%MergeCtl(Text,g) -------- End End End Begin Control lblService LABEL AutoSize = 0 Border = 0 PosLeft = 8 PosTop = 8 PosUnits = ZDLG SizeHeight = 7 SizeWidth = 128 Title = Service: Type = LABEL Begin Event Ev10 -------- Begin Document ActionLogic 1 %%Set(,"Service: "_^$DI($PD,"LINKSERVICE")) -------- End End End Begin Control lblTopic LABEL AutoSize = 0 Border = 0 PosLeft = 12 PosTop = 16 PosUnits = ZDLG SizeHeight = 7 SizeWidth = 124 Title = Topic: Type = LABEL Begin Event Ev10 -------- Begin Document ActionLogic 1 %%Set(,"Topic: "_%%Prop(..LINKTOPIC)) -------- End End End Begin Event Ev10 ----- Begin Document ActionLogic 5 I %%Prop(..LINKTOPIC)="" D E^%msgbox("Requires LINKTOPIC to be set at creation via Settings") %%NotOK Q N ev,w F ev="LINKOPEN","LINKCLOSE","LINKEXECUTE" S w("EVENT",ev)="LinkEvt^"_$T(+0) %%MergeWin(,w) %%Set(..Title,"Server - "_%%Prop(..LINKTOPIC)) ----- End End Begin Event Ev90 ----- Begin Document ActionLogic 6 LinkEvt ; D LOG^EVENTSg Q:%%EvType'="LINKEXECUTE" Q:$$YN^%msgbox("Execute of the following code was requested:"_$C(13)_^$E("LINKCOMMAND")_$C(13)_"Permit this (actual execution doesn't take place) ?") K ^$E("OK") Q ----- End End End Begin Window Target GUI.MSM Active = 1 AlwaysOnTop = 0 CancelButton = btnCancel CompPrefixGbl = XXX CompPrefixRtn = XXX CompTrace = 0 DefaultButton = btnOK DevMode = GUI FontBold = 0 FontFace = M,SANS FontItalic = 0 FontSize = 8 FontUline = 0 GridHeight = 4 GridOn = 1 GridSnap = 1 GridUnits = ZDLG GridWidth = 4 MVersion = MSM Maximized = 0 MinButton = 0 PosJustifyH = C PosJustifyV = C PosLeft = 0 PosRecall = 0 PosTop = 0 PosUnits = ZDLG Resizable = 0 SizeHeight = 110.5 SizeRecall = 0 SizeUnits = ZDLG SizeWidth = 195 Title = Target Type = APPLICATION Units = ZDLG Visible = 0 WinHeight = 126 WinUnits = ZDLG WinWidth = 201 Begin Control btnCancel BUTTON Active = 1 CanContain = 0 Cancel = 1 Picture = PosLeft = 96 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeUnits = ZDLG SizeWidth = 28 Title = Cancel Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 1 %%Cancel -------- End End End Begin Control btnOK BUTTON Active = 1 CanContain = 0 Cancel = 0 Picture = PosLeft = 60 PosTop = 92 PosUnits = ZDLG SizeHeight = 12 SizeUnits = ZDLG SizeWidth = 28 Title = OK Type = BUTTON Begin Event Ev30v1 -------- Begin Document ActionLogic 14 N source,item,params,retcode ; Get text of the selected service %%GetSel(lbServices,source,T) S source=$O(source("")) ; Get text of chosen/entered item %%Get(leItem.Value,item) ; If both have been supplied, return in subscripts ; after converting source-delimiter back from TAB to pipe I (source="")!(item="") S retcode=%%RetCancel E D . S params("Source")=$TR(source,$C(9),$C(124)) . S params("Item")=item . S retcode=%%RetNormal %%Return(retcode,params) -------- End End End Begin Control lbServices LIST Active = 1 ChoiceField = ChoiceVar = DisplayOnly = 0 MaxSelect = 1 PosLeft = 4 PosTop = 12 PosUnits = ZDLG SizeHeight = 67 SizeUnits = ZDLG SizeWidth = 104 TabStops = 120 Title = Services: Type = LIST VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 6 ; Load list of DDE sources N sces,choices,i M sces=^$DI($PD,"LINKSOURCE") S sces="" F i=1:1 S sces=$O(sces(sces)) Q:sces="" S choices(i)=$TR(sces,$C(124),$c(9)) %%SetChoice(,choices) -------- End End Begin Event EvSELECT -------- Begin Document ActionLogic 2 ; When a source has been selected, obtain the items list D LoadI1 -------- End End End Begin Control leItem LISTENTRY Active = 1 ChoiceField = ChoiceVar = DispFmtParams = DispFmtType = DisplayOnly = 0 MaxLength = PosLeft = 116 PosTop = 12 PosUnits = ZDLG SizeHeight = 65 SizeUnits = ZDLG SizeWidth = 72 Title = Items: Type = LISTENTRY ValidateParams = ValidateType = VarName = VarPermanent = 0 Begin Event EvDBLCLICK -------- Begin Document ActionLogic 1 %%Perform(btnOK.Push) -------- End End End Begin Control txtTransfer TEXT Active = 1 Border = 1 DispFmtParams = DispFmtType = DisplayOnly = 0 MaxLength = PosLeft = 4 PosTop = 88 PosUnits = ZDLG SizeHeight = 12 SizeUnits = ZDLG SizeWidth = 48 Type = TEXT ValidateParams = ValidateType = Value = Hidden at runtime VarName = VarPermanent = 0 Begin Event Ev10 -------- Begin Document ActionLogic 3 ; This control is used to submit a DDE request for the items of a source ; so it's hidden at runtime %%Hide -------- End End End Begin Event Ev90 ----- Begin Document ActionLogic 34 LoadI1 ; N source,g ; Pre-clear old Items list %%ResetChoice(leItem) ; Obtain source choice with pipe delimiter %%GetSel(lbServices,source,T) S source=$O(source("")) Q:source="" S source=$TR(source,$C(9),$C(124)) ; Assemble DDE settings for the hidden transfer control S g("LINKSOURCE")=source ; Decide which item to request I $P(source,$C(124),2)="System" S g("LINKITEM")="SysItems" E S g("LINKITEM")="TopicItemList" ; Fetch the item only when required S g("LINKMODE")="MANUAL" ; Perform a fetch now S g("LINKACTION")="REQUEST" ; Say where to go when the fetch completes S g("EVENT","LINKACTION")="LoadI2^"_$T(+0) ; Apply these DDE settings %%MergeCtl(txtTransfer,g) Q LoadI2 ; ; The manual request made on txtTransfer has completed N c,topics,one Q:^$E("LINKSTATUS")'="SUCCESS" ; Load the result %%Get(txtTransfer.Value,topics) ; Convert tab-delimited items into subscripted list F c=1:1:$L(topics,$C(9)) S one=$P(topics,$C(9),c) I one'="" S c(one)=one ; Load the Items list %%SetChoice(leItem,c) Q ----- End End Begin Event EvCLOSE ----- Begin Document ActionLogic 1 %%Cancel ----- End End End