Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Find the name of the dialog

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

    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

    m.prestel - 2021-12-14

    Hey,
    what are you trying to do?

    Best regards,
    Marcel

     
  • spiritcore

    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

    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

    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

    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.