My workaroud works with any range (I hope). The previous was with 0-100, this is with 0-10:
Code: Select all
#include "FiveWin.ch"
function Main()
local oDlg, oProg1, oProg2
DEFINE DIALOG oDlg TITLE "Progress Bars"
@ 1, 1 PROGRESS oProg1 SIZE 80, 12
@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL
@ 3, 9 BUTTON "Ok" ACTION oDlg:End()
oDlg:bStart = { || Increase( oProg1, oProg2 ) }
ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( oProg1:SetRange( 0, 10 ),;
oProg2:SetRange( 0, 10 ) )
return nil
function Increase( oProg1, oProg2 )
local n
for n = 1 to 10
if n < oProg1:nMax
oProg1:SetPos( n + 1 )
oProg1:SetPos( n )
else
oProg1:SetRange( oProg1:nMin, oProg1:nMax + 1 )
oProg1:SetPos( oProg1:nMax )
oProg1:SetRange( oProg1:nMin, oProg1:nMax - 1 )
oProg1:SetPos( oProg1:nMax )
endif
if n < oProg2:nMax
oProg2:SetPos( n + 1 )
oProg2:SetPos( n )
else
oProg2:SetRange( oProg2:nMin, oProg2:nMax + 1 )
oProg2:SetPos( oProg2:nMax )
oProg2:SetRange( oProg2:nMin, oProg2:nMax - 1 )
oProg2:SetPos( oProg2:nMax )
endif
SysWait( 1.02 )
next
return nil
EMG