#include %Const #include %occInclude ShowCmdLine(ShowModal) Set ShowModal=$G(ShowModal,1) Kill Xecuter Set Xecuter=##class(UI.Utils.Spy.dlgCmdLine).%New($LB(MApplication.Address,0)) If ShowModal Do . Do Xecuter.Form.ShowModal() . Kill Xecuter Else Do . Do Xecuter.Form.Show() Quit CreateFlyingMsg(MainMsg,Width,ProcessMessages,BGColor,ShowProgressBar) Set ProcessMessages=$G(ProcessMessages) Set FlyingMsg=##class(UI.Lib.Dlg.TFlyingMsg).%New($LB(MApplication.Address)) Set FlyingMsg.lblMainMsg.Caption=MainMsg If $D(BGColor) Do . Set FlyingMsg.shBack.Brush.Color=BGColor . Set FlyingMsg.Form.Color=BGColor . Set FlyingMsg.lblMainMsg.Color=BGColor . Set FlyingMsg.lblSubMsg.Color=BGColor If $D(Width) Do . Set FlyingMsg.Form.Width=Width . Set FlyingMsg.Form.Position="poScreenCenter" If $G(ShowProgressBar,0) Do . Set FlyingMsg.ProgressBar.Visible="True" . Set FlyingMsg.lblSubMsg.Visible="False" Do FlyingMsg.Form.Show() Do FlyingMsg.Form.Update() Do:(ProcessMessages) MApplication.ProcessMessages() Quit SetFlyingMsg(Msg,ProcessMessages) Quit:('$D(FlyingMsg)) Set ProcessMessages=$G(ProcessMessages) Set FlyingMsg.lblMainMsg.Caption=Msg Do:(ProcessMessages) MApplication.ProcessMessages() Quit SetFlyingProgressBar(Value,ProcessMessages) Quit:('$D(FlyingMsg)) If FlyingMsg.ProgressBar.Visible="False" Do . Set FlyingMsg.lblSubMsg.Visible="False" . Set FlyingMsg.ProgressBar.Visible="True" Set FlyingMsg.ProgressBar.Position=Value Do:(ProcessMessages) MApplication.ProcessMessages() Quit SetFlyingSubMsg(SubMsg,ProcessMessages,BringToFront) Quit:('$D(FlyingMsg)) If FlyingMsg.lblSubMsg.Visible="False" Do . Set FlyingMsg.lblSubMsg.Visible="True" . Set FlyingMsg.ProgressBar.Visible="False" Set ProcessMessages=$G(ProcessMessages) Set BringToFront=$G(BringToFront) Set FlyingMsg.lblSubMsg.Caption=SubMsg Do:(ProcessMessages) MApplication.ProcessMessages() Do:(BringToFront) FlyingMsg.Form.BringToFront() Quit BringFlyingMsgToFront() Quit:('$D(FlyingMsg)) Do FlyingMsg.Form.BringToFront() Quit DestroyFlyingMsg() Quit:('$D(FlyingMsg)) Do FlyingMsg.Form.Close() Do FlyingMsg.%Close() Kill FlyingMsg Quit //--------------------------------------------------------------------------------- InputBox(Title,Question,Default,PasswordChar,Width) New InputForm Set InputForm=##class(UI.Lib.Dlg.TInputBox).%New($LB(%this.Form.Address,0)) Set InputForm.Form.Caption=$G(Title,"Van Hoecke") Set InputForm.lblMessage.Caption=$G(Question,"Geef de waarde op:") Set InputForm.txtValue.Text=$G(Default,"") Set InputForm.txtValue.PasswordChar=$G(PasswordChar,$C(0)) Set:($D(Width)) InputForm.Form.Width=Width New tmpAnswer Set tmpAnswer=InputForm.Form.ShowModal() Set Default=InputForm.txtValue.Text Do InputForm.%Close() Quit tmpAnswer //--------------------------------------------------------------------------------- BuildPropsArray(PropArrayName,ObjORef,ClassFilter) Set ClassFilter=$G(ClassFilter) Kill @PropArrayName@(ObjORef) Quit:($G(ObjORef)=0) New ClassDef Set ClassDef=##class(%ClassDefinition).%OpenId(ObjORef.%ClassName(1)) New Count Set Count=ClassDef.Properties.Count() New Loop,PropName For Loop=1:1:Count Do . Quit:(ClassDef.Properties.GetAt(Loop).Type'[ClassFilter) . Set PropName=ClassDef.Properties.GetAt(Loop).Name . Xecute "Set @PropArrayName@(ObjORef,PropName)=ObjORef."_PropName Do ClassDef.%Close() Quit //--------------------------------------------------------------------------------- RE(ErrorType,Msg,MsgBoxType) //Report Error #Include ReportErrorCNTs New Header,Body,Namespace Set Namespace=$ZUTIL(67,6,$J) Set ErrorType=$G(ErrorType,0) If ErrorType=$$$reMsg Do . Set Header="Specifieke fout" . Set Body=Msg Else If ErrorType=$$$reObjDoesNotExist Do . Set Header="Object bestaat niet" . Set Body="Kan het object '" _ Msg _ "' niet vinden (" _ Namespace _ ")." Else If ErrorType=$$$reUnableToOpenObj Do . Set Header="Object niet te openen" . Set Body="Het object '" _ Msg _ "' bestaat, maar kan niet geopend worden (" _ Namespace _ ")." Else If ErrorType=$$$reCannotCreateNewObj Do . Set Header="Nieuwe instantie onmogelijk" . Set Body="Kan een nieuwe instantie van '" _ Msg _ "' niet aanmaken." Else If ErrorType=$$$reStatusError Do . Set Header="Status error" . Set Body=$$ParseStatus^vhLib(Msg) Else If ErrorType=$$$reAppException Do . Set Header="Application exception" . Set Body="Tijdens het uitvoeren van de applicatie is een fout opgetreden." //Clearen van eventuele Mouse=Busy Set MApplication.ScreenCursor=0 //0=$$$crDefault //Stack wegschrijven naar een bestand ;New FN ;Set FN=$$GetCaller^vhLib("REStack_"_"_"_$P($H,",",1)_$P($H,",",2),"ReportError") //Tonen van message New REForm Set REForm=##class(UI.Lib.Dlg.ReportError).%New($LB(%this.Form.Address,0)) Set REForm.ExtraSendMsg=$ZDATETIME($H,4) ;Set REForm.ExtraSendMsg="Stackfile: "_FN Do REForm.SetErrorTxt(..%ClassName(1),Header,Body) Set REForm.Form.Height=REForm.Form.Height-25 Do REForm.Form.ShowModal() Do REForm.%Close() Quit //--------------------------------------------------------------------------------- pdaMsgBox(Caption,Msg,Type,OKCancelMode,InputMode,InputDefault) Set OKCancelMode=$G(OKCancelMode,0) Set InputMode=$G(InputMode,0) Set:(InputMode) OKCancelMode=1 ;Deze gaan steeds samen... Set:(InputMode) InputDefault=$G(InputDefault) New MBForm,tmpAnswer If $D(%this) Do . Set MBForm=##class(UI.MB.UGLYPicking.dlgMsgBox).%New($LB(%this.Form.Address,0)) Else Do . Set MBForm=##class(UI.MB.UGLYPicking.dlgMsgBox).%New($LB(MApplication.Address,0)) Set MBForm.Form.Caption=Caption Do MBForm.ShowMsg(Caption,Msg,Type,OKCancelMode) If InputMode Do . Set MBForm.txtValue.Text=InputDefault . Set MBForm.txtValue.Visible="True" Set tmpAnswer=MBForm.Form.ShowModal() Set:(InputMode) InputDefault=MBForm.txtValue.Text Do MBForm.%Close() Quit tmpAnswer //--------------------------------------------------------------------------------- AppIsEnabled(App,SubApp,Msg) #define IP4 $P(MApplication.GetClientIP(),".",4) New arEnable Merge arEnable=^UI.Settings(App,SubApp,"Enable") Quit:($G(arEnable("ALL"),1)) 1 ; Enabled for all users Quit:($G(arEnable("IP",$$$IP4),0)) 1 If '$D(Msg) Do . Set Msg="Het programma wordt momenteel aangepast,"_$C(13,10) . Set Msg=Msg_"probeer later nog eens opnieuw." Do:(Msg'="") MApplication.MessageBox(Msg,..Form.Caption,$$$MBICONINFORMATION) Quit 0 //--------------------------------------------------------------------------------- SetGlyph(Ctrl,Glyphs...) ;Project ter beschikking? Zoniet, direct afsluiten Quit:(MApplication.Name="") New ValidGlyphName ;Afhankelijk vh type control de gegevens toekennen If Ctrl.%ClassName()="%TMImageList" Do . New Loop,BitmapList . Set BitmapList="" . For Loop=1:1:Glyphs Do .. Set ValidGlyphName=$$sgGetValidGlyphName(Glyphs(Loop)) .. Set:(ValidGlyphName'="") BitmapList=$S(BitmapList="":ValidGlyphName,1:BitmapList_","_ValidGlyphName) . Set:(BitmapList'="") Ctrl.Bitmap=BitmapList Else Do . Set ValidGlyphName=$$sgGetValidGlyphName(Glyphs(1)) . Set:(ValidGlyphName'="") Ctrl.Glyph.Data=ValidGlyphName Quit sgGetValidGlyphName(Glyph) New GlyphPiece Set GlyphPiece=$ZCVT($P(Glyph,".",1),"U") New Found,tmpGlyph,FoundGlyph Set Found=0 Set tmpGlyph="" For Set tmpGlyph=$O(^SMProject(MApplication.Name,"Images",tmpGlyph)) Quit:((tmpGlyph="") || Found) Do . If $ZCVT($P(tmpGlyph,".",1),"U")=GlyphPiece Do .. Set Found=1 .. Set FoundGlyph=tmpGlyph If 'Found Do Quit "" . Do MApplication.MessageBox("Kan de glyph '"_Glyph_"' niet toekennen: niet aanwezig in het project.",MApplication.Name,$$$MBICONERROR) Quit FoundGlyph //--------------------------------------------------------------------------------- ColorNrToStr(ColorNr) Quit:(ColorNr=-1) "None" Quit:(ColorNr=0) "Black" Quit:(ColorNr=128) "Maroon" Quit:(ColorNr=32768) "Green" Quit:(ColorNr=12648384) "LtGreen" Quit:(ColorNr=8454016) "MedGreen" Quit:(ColorNr=32896) "Olive" Quit:(ColorNr=8388608) "Navy" Quit:(ColorNr=8388736) "Purple" Quit:(ColorNr=8421376) "Teal" Quit:(ColorNr=8421504) "Gray" Quit:(ColorNr=12632256) "Silver" Quit:(ColorNr=255) "Red" Quit:(ColorNr=8421631) "MedRed" Quit:(ColorNr=12632319) "LtRed" Quit:(ColorNr=33023) "Orange" Quit:(ColorNr=8438015) "MedOrange" Quit:(ColorNr=12640511) "LtOrange" Quit:(ColorNr=65280) "Lime" Quit:(ColorNr=65535) "Yellow" Quit:(ColorNr=8454143) "MedYellow" Quit:(ColorNr=12648447) "LtYellow" Quit:(ColorNr=16711680) "Blue" Quit:(ColorNr=16744576) "MedBlue" Quit:(ColorNr=16761024) "LtBlue" Quit:(ColorNr=16711935) "Fuchsia" Quit:(ColorNr=16711935) "Pink" Quit:(ColorNr=16744703) "MedPink" Quit:(ColorNr=16761087) "LtPink" Quit:(ColorNr=16776960) "Aqua" Quit:(ColorNr=16777088) "MedAqua" Quit:(ColorNr=16761024) "LtAqua" Quit:(ColorNr=12632256) "LtGray" Quit:(ColorNr=8421504) "DkGray" Quit:(ColorNr=8421631) "Focus" Quit:(ColorNr=16777215) "White" Quit:(ColorNr=536870911) "None" Quit:(ColorNr=536870912) "Default" Quit ColorNr_" ("_$ZH(+ColorNr)_"h)"