View attachment 20121
Ecco un nuovo controllo facile da usare e utile, specie per me, una pulsantiera orizzontale infinita da 1 a x bottoni, lo stesso concetto poi lo usero per visualizzare le immagini, qui uso Button.
Ecco un nuovo controllo facile da usare e utile, specie per me, una pulsantiera orizzontale infinita da 1 a x bottoni, lo stesso concetto poi lo usero per visualizzare le immagini, qui uso Button.
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim imd As ClassMyDialog
Dim imt As ClassMyToolBar
Dim iml As ClassMyLayout
Dim imb As ClassMyButton
'
Dim btn(8) As Button
'
Dim act As Activity
Dim col1,col2 As Int
Dim Button1 As Button
'
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
iml.Initialize
iml.SettingLayout(Activity)
imd.Initialize(Colors.ARGB(220,50,100,150),Colors.black)
Dim btm1 As Button
btm1.Initialize("Event")
btm1.Text = "Android"
btm1.TextColor = Colors.Black
btm1.Background = imb.imageDrawable("i01.png")
btn(0) = btm1
Dim btm2 As Button
btm2.Initialize("Event")
btm2.Text = "Apple"
btm2.TextColor = Colors.Black
btm2.Background = imb.imageDrawable("i02.png")
btn(1) = btm2
Dim btm3 As Button
btm3.Initialize("Event")
btm3.Text = "Windows"
btm3.TextColor = Colors.Black
btm3.Background = imb.imageDrawable("i03.png")
btn(2) = btm3
Dim btm4 As Button
btm4.Initialize("Event")
btm4.Text = "Linux"
btm4.TextColor = Colors.Black
btm4.Background = imb.imageDrawable("i04.png")
btn(3) = btm4
Dim btm5 As Button
btm5.Initialize("Event")
btm5.Text = "Firefox"
btm5.TextColor = Colors.Black
btm5.Background = imb.imageDrawable("i05.png")
btn(4) = btm5
Dim btm6 As Button
btm6.Initialize("Event")
btm6.Text = "BlackBarry"
btm6.TextColor = Colors.Black
btm6.Background = imb.imageDrawable("i06.png")
btn(5) = btm6
' senza icone
Dim btm7 As Button
btm7.Initialize("Event")
btm7.Text = "1"
btm7.TextColor = Colors.Black
btm7.Typeface = Typeface.DEFAULT_BOLD
btn(6) = btm7
Dim btm8 As Button
btm8.Initialize("Event")
btm8.Text = "2"
btm8.TextColor = Colors.Black
btm8.Typeface = Typeface.DEFAULT_BOLD
btn(7) = btm8
Dim col(2) As Int
col(0) = Colors.ARGB(255,255,204,10)
col(1) = Colors.ARGB(255,224,180,13)
imt.Initialize(Activity,0,btn,64dip,64dip,col)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Event_Click
Dim bt As Button
bt = Sender
Dialog03Open(bt.Tag)
End Sub
Sub xbtn1_Click
imd.DialogClose()
End Sub
Sub xbtn2_Click
imd.DialogClose()
End Sub
Sub Liv_ItemClick (Position As Int, Value As Object)
imd.DialogClose()
End Sub
Sub Dialog03Open(s As String)
Dim xbtn1 As Button
xbtn1.Initialize("xbtn1")
xbtn1.Text = "Close 1"
Dim xbtn2 As Button
xbtn2.Initialize("xbtn2")
xbtn2.Text = "Close 2"
imd.Dialog02(Activity,"Alert","Finestra dialog 2 chiamata da " & s,xbtn1,xbtn2)
End Sub
Attachments
Last edited: