Search documentation of wx

# View Source wxProgressDialog (wx v2.4.2)

Functions for wxProgressDialog class

If supported by the platform this class will provide the platform's native progress dialog, else it will simply be the `wxGenericProgressDialog` (not implemented in wx).

This class is derived (and can use functions) from: `wxDialog` `wxTopLevelWindow` `wxWindow` `wxEvtHandler`

wxWidgets docs: wxProgressDialog

# Summary

## Types

wxProgressDialog()

## Functions

destroy(This)

Destroys the object.

new(Title, Message)
new(Title, Message, Options)
resume(This)

Can be used to continue with the dialog, after the user had clicked the "Abort" button.

update(This, Value)
update/3

Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified.

# Types

Link to this type

# wxProgressDialog()

View Source

    -type wxProgressDialog() :: wx:wx_object().

# Functions

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxProgressDialog()) -> ok.

Destroys the object.

Link to this function

# new(Title, Message)

View Source

    -spec new(Title, Message) -> wxProgressDialog()
                 when Title :: unicode:chardata(), Message :: unicode:chardata().

Link to this function

# new(Title, Message, Options)

View Source

    -spec new(Title, Message, [Option]) -> wxProgressDialog()
                 when
                     Title :: unicode:chardata(),
                     Message :: unicode:chardata(),
                     Option :: {maximum, integer()} | {parent, wxWindow:wxWindow()} | {style, integer()}.

Link to this function

# resume(This)

View Source

    -spec resume(This) -> ok when This :: wxProgressDialog().

Can be used to continue with the dialog, after the user had clicked the "Abort" button.

Link to this function

# update(This, Value)

View Source

    -spec update(This, Value) -> boolean() when This :: wxProgressDialog(), Value :: integer().

Link to this function

# update/3

View Source

    -spec update(This, Value, [Option]) -> boolean()
                    when
                        This :: wxProgressDialog(),
                        Value :: integer(),
                        Option :: {newmsg, unicode:chardata()}.

Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified.

Returns true unless the "Cancel" button has been pressed.

If false is returned, the application can either immediately destroy the dialog or ask the user for the confirmation and if the abort is not confirmed the dialog may be resumed with `resume/1` function.

If `value` is the maximum value for the dialog, the behaviour of the function depends on whether `wxPD_AUTO_HIDE` was used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was not, the dialog becomes a modal dialog and waits for the user to dismiss it, meaning that this function does not return until this happens.

Notice that if `newmsg` is longer than the currently shown message, the dialog will be automatically made wider to account for it. However if the new message is shorter than the previous one, the dialog doesn't shrink back to avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you may call `wxWindow:fit/1` explicitly. However the native MSW implementation of this class does make the dialog shorter if the new text has fewer lines of text than the old one, so it is recommended to keep the number of lines of text constant in order to avoid jarring dialog size changes. You may also want to make the initial message, specified when creating the dialog, wide enough to avoid having to resize the dialog later, e.g. by appending a long string of unbreakable spaces (`wxString` (not implemented in wx)(L'\u00a0', 100)) to it.