B4A Library SD: Menu (with Animation)

(No WRAP, No Java Only B4A)

Guillotine
is just a swivel guillotine panel that could accommodate a menu but also a panel with all sorts of views.
The RollOut Menu and Side Menu are instead menus as you see in the Third Example. There is also a video in post # 6
TreeMenu (Tree ListView): This class allows you to enter a ListView type menu and clicking each item opens a submenu with its entries (if any) and raises the click event

SD_Menu

Author:
Star-Dust
Version: 0.07
  • GhigliottinaPanel
    • Fields:
      • Panel As Panel
      • View As View
    • Functions:
      • Class_Globals As String
      • Close (Animation As Boolean) As String
      • GetPanelBase As Panel
      • GetPanelMenu As Panel
      • Initialize (EventName As String, Me_CallBack As Object) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • IsOpen As Boolean
      • Open (Animation As Boolean) As String
      • SetMenuButtonDark As String
      • SetMenuButtonLight As String
      • SetPanelColor (Color As Int) As String
      • SetTextMenu (Message As String) As String
      • SetTextMenuColor (Color As Int) As String
  • GhigliottinaView
    • Events:
      • Click
      • LongClick
    • Fields:
      • Panel As Panel
    • Functions:
      • AddPanel (MyPanel As Panel) As String
      • Class_Globals As String
      • Close (Animation As Boolean) As String
      • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
      • GetPanelBase As Panel
      • GetPanelMenu As Panel
      • Initialize (vCallback As Object, vEventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • IsOpen As Boolean
      • Open (Animation As Boolean) As String
      • SetMenuButtonDark As String
      • SetMenuButtonLight As String
      • SetPanelColor (Color As Int) As String
      • SetTextMenu (Message As String) As String
      • SetTextMenuColor (Color As Int) As String
  • MenuTree
    • Events:
      • Click (MenuName As String, ID As String)
    • Fields:
      • BackGroundColor As Int
      • ExpandableList As List
      • ImageCloseMenu As Bitmap
      • ImageOpenMenu As Bitmap
      • LeafColor As Int
      • OpenOneOnlyMenu As Boolean
      • TextColor As Int
      • TreeColor As Int
    • Functions:
      • AddMenuVoice (Name As String, ID As String, Expanded As Boolean) As String
      • AddRoot (Name As String) As String
      • AddSubMenuVoice (Name As String, ID As String, IDMenuVoice As Int) As String
      • Class_Globals As String
      • ClearMenu As String
      • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
      • GetBase As Panel
      • Initialize (vCallback As Object, vEventName As String) As String
      • Invalidate As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
  • RollOutMenu
    • Events:
      • Click (ID As String)
    • Fields:
      • IsOpen As Boolean
      • TimeAnimation As Int
    • Functions:
      • AddImageButton (Bitmap As Bitmap, ID As String) As String
      • Class_Globals As String
      • Close (Animation As Boolean)
      • GetPanel As Panel
        If you want Add into Panel USE After Initialize
      • Initialize (EventaName As String, Me_CallBack As Object, LeftStick As Boolean, HightWidh As Int) As String
        Initializes the object. You can add parameters to this method if needed.
        RollOut.Initialize("Roll",Me,Activity,True,60dip)
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Open (Animation As Boolean)
  • SideMenu
    • Events:
      • Click (ID As String)
    • Fields:
      • IsOpen As Boolean
      • TimeAnimation As Int
    • Functions:
      • AddImageButton (Bitmap As Bitmap, ID As String) As String
      • Class_Globals As String
      • Close (Animation As Boolean)
      • GetPanel As Panel
      • Initialize (EventaName As String, Me_CallBack As Object, LeftStick As Boolean, HightWidh As Int) As String
        Initializes the object. You can add parameters to this method if needed.
        RollOut.Initialize("Roll",Me,Activity,True,60dip)
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Open (Animation As Boolean)
  • Versione02
    Code module
    Subs in this code module will be accessible from all modules.
    • Fields:
      • Demo As Boolean
    • Functions:
      • Process_Globals As String


3.gif 4.png 5.png1.gif 2.gif
 

Attachments

  • example1.zip
    7 KB · Views: 861
  • example2.zip
    8.4 KB · Views: 809
  • Example3.zip
    20.9 KB · Views: 796
  • Example4.zip
    8.2 KB · Views: 504
  • SD_Menu 0.07.zip
    39.3 KB · Views: 574
Last edited:

Guenter Becker

Active Member
Licensed User
Hi,
set the colors from the Design. download latest version. Use XUI colors.

1st my lib version is 0.06
2nd setting Property Menu Back color in the designer to color white - > color remains gray
3rd setting MenueTree1.GetBase.Color=xui.colors.white -> color remains gray
4th setting MenueTree1.GetBase.Background=white (white = drawable with white color) -> color remains gray
 

Star-Dust

Expert
Licensed User
Longtime User
1st my lib version is 0.06
2nd setting Property Menu Back color in the designer to color white - > color remains gray
3rd setting MenueTree1.GetBase.Color=xui.colors.white -> color remains gray
4th setting MenueTree1.GetBase.Background=white (white = drawable with white color) -> color remains gray
Thanks for your numbered comments.
I have confused this library with the newer cross-platform. (SD_TreeList)
I'll answer your comments.

1st Changing the properties to MenuTree1.GetBase will have no effect because there are other views that cover the base, the ones that make up the tree.
2nd It is not foreseen, therefore it is not possible, to change the bottom of the views that form the tree.
3rd This library is unlikely to be updated which is now over three years old and an XUI version exists. multi-platform.
4th You can change the background color only with the Background property of the design. But I don't think this is what you are looking for. (In this example I have changed the background to red)

1602510666653.png

5th I hope I have answered your questions

6th Best regards
 
Last edited:

Guenter Becker

Active Member
Licensed User
Thanks for your numbered comments.
I have confused this library with the newer cross-platform. (SD_TreeList)
I'll answer your comments.

1st Changing the properties to MenuTree1.GetBase will have no effect because there are other views that cover the base, the ones that make up the tree.
2nd It is not foreseen, therefore it is not possible, to change the bottom of the views that form the tree.
3rd This library is unlikely to be updated which is now over three years old and an XUI version exists. multi-platform.
4th You can change the background color only with the Background property of the design. But I don't think this is what you are looking for. (In this example I have changed the background to red)

View attachment 101377

5th I hope I have answered your questions

6th Best regards


You are right but as you see in yout image the menu is still gray and that is what I want to change. I know your fine SD_Treelist and I remember we had discussions about this. Before using this I used SD_Treelist but I throw it away after I saw that the line height of the items is fixed and if you use a textsize bigger 14 the letters bottom is truncen.

Stay well.
 

Star-Dust

Expert
Licensed User
Longtime User
You are right but as you see in yout image the menu is still gray and that is what I want to change. I know your fine SD_Treelist and I remember we had discussions about this. Before using this I used SD_Treelist but I throw it away after I saw that the line height of the items is fixed and if you use a textsize bigger 14 the letters bottom is truncen.

Stay well.
Now I remember... Unfortunately, even in this class it is not possible to change the height of the leaves.

Last time I said that my answer sounds bad and this time you made a numbered list of observations. Maybe a friendlier way gets better results.

I have updated the library to version 0.07 with the changes you need.
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.07
MenuTree - Ability to change color of the text and background of the leaves​
 

Guenter Becker

Active Member
Licensed User
Now I remember... Unfortunately, even in this class it is not possible to change the height of the leaves.

Last time I said that my answer sounds bad and this time you made a numbered list of observations. Maybe a friendlier way gets better results.

I have updated the library to version 0.07 with the changes you need.

Please do not worry to be unfriendly was not my intention! I used a numbered list to make myself clear to the reader and not to be unfriendly. Sorry.
Stay well and please where to get Version 0.7?
Greetings Guenter
 

Star-Dust

Expert
Licensed User
Longtime User
Please do not worry to be unfriendly was not my intention! I used a numbered list to make myself clear to the reader and not to be unfriendly. Sorry.
Stay well and please where to get Version 0.7?
Greetings Guenter
Post #1
 

Star-Dust

Expert
Licensed User
Longtime User
for the rollout menu, how I can set the menu position?
You can only select whether it will appear on the right or left of the screen. There are no other positions. This is due to the particular type of animation on the menu
 

Star-Dust

Expert
Licensed User
Longtime User
how about the set top position?
I'm not sure I understand what you mean. The first button starts from the Left, top (0,0) position, the following ones follow downwards
 

syerif

Active Member
Licensed User
Longtime User
I'm not sure I understand what you mean. The first button starts from the Left, top (0,0) position, the following ones follow downwards
I mean, for menu appear on left or right only ok, but it is possible to set roll-out menu top position just like a view ex. button.top, and how to set roll-out menu for specific panel
 

Star-Dust

Expert
Licensed User
Longtime User
I mean, for menu appear on left or right only ok, but it is possible to set roll-out menu top position just like a view ex. button.top, and how to set roll-out menu for specific panel
I'm sorry but it's not possible. The menu starts with the first button with the top position = 0.
 
Top