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
Private ScrollView1 As ScrollView
Private cvsPDF As Canvas
Private webview1 As WebView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title ="Hola"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
createpdf
webview1.Initialize("eventoweb")
' webview1.Visible=True
' webview1.ScaleToFit=True
' webview1.SetBorder(2,Colors.Red,2)
Log("Display document")
webview1.LoadUrl("file://" & File.Combine(File.DirLibrary, "mipdf.pdf"))
End Sub
Sub Delay(nMilliSecond As Long)
Dim nBeginTime As Long
Dim nEndTime As Long
nEndTime = DateTime.Now + nMilliSecond
nBeginTime = DateTime.Now
Do While nBeginTime < nEndTime
nBeginTime = DateTime.Now
'Log(nBeginTime)
If nEndTime < nBeginTime Then
Return
End If
'DoEvents
Loop
End Sub
Sub eventoweb_PageFinished (Success As Boolean, Url As String)
Log("Cargado "&Success&" " & Url)
Dim no As NativeObject = webview1
Delay(2000)
Log("Despues de delay")
no.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("window.scroll(0,500)"))
End Sub
Sub createpdf
Log("Creapdf")
' 612x792 es la resolución estándar de los documentos PDF
cvsPDF.InitializePDF(File.DirLibrary,"mipdf.pdf",612,792)
cvsPDF.DrawLine(0,0,500,500,Colors.Red,2)
cvsPDF.DrawLine(500,0,0,500,Colors.Green,0.5)
cvsPDF.Release
End Sub
Private Sub Application_Background
End Sub