wxProgressDialog.3erl - Man Page

Functions for wxProgressDialog class

Description

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

Data Types

wxProgressDialog() = wx:wx_object()

Exports

new(Title, Message) -> wxProgressDialog()
Types:

Title = Message = unicode:chardata()

new(Title, Message, Options :: [Option]) -> wxProgressDialog()
Types:

Title = Message = unicode:chardata()
Option =
   {maximum, integer()} |
   {parent, wxWindow:wxWindow()} |
   {style, integer()}

resume(This) -> ok
Types:

This = wxProgressDialog()

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

update(This, Value) -> boolean()
Types:

This = wxProgressDialog()
Value = integer()

update(This, Value, Options :: [Option]) -> boolean()
Types:

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.

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

Destroys the object.

Info

wx 2.0 Ericsson AB Erlang Module Definition