Find the name of the dialog

spiritcore
2021-12-14
2021-12-14
  • spiritcore - 2021-12-14

    Hi,
    Is there any way to find which dialog is opened in the moment?
    I tried looking in the VisuDialogs lib but couldn't find anything like the VisuElems.CurrentVisu
    Thanks!

     
  • m.prestel - 2021-12-14

    Hey,
    what are you trying to do?

    Best regards,
    Marcel

     
  • spiritcore - 2021-12-14

    Check if any dialog is opened and which one.
    So I can run certain processes in my program when a dialog is still open.

     
  • m.prestel - 2021-12-14

    There are a few ways you can do this.
    You can listen to every dialog which is opened/closed via the IDialogManagerListener.
    Or you can iterate over all clients and determine each active dialog.

    Best regards,
    Marcel

     
  • spiritcore - 2021-12-14

    Thanks!
    Do you have any idea what library do I nee to use for iterating over all the clients?

     
  • m.prestel - 2021-12-14

    Visu Utils (https://help.codesys.com/webapp/idx-Visu%20Utils-lib;product=Visu%20Utils;version=3.5.17.0) is the library to use.

    There you can use the function block FbIterateClients.
    The IVisualizationClient you get in HandleClient has to be casted to IVisualizationClientRaw.
    The ClientDataPointer can then be used to access GlobalData.DialogData

    Keep in mind these are internal structures which may change in the future.

    Best regards,
    Marcel

     

Log in to post a comment.