Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Public WebView1 As WebView
Private html As String
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
NavControl.ToolBarVisible = True
html = File.ReadString(File.DirAssets, "webpage.html")
Page1.RootPanel.LoadLayout("LayoutWebView1")
WebView1.LoadHtml(html)
Dim b3, bspace As BarButton
bspace.InitializeSystem(bspace.ITEM_FLEXIBLE_SPACE, "")
b3.InitializeText("Change Font Size", "Font")
Page1.ToolbarButtons = Array(bspace, b3, bspace)
End Sub
Sub Page1_BarButtonClick (Tag As String)
If Tag = "Font" Then
WebView1.LoadHtml(html.Replace("body{font-size:medium;}", _
"body{font-size:x-large;}"))
End If
End Sub