'Code module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Private pg As Page
Private lstBD As TableView
End Sub
Sub pg_Appear
Main.NavControl.ToolBarVisible = False
End Sub
Public Sub Show
modBibleShow.strFrom = "bd"
If frmVerses.aloud.IsInitialized = True Then frmVerses.aloud.stop
Main.NavControl.ToolBarVisible = False
If pg.IsInitialized = False Then
pg.Initialize("pg")
pg.RootPanel.Color = Colors.White
lstBD.Initialize("lstBD", False)
pg.RootPanel.AddView(lstBD, 0, 5, 100%x, 95%y)
End If
Main.NavControl.ShowPage(pg)
RefreshBD
End Sub
Private Sub pg_Resize(Width As Int, Height As Int)
lstBD.SetLayoutAnimated(500, 0.6, 0, 0, 100%x, 95%y)
End Sub
Sub lstBD_SelectedChanged (SectionIndex As Int, Cell As TableCell)
' lets open a dictionary item
Dim sKey As String
sKey = "Bible Dictionary_" & Cell.tag
iStateManager.SetSetting("promise", sKey)
modBibleShow.EachChapter = False
modBibleShow.strFrom = "dictionary"
modBibleShow.strPromise = Cell.tag
frmVerses.Show
End Sub
Sub RefreshBD()
''modBibleShow.OpenDb
Dim sKey As String = iStateManager.GetSetting("dictionary")
Dim dMap As Map = b4iMash.Table_ReadToMap(modBibleShow.SQLite,"BibleDictionary","Key",sKey)
Dim sText As String = dMap.Get("text")
pg.Title = "Bible Dictionary - " & sText
'b4iMash.ShowProgress("Loading bible dictionary...")
lstBD.Clear
'lstBD.BeginUpdates
Dim cur As ResultSet
cur = b4iMash.Table_OpenRecordset(modBibleShow.SQLite, "select [Key],Text from BibleDictionary where Parent = '" & sKey & "' order by Text")
Do While cur.NextRow
Dim sKey As String: sKey = cur.GetString("Key")
Dim sText As String: sText = cur.GetString("Text")
b4iMash.AddSingleLine2(lstBD, sText, sKey)
Loop
'lstBD.EndUpdates
cur.close
'b4iMash.HideProgress
End Sub