Displaying a 'Please wait' message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DJG
    Forum Member
    • Jan 2005
    • 7

    Displaying a 'Please wait' message

    Setup factory 7 is wonderful but I have a deadline and need to do this:-
    Display a message that says 'Please wait while I search' (no user action is required) - I then do a file.find and hide the message after the file is found.
    Right now I can only have screen text that says 'click the next button and wait for the system to find the file'.
    Any other fast solutions would also be gratefully received. I have 8 hours to get this app out.
  • Ted Sullivan
    Indigo Rose Staff Member
    • Oct 2003
    • 963

    #2
    No problem. Use StatusDlg.Show and StatusDlg.Hide to do exactly that. Check out the links for a full example.
    New Release: Setup Factory 9.6 adds Windows 11 compatibility and support for hardware token OV/EV Code Signing certificates.

    Comment

    • Intrigued
      Indigo Rose Customer
      • Dec 2003
      • 6138

      #3
      To add to Ted's suggestion I went ahead and crafted a simple Function that you can edit by going into the Global Functions section.

      Here is the Global Functions code:

      Code:
      --[[
      This is a function that will search for a file.
      When call this function, change out sFile to the...
      path to the file you want to check for.  Make sure...
      such is wrapped in double-quotes ("") and each directory...
      is seperated by TWO BACKSLASHES!
      For example: fFILESEARCH("\\WINDOWS\\notepad.exe")
      Then put that line of text in say the 'On Startup' event
      ]]
      
      function fFILESEARCH(sFile)
      	StatusDlg.Show(true);
      	StatusDlg.SetMessage("Please wait while I search...");
      
      	found = File.Find(_SourceDrive, sFile, false);
      
      	if (found) then
      		StatusDlg.Hide();
      		Dialog.TimedMessage("Notice...", "File found.", 3000, MB_ICONINFORMATION);
      	else
      		StatusDlg.Hide();
      		Dialog.TimedMessage("Alert!", "FILE NOT FOUND!", 3000, MB_ICONEXCLAMATION);
      	end
      end
      The Function is then called in the On Startup event area:

      Code:
      --[[
      Call the Function that was created in the...
      Global Functions section
      ]]
      
      fFILESEARCH("\\WINDOWS\\notepad.exe");
      SEE: Attachment (for .sf7 project file)

      Please note: That the file being checked for is notepade.exe (which works for Windows XP as the code is now. Your milage may vary).
      Attached Files
      Intrigued

      Comment

      • DJG
        Forum Member
        • Jan 2005
        • 7

        #4
        Status Screen

        Thanks for that chaps, but showing the StatusDlg displays all the files being searched with the window expanding and contracting for long path names. It also takes considerably longer like this. Is there any way to display the message without all the filenames appearing.

        Thanks

        Comment

        • DJG
          Forum Member
          • Jan 2005
          • 7

          #5
          Displaying a search message

          OR - can I just change the static text on the screen. I know there is a 'Screen.SetLocalizedString("Text ID","My Text");' command but I can't see where the text ID is - perhaps it can't be changed.
          Last edited by DJG; 01-18-2005, 05:06 AM. Reason: Missed out information

          Comment

          • Brett
            Indigo Rose Staff Member
            • Jan 2000
            • 2001

            #6
            Use a Progress Bars screen. Go to the On Start event and start your file search. The On Finish event should already have the Screen.Next command to proceed. To set static text, use the action:

            Code:
            DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_01,{Text="Please wait..."});

            Comment

            • Intrigued
              Indigo Rose Customer
              • Dec 2003
              • 6138

              #7
              Originally posted by Brett
              Use a Progress Bars screen. Go to the On Start event and start your file search. The On Finish event should already have the Screen.Next command to proceed. To set static text, use the action:

              Code:
              DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_01,{Text="Please wait..."});
              I tried this after I posted with a bigger search area... and noticed the dialog box expanding and contracting too. Yikes!

              Now, I'll have to try Brett's idea out myself, alright!

              Learning SF 7 or bust!
              Intrigued

              Comment

              • DJG
                Forum Member
                • Jan 2005
                • 7

                #8
                Please wait - message

                Originally posted by Brett
                Use a Progress Bars screen. Go to the On Start event and start your file search. The On Finish event should already have the Screen.Next command to proceed. To set static text, use the action:

                Code:
                DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_01,{Text="Please wait..."});
                I tried this - it didn't work but CTRL_STATICTEXT_BODY did, but not until after I sent out the app.

                I'll look at progress bars next BUT - where do I find these constants such as CTRL_STATICTEXT_BODY.
                The help file says:

                ControlID
                (number) The numeric ID of the static text control whose properties you want to set.

                I checked everything in the static text window but nowhere could I find the list of constants. This I find particularly infuriating and time consuming. Perhaps I'm missing something!

                Any ideas?

                Comment

                • Brett
                  Indigo Rose Staff Member
                  • Jan 2000
                  • 2001

                  #9
                  The descriptions of the screen control IDs are in the Help file. Open the SUF70 help file and in the Contents tree go to:

                  Programming Reference > Screen Types

                  Then click on the screen type that you are working with and then open the Adnaced topic for that screen.

                  Comment

                  • DJG
                    Forum Member
                    • Jan 2005
                    • 7

                    #10
                    Thanks Brett,

                    I too have written huge help files for my application and although I know where to find everything, my clients probably have the same problems as I have knowing what to look for.

                    I'm using a progress bars screen with my code in the ON START section.

                    I think I've nearly *****ed this - can you bear one more question. in file.find, my callback function is not being called. I've set up a debug window to display a 'hello world' from within the function but it never displays.

                    Snippet:

                    for j,k in result do
                    what_type = Drive.GetType(k)
                    if what_type == DRIVE_FIXED then
                    found = File.Find(k, "*rotaquest.exe", true, false, MYshowprogress, nil);
                    ............

                    The function name is the same case - here it is:-

                    function MYshowprogress(cPath)
                    nPos = DlgProgressBar.GetPos(CTRL_PROGRESS_BAR_01);
                    Debug.Print("Pos = ".. nPos);
                    Debug.Print(cPath);
                    if npos >= 100 then
                    DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01,1);
                    else
                    DlgProgressBar.Step (CTRL_PROGRESS_BAR_01)
                    end
                    return true
                    end


                    If I can solve this then I'll be leaping over the moon.

                    DJG
                    Last edited by DJG; 01-18-2005, 04:09 PM. Reason: additional info

                    Comment

                    • DJG
                      Forum Member
                      • Jan 2005
                      • 7

                      #11
                      Progress bars

                      I've now got this working by putting the callback function before the file.find.
                      Also, I found a case-different variable (e.g. nPos and npos) and missing ;

                      Comment

                      • Intrigued
                        Indigo Rose Customer
                        • Dec 2003
                        • 6138

                        #12
                        I understand the case-sensitive issue myself. I bet we all do. It can be a real pain to track down such a type of error. I probable do this once every other project.
                        Intrigued

                        Comment

                        Working...
                        X