#If OBJC
//Touch Event
-(void)tb: (float )X :(float )Y
{
CGPoint starPoint= CGPointMake(X, Y);
UIBezierPath *path=[UIBezierPath bezierPath];
[path setLineWidth:5];
[path setLineJoinStyle:kCGLineJoinRound];
[path setLineCapStyle:kCGLineCapRound];
[path moveToPoint:starPoint];
[paths addObject:path];
}
//touch move
-(void)touchesMoved1:(float )X :(float )Y
{
CGPoint movePoint=CGPointMake(X, Y);
UIBezierPath *currentPath=[paths lastObject];
[currentPath addLineToPoint:movePoint];
CGRect screenRect = [[UIScreen mainScreen] bounds];
[self drawRect1:screenRect];
}
//touch up
//-(void)touchesEnded:(CGFloat *)X :(CGFloat *)Y
//{
// [self touchesMoved:X:Y];
//}
//draw line
- (void)drawRect1:(CGRect)rect
{
for (UIBezierPath *path in paths) {
[path stroke];
}
}
#End If
Sub Panel1_Touch(Action As Int, X As Float, Y As Float)
' Dim pnl As Panel
' pnl = Sender
Select Action
Case 0 'down
Dim NativeMe As NativeObject = Panel1
NativeMe.RunMethod("tb::",Array(x,y))
isDown= True
Case 1 'up
isDown= False
' Dim NativeMe As NativeObject = Me
' NativeMe.RunMethod("touchesEnded::",Array(x,y))
Case 2 'move
If isDown Then
Dim NativeMe As NativeObject = Panel1
NativeMe.RunMethod("touchesMoved1::",Array(x,y))
End If
End Select
End Sub