Progress Dialog provides visual feedback for long-running processes. The script allows to create a progress dialog, set it's title, animation, text lines, progress, and it will do all the work of updating on a background thread, being modeless, handling the user canceling the operation, and estimating the time remaining until the operation completes. When minimized, it shows percent complete.

progress.png

progress class is based on ole32 from Addons/general/pcall.

This is how the dialog is used during operations that require progress and the ability to cancel.

require 'general/pcall/progress'
T=: 1

p=: progress 'Testing Progress from J'

start__p ''
cancelmsg__p 'Cancelling'
1 line__p 'Progress reporting dialog'
timer__p''
delay__p 2*T

3 : 0 ''
for_t. 'Initializing ...';'Processed 1';'Processed 2';'Finished' do.
  if. c=. canceled__p '' do. break. end.
  10 progress__p t_index{0 2 8 10
  2 line__p ;t
  delay__p 2*T
end.
smoutput c{::'Completed';'Canceled'
)

destroy__p ''

Authors

Guides/Windows Progress Dialog (last edited 2009-10-12 04:29:44 by OlegKobchenko)