Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private InfoWindowList As List
Private TextEngine As BCTextEngine
Private BBCodeView1 As BBCodeView
Private Action1 As B4XView
Private InfoWinPanel As B4XView
Private Label1 As B4XView
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
TextEngine.Initialize(Root)
InfoWindowList.Initialize
End Sub
Sub Button1_Click
ShowInfo(1, "aaaa [b]Testtext[/b] aaaa aaa.")
End Sub
Sub Button2_Click
ShowInfo(2, "bbb [b]AnotherText[/b] bbbb bbb.")
End Sub
Sub ShowInfo(Index As Int, Text1 As String )
If Index > InfoWindowList.size Then
Dim vx As B4XView = CreateInfoWindow(Index, "Window #" & Index, Text1, 300dip, 200dip)
Root.AddView(vx, 10dip, 10dip, vx.Width, vx.Height)
Private dvP As dragview
dvP.Initialize(Root, vx)
InfoWindowList.Add(vx)
Else
Dim vx As B4XView = InfoWindowList.get(Index -1)
vx.Visible = True
End If
End Sub
Sub CreateInfoWindow(Index As Int, Title As String, Text As String, ItemHeight As Int, ItemWidth As Int) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, ItemWidth, ItemHeight)
p.LoadLayout("infowindow")
Label1.Text = Title
Action1.Tag =Index
BBCodeView1.Text = Text
Return p
End Sub
Sub DvPanel_Action_Click
Dim vc As B4XView = Sender
Dim vx As B4XView = InfoWindowList.get(vc.Tag -1)
vx.Visible = False
End Sub