#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private ASTabMenu_horizontal As ASTabMenu
Private menuFunctions As TabMenuFunctions
Public pg1 As page1
Public pg2 As page2
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("frm_main")
B4XPages.SetTitle(Me,"AS Tab Menu Example V1.20")
pg1.Initialize
B4XPages.AddPage("Page 1", pg1)
pg2.Initialize
B4XPages.AddPage("Page 2", pg2)
menuFunctions.Initialize
mainMenu
End Sub
Sub mainMenu
ASTabMenu_horizontal.SelectedTabTextColor = xui.Color_Red
ASTabMenu_horizontal.BeginUpdate
ASTabMenu_horizontal.AddTab(xui.Color_White,"Menu1", _
menuFunctions.FontToBitmap(menuFunctions.UnicodeToString(0xF1028),True,30,xui.Color_BLACK),"")
ASTabMenu_horizontal.AddTab(xui.Color_White,"Menu2", _
menuFunctions.FontToBitmap(Chr(0xF179),False,30,xui.Color_BLACK),"")
ASTabMenu_horizontal.AddTab(xui.Color_White,"Menu3", _
menuFunctions.FontToBitmap(Chr(0xF11B),False,30,xui.Color_BLACK),"")
' ASTabMenu_horizontal.SetTab(0, True, True)
ASTabMenu_horizontal.EndUpdate
Sleep(0)
ASTabMenu_horizontal.CurrentTabUnderlineGravity = ASTabMenu_horizontal.CurrentTabUnderlineGravity_BOTTOMRIGHT
ASTabMenu_horizontal.TabStripMode = False
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub ASTabMenu_horizontal_TabClick(index As Int)
Select index
Case 0
Log("TabClick: " & index)
Case 1
Log("TabClick: " & index)
B4XPages.ShowPageAndRemovePreviousPages("page 1")
Case 2
Log("TabClick: " & index)
B4XPages.ShowPageAndRemovePreviousPages("page 2")
End Select
End Sub