1 - Start script counter on open (i.e., remove the "Start" button). I know what part of the script to remove to get rid of the start button, but I would like to include this script within another MS script and so have the counter start on script open.
2 - I believe that number of total length of progress is set by the width of the window? If my time units ("wait>" is equal to 60 seconds, then I need to make the window width equal to 60 units wide to equal an hour. Is this correct?
Code: Select all
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
Dialog>Dialog1
object Dialog1: TForm
Left = 576
Top = 266
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Progress Bar Example'
ClientHeight = 100
ClientWidth = 539
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object ProgressBar1: TProgressBar
Left = 19
Top = 17
Width = 499
Height = 17
TabOrder = 8
end
object btnStart: tMSButton
Left = 24
Top = 56
Width = 75
Height = 25
Caption = 'Start'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 9
DoBrowse = False
BrowseStyle = fbOpen
end
object btnClose: tMSButton
Left = 440
Top = 56
Width = 75
Height = 25
Caption = 'Close'
DoubleBuffered = True
ModalResult = 2
ParentDoubleBuffered = False
TabOrder = 12
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
//AddDialogHandler>Dialog1,btnStart,OnClick,DoProgress
AddDialogHandler>Dialog1,btnClose,OnClick,DoClose
GetDialogProperty>Dialog1,ProgressBar1,Min,intMin
GetDialogProperty>Dialog1,ProgressBar1,Max,intMax
Let>k=intMin
Show>Dialog1,r
If>r=2
Exit>0
Endif
SRT>DoProgress
// SetDialogProperty>Dialog1,btnStart,Enabled,False
Let>k=intMin
Repeat>k
Let>k=k+1
SetDialogProperty>Dialog1,ProgressBar1,Position,k
Wait>0.05
Until>k=intMax
SetDialogProperty>Dialog1,btnStart,Enabled,True
END>DoProgress
SRT>DoClose
Let>k=intMax
END>DoClose