Posted: Sun Sep 27, 2020 8:37 am Post subject: Progress bar (just visual)
Can someone make a simple program that when you press the button and the progress bar fills up gradually and when it reaches max it stays like full for 2 secs and goes back to empty, and when i press the button again it does the same. Please let me download it. Thanks.
-- create a Form with 1 button, 1 progressbar and 1 label
sck = UDF1.CEButton1
push = UDF1.CEProgressBar1
cum = UDF1.CELabel1
push.Min = 0
push.Max = 10
push.Step = 1
push.Position = 0
sck.Enabled = true
local i = 0
function sucker()
push.Position = i
cum.Caption = 'Cum on... '..i..' seconds'
i = i + 1
if i > 11 then
suck_timer.Enabled = false
sleep(2000)
cum.Caption = 'Cum on'
push.Position = 0
sck.Enabled = true
end
end
if f then f.destroy() end --UDF1 or CETrainer (Form)
f=createForm()
f.Position=poDesktopCenter
local pb=createProgressBar(f) -- UDF1.CEProgressbar1
pb.Left=35 pb.Top=50 pb.Width=250 pb.Max=100 pb.Position=0
local bt=createButton(f)
bt.Left=120 bt.Top=100 bt.caption="Start"
if t1 then t1.Destroy() end
t1=createTimer() --UDF1.Timer1
t1.Interval=100 t1.Enabled=false
if t2 then t2.Destroy() end
t2=createTimer() --UDF1.Timer2
t2.Interval=12000 -- + 2 sec and start or 14000 + 4 sec
t2.Enabled=false
local pbIndex=1
t1.OnTimer=function() --function UDF1_Timer1Timer(sender)
if pbIndex==1 then
pb.Position=pb.Position + 1
bt.caption="% "..tonumber(pb.Position)
if pb.Position==100 then t1.Enabled=false end
end
if pbIndex==2 then
pb.Position=pb.Position - 1
bt.caption="% "..tonumber(pb.Position)
if pb.Position==0 then bt.caption="Start" t1.Enabled=false end
end
end
t2.OnTimer=function() --function UDF1_Timer2Timer(sender)
pbIndex=2
t2.Enabled=false
t1.Enabled=true
end
bt.OnClick=function() --function UDF1_Button1Click(sender)
pbIndex=1
t1.Enabled=true
t2.Enabled=true
end
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum