VisuDialogs.FileOpenSave

2020-11-17
2020-11-20
  • jeromebunel - 2020-11-17

    Hi. I try to use the visu Dialog "VisuDialogs.FileOpenSave;"
    When i open this dailog, all is display correctly.

    When the Dialog is closed, the file name selected by the user is available by calling the GetSelectedFileName method.

    My question is : how to know when this Dialogs windows is closed.

    Thank you

     
  • sedoerr - 2020-11-18
    FUNCTION CheckDialogOpen : BOOL
    VAR_INPUT
        sDialogName         : STRING;
    END_VAR
    VAR
        pstClientData       : POINTER TO VisuElems.VisuStructClientData;
        itfDialogManager    : VisuElems.IDialogManager;
        itfMyDialog         : VisuElems.IVisualisationDialog;
    END_VAR
    
    //PrΓΌfen ob Dialogfenster geΓΆffnet
    VisuElems.g_ClientManager.BeginIteration();
    
    WHILE (pstClientData := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
        IF LEN(TO_STRING(pstClientData^.GlobalData.CurrentUserName)) <> 0 THEN  //Nur Dialoge fΓΌr den angemeldeten Benutzer prΓΌfen
            itfDialogManager := VisuElems.g_VisuManager.GetDialogManager();
            itfMyDialog := itfDialogManager.GetDialog(sDialogName);
    
            CheckDialogOpen := VisuDialogs.VisuDlgUtil_IsDialogOpen(itfMyDialog,pstClientData,itfDialogManager);
        END_IF
    END_WHILE
    
     
  • jeromebunel - 2020-11-18

    Hello.
    Thank you for your answer which corresponds exactly to my question.It works perfectly.
    The problem is, my question was wrong.
    The correct question is: how do you know if the user clicked on "Load" or "Cancel".

    Another question: can you explain how the parameters work: "stFilter" and "bTouch".

    When I put '.ini' or 'ini' in stFilter I expect to only view "ini" files.
    This is not the case.

    thank you so much

     
  • sedoerr - 2020-11-19

    Thats a good question. I made it in this way that is looked on the error code. If user canceled the error code will show an error. if he user "load" it will give you a done.

    that was for me the only way to handle this problem.

    Where do you get this parameters?: "stFilter" and "bTouch"

    Do you used this example?
    https://store.codesys.com/alle-produkte/visu-file-transfer-example.html

     
    πŸ‘
    1
    • jeromebunel - 2020-11-20

      Hi sedoeer.

      what error code are you talking about?
      What returns this error code ?

      The parameters "stFilter" and "bTouch" are 2 inputs of the Visu_FbFileListProvider.Iniatialize() method.
      It's ok for "stFilter";i saw how does it work in the VisuDialogSt example. But i don't understand what is "bTouch".

      This link doesn't work
      https://store.codesys.com/alle-produkte/visu-file-transfer-example.html

      On CoDeSys store, the "Visu File Transfer Example" can't be downloaded. An error msg is send back "Error 403
      Admin access required"

      Thank you

       
      • kislov - 2020-11-20

        About bTouch.

        It make sense if you enter a file/dir name (for example, you create new directory)

        bTouch := TRUE ---> using "virtual" keyboard (Keypad from VisuDialogs)
        bTouch := FALSE ---> using hardware keyboard (you got just text input field with blinking cursor)

         
        • jeromebunel - 2020-11-20

          Ok Thank you very much.

           
      • sedoerr - 2020-11-20

        Hey,
        ah sorry i see, i muddled up with file transfering. There is also an dialog for opening files, but a different one.

        Hmm i tried to have a look if i can find something for "btouch" but it seems that this is absolutely undocumented.
        I think it has something to do with the buttons of this dialog?!

         
        • jeromebunel - 2020-11-20

          Yes of course the solution is into the Button code or in the Function block.

          Is the source code of its librairy is available ?

           

Log in to post a comment.