B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=9.85
@EndOfDesignText@
#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_NAME%.zip

'B4A ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=start&Args=..\..\B4A\%PROJECT_NAME%.b4a 
'B4i ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=start&Args=..\..\B4i\%PROJECT_NAME%.b4i 
'B4J ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=start&Args=..\..\B4J\%PROJECT_NAME%.b4j

Sub Class_Globals
	Private Root As B4XView
	Private xui As XUI
	
	Private cbtTest10 As xCustomButton
End Sub

Public Sub Initialize
'	B4XPages.GetManager.LogEvents = True
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
	Root = Root1
	Root.LoadLayout("Main")
	
	B4XPages.SetTitle(B4XPages.MainPage, "xCustomButtonDemo")
	
	'adds a button in the code
	cbtTest10.Initialize(Me, "cbtTest")
	cbtTest10.AddToParent(Root, 100dip, 100dip, 60dip, 60dip, xui.Color_RGB(0, 0, 139), Chr(0xE855), "Test 10")
	cbtTest10.Tag = 10
	cbtTest10.PressedColor = xui.Color_ARGB(96, 255, 0 ,0)
End Sub

Private Sub cbtTest_Click
	Private cbt As xCustomButton
	Private Index As Int
	
	cbt = Sender
	Index = cbt.Tag
	
	Select Index
		Case 1
			Log("cbtTest1_Click")
		Case 2
			Log("cbtTest2_Click")
		Case 10
			Log("cbtTest10_Click")
			cbtTest10.IconFont = xui.CreateFontAwesome(10)
			cbtTest10.Icon = Chr(0xF1FE)
			cbtTest10.LabelFont = xui.CreateDefaultFont(14)
		Case Else
			Log("cbtTest" & Index & "_Click")
	End Select
End Sub

Private Sub cbtTest_LongClick
	Private cbt As xCustomButton
	Private Index As Int
	
	cbt = Sender
	Index = cbt.Tag
	
	Select Index
		Case 1
			Log("cbtTest1_LongClick")
			
		Case 2
			Log("cbtTest2_LongClick")
		Case 10
			Log("cbtTest10_LongClick")
		Case Else
			Log("cbtTest" & Index & "_LongClick")
	End Select
End Sub

Private Sub tbtTest1_CheckedChange(Checked As Boolean)
	If Checked = True Then
		Log("tbtTest1_ON")
	Else
		Log("tbtTest1_OFF")
	End If
End Sub
