B4J Library [XUI] [B4X] SD_CosmosMenu

1.gif
v2.gif


Log
Rel. 1.01
Possibility to choose whether to add a light effect or not​
Rel. 1.02
Possibility to insert the first sphere in the center​
Rel. 1.03
Button animated​

SD_CosmosMenu

Author:
Star-Dust
Version: 1.03
  • SD_CosmosMenu
    • Events:
      • Click (ID As String)
      • LongClick (ID As String)
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • Class_Globals As String
      • Clear As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetBase As B4XView
      • GetItemType (Id As String) As String
      • Initialize (Callback As Object, EventName As String) As String
      • Invalidate As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveItem (id As String, ForceRefresh As Boolean) As String
      • SetItem (Id As String, Text As String, TextFont As B4XFont, LightEffect As Boolean, ForceRefresh As Boolean) As String
      • SetItemImage (Id As String, Image As B4XBitmap, LightEffect As Boolean, ForceRefresh As Boolean) As String
      • Snapshot As B4XBitmap
    • Properties:
      • BallDiameter As Int
      • Height As Int
      • Left As Int
      • RotateDegree As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int
 

Attachments

  • SD_CosmosMenu 1.03.zip
    9.7 KB · Views: 38
  • jSD_CosmosMenu 1.03.zip
    10.2 KB · Views: 28
  • iSD_CosmosMenu 1.03.zip
    132.8 KB · Views: 29
Last edited:

Star-Dust

Expert
Licensed User
Example

B4X:
For i=1 To 4
    SD_CosmosMenu1.SetItem(i,"Prova " & I,xui.CreateDefaultFont(14),True,True)
Next

SD_CosmosMenu1.SetItemImage(6,xui.LoadBitmap(File.DirAssets,"cocacola.png"),False,True)
SD_CosmosMenu1.SetItemImage(7,xui.LoadBitmap(File.DirAssets,"barilla.png"),False,True)

' rotate
For i=0 To 72
    SD_CosmosMenu1.RotateDegree=i*5
    Sleep(100)
Next

B4X:
Private Sub SD_CosmosMenu1_Click (ID As String)
    Log(ID)
End Sub

' in B4J it is raised when you click the right mouse button
Private Sub SD_CosmosMenu1_LongClick (ID As String)
    Log("long:  & ID)
End Sub
 

Attachments

  • SampleCosmosMenu.zip
    28.7 KB · Views: 57
  • jCosmosMenuSample.zip
    22.3 KB · Views: 52
  • iCosmosMenuSample.zip
    22.7 KB · Views: 48
Last edited:

Star-Dust

Expert
Licensed User
Update 1.01
  • Added parameter to choose if you want the light effect.
  • Added ios version
  • Updated examples
 

Magma

Well-Known Member
Licensed User
Longtime User
let's say we have in endless rotating... in B4J...
is it possible to click an item when rotating - or must be out of loop (stopped) ?

B4X:
    Do While exitf=False
        i=i+1
        SD_CosmosMenu1.RotateDegree=i*5
        Sleep(50)
        If i>72 Then i=0
    Loop
 

Star-Dust

Expert
Licensed User
let's say we have in endless rotating... in B4J...
is it possible to click an item when rotating - or must be out of loop (stopped) ?

B4X:
    Do While exitf=False
        i=i+1
        SD_CosmosMenu1.RotateDegree=i*5
        Sleep(50)
        If i>72 Then i=0
    Loop
I tried, but the click doesn't seem to be in focus while the views are in motion.

But it may be that in future updates I will be able to achieve something like this
 

Magma

Well-Known Member
Licensed User
Longtime User
I tried, but the click doesn't seem to be in focus while the views are in motion.

But it may be that in future updates I will be able to achieve something like this
or you can have _MouseMoved (EventData As MouseEvent) or _MouseEntered... at least to stop it manual and then click... and if out of circles... start again rotating..

Excellent work - by the way, as always!
 

Star-Dust

Expert
Licensed User
Update 1.03
  • Button animated
2.gif
 
Last edited:
Top