Sub ExportLayoutText(map1 As Map)
Dim frm As Form
frm.Initialize("frm",600,200)
Dim assets As String
assets=File.Combine(File.GetFileParent(File.DirApp),"Files")
If File.Exists(assets,"")=False Then
Return
End If
For Each filename As String In File.ListFiles(assets)
If filename.ToLowerCase.EndsWith(".bjl") Then
frm.RootPane.RemoveAllNodes
frm.RootPane.LoadLayout(Utils.GetFilenameWithoutExtension(filename))
If frm.Title<>"" Then
Dim transUnit As Map
transUnit.Initialize
transUnit.Put("type","Form Title")
transUnit.Put("note",filename)
transUnit.Put("text",frm.Title)
map1.Put(frm.Title.ToLowerCase,transUnit)
End If
For Each node As Object In frm.RootPane.GetAllViewsRecursive
Dim transUnit As Map
transUnit.Initialize
transUnit.Put("type",GetType(node))
transUnit.Put("note",filename)
Dim n As Node=node
If n Is TextArea Then
Dim ta As TextArea = n
transUnit.Put("text",ta.Text)
Else If n Is TextField Then
Dim tf As TextField = n
transUnit.Put("text",tf.Text)
Else if n Is Button Then
Dim btn As Button = n
transUnit.Put("text",btn.Text)
Else if n Is CheckBox Then
Dim cbx As CheckBox = n
transUnit.Put("text",cbx.Text)
Else If n Is RadioButton Then
Dim rbtn As RadioButton = n
transUnit.Put("text",rbtn.Text)
Else If n Is ToggleButton Then
Dim tbtn As ToggleButton = n
transUnit.Put("text",tbtn.Text)
Else If n Is Label Then
Dim lbl As Label = n
transUnit.Put("text",lbl.Text)
else if n Is ListView Then
Dim lv As ListView = n
If lv.ContextMenu.IsInitialized Then
ExportMenuItems(lv.ContextMenu.MenuItems,transUnit,map1)
End If
Continue
else if n Is MenuBar Then
Dim mb As MenuBar = n
ExportMenuItems(mb.Menus,transUnit,map1)
Continue
else if n Is TableView Then
Dim tv As TableView=n
ExportTableViewColumns(tv,transUnit,map1)
Continue
End If
If transUnit.ContainsKey("text") Then
Dim text As String=transUnit.Get("text")
map1.Put(text.ToLowerCase,transUnit)
End If
Next
End If
Next
End Sub