1. 왼쪽 마우스 버튼 처리
- (void) mouseDown:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
m_pImage->OnLButtonDown(CPoint(mouseLocationView.x, mouseLocationView.y));
- (void) mouseUp:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
m_pImage->OnLButtonUp(CPoint(mouseLocationView.x, mouseLocationView.y));
- (void) mouseDragged:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
m_pImage->OnMouseMove(CPoint(mouseLocationView.x, mouseLocationView.y));
2. 오른쪽 마우스 버튼 처리
- (void) rightMouseDown:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
m_pImage->OnRButtonDown(CPoint(mouseLocationView.x, mouseLocationView.y));
- (void) rightMouseDragged:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
m_pImage->OnMouseMove(CPoint(mouseLocationView.x, mouseLocationView.y));
- (void) rightMouseUp:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
m_pImage->OnRButtonUp(CPoint(mouseLocationView.x, mouseLocationView.y));
- (void) mouseDown:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
[self setNeedsDisplay:YES];
}{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
[self setNeedsDisplay:YES];
}{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
[self setNeedsDisplay:YES];
}2. 오른쪽 마우스 버튼 처리
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
[self setNeedsDisplay:YES];
}- (void) rightMouseDragged:(NSEvent *)theEvent
{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
[self setNeedsDisplay:YES];
}{
NSPoint mouseLocationWindow = [theEvent locationInWindow];
NSPoint mouseLocationView = [self convertPoint:mouseLocationWindow fromView:nil];
[self setNeedsDisplay:YES];
}
댓글 없음:
댓글 쓰기