Skip to content

Commit

Permalink
add crosshair mouse cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Nov 5, 2023
1 parent 75ea204 commit 5164aa0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions vstgui/lib/platform/linux/x11platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ uint32_t RunLoop::getCursorID (CCursorType cursor)
case kCursorNWSESize:
cursorID = makeCursor (impl->cursorContext, CursorNWSESizeNames);
break;
case kCursorCrosshair:
case kCursorSizeAll:
cursorID = makeCursor (impl->cursorContext, CursorSizeAllNames);
break;
Expand Down
1 change: 1 addition & 0 deletions vstgui/lib/platform/mac/cocoa/nsviewframe.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ static MouseEventButtonState buttonStateFromNSEvent (NSEvent* theEvent)
case kCursorNotAllowed: cur = [NSCursor performSelector:@selector(operationNotAllowedCursor)]; break;
case kCursorHand: cur = [NSCursor openHandCursor]; break;
case kCursorIBeam: cur = [NSCursor IBeamCursor]; break;
case kCursorCrosshair: cur = [NSCursor crosshairCursor]; break;
default: cur = [NSCursor arrowCursor]; break;
}
if (cur)
Expand Down
3 changes: 3 additions & 0 deletions vstgui/lib/platform/win32/win32frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ bool Win32Frame::setMouseCursor (CCursorType type)
case kCursorHand:
cursor = LoadCursor (nullptr, IDC_HAND);
break;
case kCursorCrosshair:
cursor = LoadCursor (nullptr, IDC_CROSS);
break;
default:
cursor = LoadCursor (nullptr, IDC_ARROW);
break;
Expand Down
2 changes: 2 additions & 0 deletions vstgui/lib/vstguifwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ enum CCursorType
kCursorHand,
/** i beam cursor */
kCursorIBeam,
/** crosshair cursor */
kCursorCrosshair,
};

//----------------------------
Expand Down

0 comments on commit 5164aa0

Please sign in to comment.