Back

showProgressDialog

JS Py
Hello World
Content:
- Properties
- Methods

Shows a progress dialog component into your app.

prd = ui.showProgressDialog( text, options ) → Object: ProgressDialog

Properties

These are the setter and getter properties for the showProgressDialog Component.

Example - Progress Dialog

class Main extends App
{
    onStart()
    {
        // Creates a fullscreen layout with objects vertically centered.
        this.main = ui.addLayout("main", "Linear", "VCenter,FillXY")

        // Add a button to the main layout
        this.btn = ui.addButton(this.main, "Show Progress Dialog", "Outlined")

        // Add a callback handler when the button is click
        this.btn.setOnTouch( this.onTouch )
    }

    onTouch()
    {
        // Show a progress dialog with `AutoCancel` the dismisses on backdrop click
        ui.showProgressDialog("Loading...", "AutoCancel")
    }
}
from hybrid import ui

def OnStart():
    main = ui.addLayout("main", "Linear", "VCenter,FillXY")
    btn = ui.addButton(main, "Show Progress Dialog", "Outlined")
    btn.setOnTouch(onTouch)

def onTouch(event):
    ui.showProgressDialog("Loading...", "AutoCancel")
Copy All       Run      

Example - Nocancel progress dialog

class Main extends App
{
    onStart()
    {
        // Creates a fullscreen layout with objects vertically centered.
        this.main = ui.addLayout("main", "Linear", "VCenter,FillXY")

        // Add a button to the main layout
        this.btn = ui.addButton(this.main, "Show Progress Dialog", "Outlined")

        // Add a callback handler when the button is click
        this.btn.setOnTouch( this.onTouch )
    }

    onTouch()
    {
        // Show a progress dialog with `AutoCancel` the dismisses on backdrop click
        this.pdlg = ui.showProgressDialog("Loading...", "NoCancel")

        // hide the progress dialog after 2 seconds
        setTimeout( () => {
            this.pdlg.hide()
            ui.showPopup( "Progress dialog is close!" )
        }, 2000)
    }
}
from hybrid import ui

def OnStart():
    main = ui.addLayout("main", "Linear", "VCenter,FillXY")
    btn = ui.addButton(main, "Show Progress Dialog", "Outlined")
    btn.setOnTouch(onTouch)

def onTouch(event):
    pdlg = ui.showProgressDialog("Loading...", "NoCancel")

    def hideProgressDialog():
        pdlg.hide()
        ui.showPopup("Progress dialog is close!")

    app.SetTimeout(hideProgressDialog, 2000)
Copy All       Run      

Methods

The following methods are available on the showProgressDialog object:

hide()
show()
String: comma “,” separated
String: “The text message of the progress dialog. Options can be
`AutoCancel` to close the dialog when backdrop is click.”
String: Sets or returns the ProgressDialog text.
function()
prd.hide
Hides the dialog component
prd.setOnClose
Adds a callback handler method on close event
prd.show
Show the progress dialog component