Hi guys, I'm happy to share, this library LMenu.
This library allows creating horizontal slider special menus
Features:
-Allows multiple rows of buttons/icons.
-Similar presentation to the Metro interface.
-Dynamic icons, you can allow the user place the buttons/icons where the preference at runtime.
-Create, delete, touch move and hide menu buttons/icons at runtime.
This Library doesn't need additional librarys.
This Library need b4android 3.8.2 version or higher.
Any idea, comment or thanks, will be appreciated.
LMenu
Author: Logic Data
Web: www.logicdata.es
Version: 1.0
This library allows creating horizontal slider special menus
Features:
-Allows multiple rows of buttons/icons.
-Similar presentation to the Metro interface.
-Dynamic icons, you can allow the user place the buttons/icons where the preference at runtime.
-Create, delete, touch move and hide menu buttons/icons at runtime.
This Library doesn't need additional librarys.
This Library need b4android 3.8.2 version or higher.
Any idea, comment or thanks, will be appreciated.
LMenu
Author: Logic Data
Web: www.logicdata.es
Version: 1.0
- LMenu
Events:
- Click ()
- LongClick ()
Methods:
- ButtonsClickAnimation (Animate As Boolean)
Activate/Deactivate Buttons Click Animation - CreateMenu (Parent As Activity, Left As Int, Top As Int, Width As Int, Height As Int, ButtonsHor As Int, ButtonsVer As Int, ActivateEdition As Boolean)
Create Menu Object in the activity. - GetButtons As Map
Get Map of menu buttons. - Initialize (YourActivityModule As Object, EventName As String)
Initializes the Menu. - IsInitialized As Boolean
- ButtonsClickAnimation (Animate As Boolean)
- ButtonAdd (Tittle As String, Horizontalpos As Int, Verticalpos As Int, BackColor As Int, FolderPath As String, MainImage As String, ImageSec As String)
Adds Button. - ButtonAdd2 (Tittle As String, Horizontalpos As Int, Verticalpos As Int, BackColor As Int)
Adds Button without images. - ButtonGetIndex (Tittle As String) As Int
Get the index of button. - ButtonGetTittle (Index As Int) As String
Get the tittle of button. - ButtonRemove (Index As Int)
Remove/Delete a button.
- ButtonAdd (Tittle As String, Horizontalpos As Int, Verticalpos As Int, BackColor As Int, FolderPath As String, MainImage As String, ImageSec As String)
Properties:
- BackGroundMenu As Int [write only]
Sets menu background color - ButtonsClickAnimation (Animate As Boolean)
Activate/Deactivate Buttons Click Animation - ButtonMainImageSize As Int [write only]
Sets button main image size - ButtonSecImageSize As Int [write only]
Sets button secundary image size - Isvisible As Boolean[read only]
Get the visibility menu status - LabelButtonTextSize As Int [write only]
Sets button text size - LabelButtonTextBackColor As Int [write only]
Sets button text back colour - LabelButtonTextTypeface As Typeface [write only]
Sets button text typeface - MaxHorizontalButtons As Int [write only]
Set the maximum number of horizontal buttons - Visible (Makevisible As Boolean)
Make visible/invisible the menu - VisibleScrollBar (Visibility As Boolean)
Make visible/invisible the Menu Scroll Bar
- BackGroundMenu As Int [write only]
- ButtonEnabled (Index As Int, Enabled As Boolean)
Enable/Disable a menu button. - ButtonIsVisible (Index As Int)As Boolean
Get the visibility status of button. - ButtonVisible (Index As Int, IsButtonVisible As Boolean)
Make the visibility status of button. - ButtonSelected As Int [read only]
Get last selected button. - ButtonsCount As Int [read only]
Get the number of buttons.
- ButtonEnabled (Index As Int, Enabled As Boolean)
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TheMenu As LMenu
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
TheMenu.Initialize(Me,"TheMenu")
TheMenu.ButtonAdd2("Reports",1,1,Colors.Magenta)
TheMenu.ButtonAdd("Contacts",2,1,Colors.Gray,File.DirAssets,"address_book.png","button-cross-red-48.png")
TheMenu.ButtonAdd("Messages",3,2,Colors.Gray,File.DirAssets,"balloon-red-48.png","")
TheMenu.BackGroundMenu=Colors.Transparent
TheMenu.LabelButtonTextBackColor=Colors.Yellow
TheMenu.LabelButtonTextColor=Colors.Black
TheMenu.MaxHorizontalButtons=4
TheMenu.CreateMenu(Activity,0,40,480,400,2,3,False)
TheMenu.ButtonsClickAnimation(True)
End Sub
Sub TheMenu_ButtonClick
Msgbox(TheMenu.ButtonGetTitle(TheMenu.ButtonSelected),"")
End Sub
Attachments
Last edited: