Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private cvs As Canvas
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)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
cvs.Initialize(Page1.RootPanel)
End Sub
Sub Page1_Touch(Action As Int, X As Float, Y As Float)
If Action = Page1.RootPanel.ACTION_DOWN Then
Dim r As Rect
r.Initialize(X, Y, x + 200, Y + 100)
cvs.DrawPath(CreateOvalPath(r), Colors.Red, True, 1)
cvs.Refresh
End If
End Sub
Private Sub CreateOvalPath (r As Rect) As Path
Dim no As NativeObject = Me
Return no.RunMethod("createOvalPath:", Array(r))
End Sub
#if OBJC
- (UIBezierPath*) createOvalPath:(B4IRect*) r {
return [UIBezierPath bezierPathWithOvalInRect:r.ToCGRect];
}
#end if