mrprogressbar__define.pro


Name:
mrProgressbar
Methods:
Constructor
mrProgressbar::init         : constructor

Public
mrProgressbar::update       : set value between 0. and 1.
mrProgressbar::reset        : reset bar to 0.
mrProgressbar::cancel       : check for status of cancel button

Private
mrProgressbar__define       : constructor part I
mrProgressbar::cleanup      : destructor
Description:
An object that implements a progress bar widget. Based on
Robert Mallozzi's widget_progress.
Example code:
>
>   progress = obj_new('mrProgressbar', cancel_label = 'Interrupt')
>
>    for i = 0, 20 do begin
>
>        fraction = i / 20.0
>
>        progress->update, fraction
>        IF (progress->cancel ()) then $
>           goto, DONE
>
>        ; Replace the WAIT command with the work you want performed
>        ;
>        wait, 2
>
>    end
>
>    DONE:
>    obj_destroy, progress

Name:
mrProgressbar::init
Syntax:
pb = obj_new('mrProgressbar', parent, xpos=int, ypos=int, title=string, /frame, /remaining, $
              cancel_label=label, /cancel_button, /floating, /modal, group_leader=group_leader)
Arguments:
parent
If supplied, the progressbar will use parent as parent base, otherwise it will
create a separate top-level widget as parent.
xpos, ypos
For top-level widgets, x and y position of the window - if not provided,
the progressbar will display in the center of the screen
xsize
x size of the bar in pixels, default is 300
title
For top level windows, a string holding the title of the window
frame
If set, draw a frame around the base_window
group_leader
Sets the group leader for this widget
floating
Makes this widget a floating widget - group_leader must be provided in this case.
modal
Makes the progressbar a modal widget - group_leader must be provided
Modal widgets will not stop calculation tasks, they just prevent the user from
doing anything else in the meantime
remaining
If set, estimate remaining time. Possible values are '0' = no estimation (default),
'1' for integrated estimation and '2' for adaptive estimation
cancel_label
Label for the cancel_button - default is 'Cancel'
cancel_button
Flag - if set, a cancel button is displayed
Description:
initialize a mrProgressbar object and display it on screen
If the progressbar is created with option /remaining, an estimated
remaining time, calculated from starting time and the current time point
will be calculated. If set to 2, the remaining time will be calculated
from the last 5 calls.
Known bugs:
fgcolor and bgcolor is ignored!

Name:
mrProgressbar::cleanup
Description:
destroys the progressbar window

Name:
mrProgressbar::update
Syntax:
obj->update, fraction
Arguments:
fraction
A floating value between 0. and 1.
Description:
Update the progress widget - updating to a smaller value has no
visible effect! In that case use mrProgressbar::reset before updating.

Name:
mrProgressbar::reset
Syntax:
obj->reset()
Description:
Resets the mrProgressbar display to 0%

Name:
mrProgressbar::cancel
Syntax:
res = obj->cancel()
Return value:
'1', if cancelbutton has been pressed, else '0'
Description:
Check, whether cancel button has been pressed.

Name:
mrProgressbar__define
Description:
Implementation of a mrProgressbar object

Last modified: Mon Nov 29 13:30:07 2004