Nov 23, 2021 Replies: 8 I took the original B4XSeekBar code from @Erel and modified it to create a new view. I spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it here by Paypal or with a coffee. Code: Copy For i = 0 To 4 -1 ASStepSeekBar1.AddStep(xui.Color_White,"Item " & (i)) ASStepSeekBar2.AddStep(xui.Color_White,"Item " & (i)) Next ASStepSeekBar Author: Alexander Stolte Version: 1.00 ASStepSeekBar Events: TouchStateChanged (Pressed As Boolean) ValueChanged (Index As Int, Value As Object) Fields: Interval As Int mBase As B4XView Radius1 As Int Radius2 As Int ReachedLineColor As Int ReachedLineSize As Int Tag As Object ThumbColor As Int UnreachedLineColor As Int UnreachedLineSize As Int Functions: AddStep (Color As Int, Value As Object) As String Class_Globals As String CreateASStepSeekBar_Step (Value As Object, Color As Int) As ASStepSeekBar_Step DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String Base type must be Object getSize As Int Gets the count of steps GetStepValue (Index As Int) As Object Get a value from a step Initialize (Callback As Object, EventName As String) As String IsInitialized As Boolean Tests whether the object has been initialized. setStepIndex (Index As Int) As String Update As String Redraws the control Properties: StepIndex ASStepSeekBar_Step Fields: Color As Int IsInitialized As Boolean Tests whether the object has been initialized. Value As Object Functions: Initialize Initializes the fields to their default value. Changelog 1.00 Release 1.01 minor adjustments Base_Resize is public now 1.02 Add get StepIndex 1.03 Add Clear - Clear all steps Hitbox improved - you can now simply tap on the line and the item that is closer to it will be selected 1.04 BugFix 1.05 BugFixes on the vertical seekbar Add AddStep2 with ReachedColor and UnreachedColor parameter Have Fun Attachments AS StepSeekBar Example.zip AS StepSeekBar Example.zip 10.7 KB · Views: 930 ASStepSeekBar.b4xlib ASStepSeekBar.b4xlib 2.7 KB · Views: 560 Last edited: Sep 19, 2024 Click to expand...
I took the original B4XSeekBar code from @Erel and modified it to create a new view. I spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it here by Paypal or with a coffee. Code: Copy For i = 0 To 4 -1 ASStepSeekBar1.AddStep(xui.Color_White,"Item " & (i)) ASStepSeekBar2.AddStep(xui.Color_White,"Item " & (i)) Next ASStepSeekBar Author: Alexander Stolte Version: 1.00 ASStepSeekBar Events: TouchStateChanged (Pressed As Boolean) ValueChanged (Index As Int, Value As Object) Fields: Interval As Int mBase As B4XView Radius1 As Int Radius2 As Int ReachedLineColor As Int ReachedLineSize As Int Tag As Object ThumbColor As Int UnreachedLineColor As Int UnreachedLineSize As Int Functions: AddStep (Color As Int, Value As Object) As String Class_Globals As String CreateASStepSeekBar_Step (Value As Object, Color As Int) As ASStepSeekBar_Step DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String Base type must be Object getSize As Int Gets the count of steps GetStepValue (Index As Int) As Object Get a value from a step Initialize (Callback As Object, EventName As String) As String IsInitialized As Boolean Tests whether the object has been initialized. setStepIndex (Index As Int) As String Update As String Redraws the control Properties: StepIndex ASStepSeekBar_Step Fields: Color As Int IsInitialized As Boolean Tests whether the object has been initialized. Value As Object Functions: Initialize Initializes the fields to their default value. Changelog 1.00 Release 1.01 minor adjustments Base_Resize is public now 1.02 Add get StepIndex 1.03 Add Clear - Clear all steps Hitbox improved - you can now simply tap on the line and the item that is closer to it will be selected 1.04 BugFix 1.05 BugFixes on the vertical seekbar Add AddStep2 with ReachedColor and UnreachedColor parameter Have Fun
Alexander Stolte Expert Licensed User Longtime User Nov 23, 2021 #3 Rubsanpe said: Great work. Donation done. Rubén Click to expand... thank you very much!
Alexander Stolte Expert Licensed User Longtime User Nov 19, 2023 #4 Update 1.01 minor adjustments Base_Resize is public now Base_Resize is public You should call it in B4A after modifying B4XSeekBar.mBase size (it is called automatically in B4i, B4J). B4X: Copy ASStepSeekBar2.mBase.Width = 250dip ASStepSeekBar2.Base_Resize(ASStepSeekBar2.mBase.Width, ASStepSeekBar2.mBase.Height)
Update 1.01 minor adjustments Base_Resize is public now Base_Resize is public You should call it in B4A after modifying B4XSeekBar.mBase size (it is called automatically in B4i, B4J). B4X: Copy ASStepSeekBar2.mBase.Width = 250dip ASStepSeekBar2.Base_Resize(ASStepSeekBar2.mBase.Width, ASStepSeekBar2.mBase.Height)
Alexander Stolte Expert Licensed User Longtime User Feb 20, 2024 #5 Update 1.02 Add get StepIndex Apparently nobody has needed the current index for the last 2 years. lol
Update 1.02 Add get StepIndex Apparently nobody has needed the current index for the last 2 years. lol
Alexander Stolte Expert Licensed User Longtime User Feb 29, 2024 #6 Update 1.03 Add Clear - Clear all steps Hitbox improved - you can now simply tap on the line and the item that is closer to it will be selected
Update 1.03 Add Clear - Clear all steps Hitbox improved - you can now simply tap on the line and the item that is closer to it will be selected
Alexander Stolte Expert Licensed User Longtime User Sep 19, 2024 #8 Update 1.05 BugFixes on the vertical seekbar Add AddStep2 with ReachedColor and UnreachedColor parameter
Update 1.05 BugFixes on the vertical seekbar Add AddStep2 with ReachedColor and UnreachedColor parameter
Ferdari Active Member Licensed User Longtime User Sep 20, 2024 #9 Alexander Stolte said: Update 1.05 BugFixes on the vertical seekbar Add AddStep2 with ReachedColor and UnreachedColor parameter Click to expand... You are the best Alex! Thank you!?? I bought your library Wheelpicker as im needing it. Very good work! Last edited: Sep 20, 2024
Alexander Stolte said: Update 1.05 BugFixes on the vertical seekbar Add AddStep2 with ReachedColor and UnreachedColor parameter Click to expand... You are the best Alex! Thank you!?? I bought your library Wheelpicker as im needing it. Very good work!