AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1528
|
Posted: Tue Jun 25, 2024 4:59 pm Post subject: |
|
|
For now this doesn't seem possible.
Test the code below.
| Code: | function createShape(Parent)
local sh = createComponentClass('TShape', Parent)
sh.Parent = Parent
return sh
end
if f2 then f2.destroy() end
f2 = createForm()
f2.Left = 318
f2.Height = 270
f2.Top = 247
f2.Width = 520
f2.Caption = 'Custom Progress Bar With Color Lerp'
TrackBar1 = createTrackBar(f2)
TrackBar1.Left = 42
TrackBar1.Height = 45
TrackBar1.Top = 30
TrackBar1.Width = 338
TrackBar1.Max = 100
TrackBar1.Position = 0
Shape1 = createProgressBar(f2)
Shape1.Left = 42
Shape1.Height = 45
Shape1.Top = 80
Shape1.Width = 340
Shape1.Visible=false
Shape1.Max = 100
TrackBar2 = createTrackBar(f2)
TrackBar2.Left = 42
TrackBar2.Height = 45
TrackBar2.Top = 140
TrackBar2.Width = 338
TrackBar2.Max = 100
TrackBar2.Position = 0
Shape2 = createProgressBar(f2)
Shape2.Left = 42
Shape2.Height = 45
Shape2.Top = 190
Shape2.Width = 340
Shape2.Visible=false
Shape2.Max = 100
---------------------------------------------
function createClrText(ownrF,ownrP,clr,fntSz)
local Sh2 = createShape(ownrF)
Sh2.Left = ownrP.Left
Sh2.Height = ownrP.Height
Sh2.Top = ownrP.Top
Sh2.Width = 0
Sh2.Brush.Color = clr
return Sh2
end
Shape1.Position = 0
Shape2.Position = 0
shp2 = createClrText(f2,Shape2,0xffff00,15)
shp1 = createClrText(f2,Shape1,0x00ff00,15)
----------------------------------------------
ss1 = createLabel(f2)
ss1.Left = Shape1.Left + Shape1.Width / 2 - 15
ss1.Top = Shape1.Top + Shape1.Height / 2 - 8
ss1.Font.Color = 0
ss1.Font.Size = 12
ss2 = createLabel(f2)
ss2.Left = Shape2.Left + Shape2.Width / 2 - 15
ss2.Top = Shape2.Top + Shape2.Height / 2 - 8
ss2.Font.Color = 0
ss2.Font.Size = 12
-----------------------------------------------
function shapePst(s1,s2,s3)
wd = s2.Width / Shape1.Max
s1.Width = s2.Position * wd
s3.Caption = tostring(s2.Position.."%")
end
function TrackBar1Change()
Shape1.Position = TrackBar1.Position
shapePst(shp1, Shape1, ss1)
end
function TrackBar2Change()
Shape2.Position = TrackBar2.Position
shapePst(shp2, Shape2, ss2)
end
TrackBar1.OnChange = TrackBar1Change
TrackBar2.OnChange = TrackBar2Change
f2.show() |
In your form it's used like this:
| Code: | UDF1.CEProgressbar1.Position = 0
UDF1.CEProgressbar1.Max = 100
UDF1.CETrackBar1.Position = 0
UDF1.CETrackBar1.Max = 100
---------------------------------------------
function createShape(Parent)
local sh = createComponentClass('TShape', Parent)
sh.Parent = Parent
return sh
end
function createClrText(ownrF,ownrP,clr)
local Sh2 = createShape(ownrF)
Sh2.Left = ownrP.Left
Sh2.Height = ownrP.Height
Sh2.Top = ownrP.Top
Sh2.Width = 0
Sh2.Brush.Color = clr
return Sh2
end
---------------------------------------------
shp1 = createClrText(UDF1,UDF1.CEProgressbar1,0xffff00)
shp1.sendToBack()
UDF1.CELabel1.bringToFront()
UDF1.CEProgressbar1.Visible = false
----------------------------------------------
function shapePst(s1,s2,s3)
wd = s2.Width / Shape1.Max
s1.Width = s2.Position * wd
s3.Caption = tostring(s2.Position.."%")
end
------------------------------------------
UDF1.CETrackBar1.OnChange=function(sender)
UDF1.CEProgressbar1.Position = UDF1.CETrackBar1.Position
shapePst(shp1,UDF1.CEProgressbar1,UDF1.CELabel1)
end
UDF1.show() |
_________________
|
|