Check For Open Dialogs On Client

callumo1
2023-09-25
2023-09-26
  • callumo1 - 2023-09-25

    Is it possible to make a function that checks to see if there are any open dialogs on a given clients.

    I think VisuDialogs.VisuDlgUtil_IsDialogOpen does this for a given dialog name, but is it possible to do this for any dialog.

    Appretiate any help
    Cheers
    Callum

     
  • sedoerr - 2023-09-26
    FUNCTION CheckDialogOpen : BOOL
    VAR_INPUT
        sDialogName         : STRING;
    END_VAR
    VAR
        pstClientData       : POINTER TO VisuElems.VisuStructClientData;
        itfDialogManager    : VisuElems.IDialogManager;
        itfMyDialog         : VisuElems.IVisualisationDialog;   
    END_VAR
    
    VisuElems.g_ClientManager.BeginIteration();
    
    WHILE (pstClientData := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
        itfDialogManager    := VisuElems.g_VisuManager.GetDialogManager();
        itfMyDialog         := itfDialogManager.GetDialog(sDialogName);
    
        CheckDialogOpen     := VisuDialogs.VisuDlgUtil_IsDialogOpen(itfMyDialog,pstClientData,itfDialogManager);
    
        IF CheckDialogOpen THEN
            EXIT;
        END_IF
    
    END_WHILE
    
     
    • callumo1 - 2023-09-26

      Thanks for the reply. I want to be able to check if any dialogs are open of any name. I already have a function similar to what you have send but I don't want to have to run it for all the different dialog names. Thanks

       
  • sedoerr - 2023-09-26

    You need to create a function around this function to check the dialogs you use in your program.
    That's the way i have done it.

     
  • callumo1 - 2023-09-26

    Okay, Thanks for the help

     

Log in to post a comment.