HISE Logo Forum
    • Categories
    • Register
    • Login

    Anyone got a way to prevent multiple message boxes at the same time?

    Scheduled Pinned Locked Moved Scripting
    10 Posts 3 Posters 239 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey
      last edited by

      I'm working on my download manager and when a download fails it pops up with a message to let the user know - using Engine.showMessageBox()

      The problem is if one file in a download fails, usually they all fail and so multiple messages are shown which is annoying, especially when there are a lot of downloads.

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @d.healey
        last edited by

        @d-healey Maybe a solution could be to run your own modal so you can keep track of its state.
        Or could the MultiPage system be of any use here?

        Can't help pressing F5 in the forum...

        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @ustk
          last edited by

          @ustk I want to avoid building my own system for this single use-case. Not sure how the multipage thingy could help, I haven't used it before.

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 0
          • A
            aaronventure
            last edited by aaronventure

            Is that the only place you're calling it? You could have a counter along with it, and a check for the overall execution. Decrease the counter when pressing ok or whatever.

            Settle on a variable name and check for it anywhere you make that call. Good thing about if checks is that they don't require a variable to be defined to check, it'll just return false, so it doesn't compromise your modular focus.

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @aaronventure
              last edited by

              @aaronventure said in Anyone got a way to prevent multiple message boxes at the same time?:

              Decrease the counter when pressing ok or whatever.

              How?

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              A 1 Reply Last reply Reply Quote 0
              • A
                aaronventure @d.healey
                last edited by aaronventure

                @d-healey Isn't there a callback, like a function for when you hit ok?

                EDIT: Ah, that's the showYesNoWindow method.

                1 Reply Last reply Reply Quote 1
                • A
                  aaronventure
                  last edited by aaronventure

                  Your own solution for this is just a panel that you're calling with showAsPopup, You can ignore hierarchy with the setZLevel method, although it doesn't work in on init, so you need to call it whenever you're showing the panel.

                  Other than that it's pretty much self contained, it'll just appear in your component list whenever you include that module. But unlike the ok popup, you get to do whatever you want with it, and without having to adjust the global LAF.

                  HiseSnippet 1046.3ocsV0saaaCElxwJq1qsncnO.B9J0gfB6XWmDLLzl3jzYzlDg4zhgdSAsHULgoHEDoRiaQtaOO6UXOK6MXuAaGJJYqT6kzZf4KjE44uuygmuCUPpLjpTxTjSyymkPQN22czLgdxfIXl.M7PjyCcOAqzzTO6VGLKAqTTBxwYiWY1voQcT9u+9EGf4XQHcwVHz6jrP5aXwL8hcCd4qYb9wXB8bVbEs68xggRw.IWlA3YC21nDb3T7EzSwF0p4h9ErZBx4Gca+79T5NciHDb2tj986u2t60auN3n18vi6zeuda2ams2cmHjylGQXZY5HMVSUfSOPRlMZh7iBa.dGSwFyolEcPifHa2FMXBiSBJKNJDxodvhR0F1R0SbOgQXy2eQI6Q4B7VXQ0hlSsaCRc9FfjSEHU2BoG6NJLkknWHwfmu2cn.NAivvYSUnX0EU680bGHAMD5mEimRONEVL2B+9saukG73o+Tylv4iR6kH3d+rWoIXBI.Knb+VIl+ZskGnuQaPsmonZ+VLUfLIKInPrNMiZbVg2lJFeSu8ZgbreqovyE9xp5Xs3lpdPlVKE9sFm+OndWCX6ZAKSvYBpWTlHTyjBOovplw9TI2OTFmHEfm1x6RLGvTyO2rAKxy2txqYCXci7r.Nd12lD9EnuP.U+92Puzj76y+Hdl5Lw4xjVF4W2rAkqnU7RHWpnktwpx0.LKSmKn5AkHZdF8TSHJ.7.LmOFXD9eQh.tpRNdpTSOS3mmLMuto2WJJJZkxJ7EmltRwFlZ5sYnuHKdLMsZoznHzYdy18M+5Z2CsEkJJJECEL8YIzh0GK4DSar48kIGnhpJPSpUfPPUcNI4gEjjQbFglhXfS1z0ztgxwd0wWn+KasMd41dOW6owJr9sCODqwFpZAb.HlPS0LSkv4P5kvvQKwsg6gT0TsLAhz7t.jiqMpOnjVaXP4A86byIanq.cbLgZV4KUIal8browbWd+6pHrrKU5YlSnMcMLSTLiP3z.ohY5.pL++OgqIRFw9TdM3yO4Od0e8oe+EwUuh.ghwWU8FCUVTD6p7Y6QLdrRCPZXLLxG47CtuEXODZDNiq8TSA+.z4oTx4xb8qlS0u6Cm7rZKmhrx7BZ4wmvfaIIii02bZt4dtBAlLt5HTyXRATIlUMq9FFw29VGw+0BwG6FvzgSVMFqsBLZnE+OfwhKFef6QQQzP8B.V283eacuE7NB+uJyzLwEmfgdGyg7oYwifOfHjBQW.b.k47tlgCXW2trqdDUPxW7OvuBgcJYLFgcJEBcsgoxODZmEXt58d46.XRj+oIMfuQBV60Y4Y..ag8gvva5pkLb600vtqqg8VWCe95ZX+00vcVWC28tMz7gZ6mokwVZCBcRvQ4yrcbNRfgNv7tUz+ZKlUDH
                  
                  d.healeyD 1 Reply Last reply Reply Quote 1
                  • d.healeyD
                    d.healey @aaronventure
                    last edited by

                    @aaronventure Oh yeah I know several ways to roll my own system, but I'd like to avoid having to do that. I'm also thinking is there any occasion where we would want more than one of these alert windows to be shown at the same time.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      aaronventure @d.healey
                      last edited by

                      @d-healey said in Anyone got a way to prevent multiple message boxes at the same time?:

                      want more than one of these alert windows to be shown at the same time.

                      Sure, when making a Windows-like UX

                      1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey
                        last edited by

                        I've just added Engine.showMessageBoxWithCallback() it works exactly the same way as Engine.showMessageBox() but you can pass in a callback as a 4th parameter and it will only allow one message box to be shown at a time.

                        Link Preview Image
                        Added Engine.showMessageBoxWithCallback by davidhealey · Pull Request #700 · christophhart/HISE

                        This shows a message box and triggers a callback function after the user clicks ok. It also only allows one message box to be shown at a time.

                        favicon

                        GitHub (github.com)

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post

                        19

                        Online

                        1.8k

                        Users

                        12.0k

                        Topics

                        104.5k

                        Posts