B4A Library [B4X] [XUI] SD AwesoneWheel

Star-Dust

Expert
Licensed User
SD_XUI_AwesoneWheel

Author: Star-Dust
Version: 0.05
  • AwesoneWheel
    • Events:
      • StopWheel (Index As Int, Value As String)
    • Fields:
      • Degree As Int
      • TextSize As Int
      • TimeLapseTick As Int
        Time frame that the wheel takes to cross each box - Defaults is 60 (milliseconds)
      • RadiusCentralBall As Int
        Default is 40dip (for B4J 40)
    • Functions:
      • AddItem (Voice As String, Color As Int) As String
        Add a single voice on Wheel
      • Class_Globals As String
      • Clear As String
        Clear all item
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • PlayWheel (NewPosition As Int)
        Start the wheel and position in a NewPosition - with animation
      • setIndex (Position As Int) As String
      • setText (Text As String) As String
        Set a Text on Play of Wheel - Default = "PLAY"
    • Properties:
      • Index As Int
        Get or Set a positionì of Wheel - wit-out animation
      • Text As String
        Get or Set a Text on Play of Wheel - Default = "PLAY"

Video1.gif
 

Attachments

Last edited:

Star-Dust

Expert
Licensed User
Update to rel. 0.02 - fix bug
 
Last edited:

Star-Dust

Expert
Licensed User
Awesome, indeed.
Can I change the "Play" text?
Update Library (and Sample) to version 0.03

  1. Text Field - Added the possibility to change the text Play to the wheel
  2. PlayWheel - This method that changes the position to the wheel with Animation
 

Mahares

Well Known Member
Licensed User
Update Library (and Sample) to version 0.03
@Star-Dust: You are really becoming a powerhouse in this forum. You are following in the footsteps of the genius @Informatix who delivers pure B4X libraries without any wrapping or java:
1. When you use a smaller text size, the center piece covers part of it unless you prefix it with blank spaces. See snapshot.
2. When you use say 'EXECUTE' instead of 'Play' the center circle is not large enough, hence the word is wrapped around.
3. AwesoneWheel1.PlayWheel(4) stops it at the 4th item instead of the 5th. Aren't you using base 0.
4. Can you change the time the wheel spins.
Can you please check the above issues.

upload_2018-7-31_15-59-9.png
 

Star-Dust

Expert
Licensed User
@Star-Dust: You are really becoming a powerhouse in this forum. You are following in the footsteps of the genius @Informatix who delivers pure B4X libraries without any wrapping or java:
1. When you use a smaller text size, the center piece covers part of it unless you prefix it with blank spaces. See snapshot.
2. When you use say 'EXECUTE' instead of 'Play' the center circle is not large enough, hence the word is wrapped around.
3. AwesoneWheel1.PlayWheel(4) stops it at the 4th item instead of the 5th. Aren't you using base 0.
4. Can you change the time the wheel spins.
Can you please check the above issues.

View attachment 70524
Thank you, but I'm not so good I have the same knowledge of @Informatix. He also knows java well, unfortunately I do not.

1) I am aware of the problem I have not found a simple solution yet
2) Yes, the central circle can not be enlarged at the moment, perhaps at the next update
3) the position starts from zero. So 4 corresponds to 5.
4) the time can be modified in the next update
 

Mahares

Well Known Member
Licensed User
the position starts from zero. So 4 corresponds to 5.
As it is, AwesoneWheel1.PlayWheel(4) stops at the 4th item when it should stop at the 5th.
I know English is not your native, but should it not be named: AwesomeWheel
 

Star-Dust

Expert
Licensed User
Update Library (and Sample) to version 0.04

  1. TimeLapse Field - Time frame that the wheel takes to cross each box - Defaults is 60 (milliseconds)
  2. FIX BUGS of PlayWheel
 
Last edited:

asales

Well-Known Member
Licensed User
Another little issue:
with 8 parts (like the example), the sections and texts is centered, but If I use more or less parts, they are not.
See the image in attached, with the wheel 2 (4 parts) and 3 (12 parts).
wheel1.png
 

Star-Dust

Expert
Licensed User
Update Library (and Sample) to version 0.05

  1. Fixed bugs when decreasing text size. The central sphere no longer covers the text
  2. Possibility to change the size of the central sphere (add RadiusCentralBall field)
  3. Improved text centralization when the segments are odd
  4. Correct centralization of the segments
 

asales

Well-Known Member
Licensed User
Two questions:

1 - I see the StopWheel event, but how I can get a PlayWheel event (not the function) when I click in the Play button, like this:
B4X:
Sub AwesoneWheel1_PlayWheel
   Log("started")
End Sub
2 - How I can change the time to keep the wheel in rotate state, without increase the TimeLapseTick, that turn slow to cross each cell?
I have 10 items in the wheel and I want to keep the wheel rotate fast for 10 seconds minimun. If I increase the TimeLapseTick the wheel run too slow.

Thanks in advance.
 
Last edited:

Star-Dust

Expert
Licensed User
  1. At the moment there is no event that is raised when you click Play. It could be possible in the future
  2. This is more complex, you would like a rotation with a different step but with the same duration.Changing this is complex and needs to be changed inside. I do not know if it will be possible in the future
  3. Being a free library even if I will provide assistance, you will receive few updates. And I will hardly add more features
 
Last edited:
Top