1
0
Fork 0

New cursor shapes.

Unfortunately OSG lacks the 'closed hand' (aka 'grab') cursor, really time to get platform cursor working reliably.
This commit is contained in:
James Turner 2013-03-10 12:05:14 +00:00
parent 0971ed1f2c
commit ead479532b
3 changed files with 12 additions and 3 deletions

View file

@ -45,9 +45,11 @@ NSCursor* cocoaCursorForKey(FGMouseCursor::Cursor aKey)
case FGMouseCursor::CURSOR_HAND: return [NSCursor pointingHandCursor]; case FGMouseCursor::CURSOR_HAND: return [NSCursor pointingHandCursor];
case FGMouseCursor::CURSOR_CROSSHAIR: return [NSCursor crosshairCursor]; case FGMouseCursor::CURSOR_CROSSHAIR: return [NSCursor crosshairCursor];
case FGMouseCursor::CURSOR_IBEAM: return [NSCursor IBeamCursor]; case FGMouseCursor::CURSOR_IBEAM: return [NSCursor IBeamCursor];
case FGMouseCursor::CURSOR_CLOSED_HAND: return [NSCursor closedHandCursor];
// FIXME - use a proper left-right cursor here. // FIXME - use a proper left-right cursor here.
case FGMouseCursor::CURSOR_LEFT_RIGHT: return [NSCursor resizeLeftRightCursor]; case FGMouseCursor::CURSOR_LEFT_RIGHT: return [NSCursor resizeLeftRightCursor];
case FGMouseCursor::CURSOR_UP_DOWN: return [NSCursor resizeUpDownCursor];
case FGMouseCursor::CURSOR_SPIN_CW: case FGMouseCursor::CURSOR_SPIN_CW:
path = [path stringByAppendingPathComponent:@"cursor-spin-cw.png"]; path = [path stringByAppendingPathComponent:@"cursor-spin-cw.png"];

View file

@ -105,10 +105,11 @@ private:
switch (aCursor) { switch (aCursor) {
case CURSOR_ARROW: return osgViewer::GraphicsWindow::RightArrowCursor; case CURSOR_ARROW: return osgViewer::GraphicsWindow::RightArrowCursor;
case CURSOR_HAND: return osgViewer::GraphicsWindow::HandCursor; case CURSOR_HAND: return osgViewer::GraphicsWindow::HandCursor;
case CURSOR_CLOSED_HAND: return osgViewer::GraphicsWindow::HandCursor;
case CURSOR_CROSSHAIR: return osgViewer::GraphicsWindow::CrosshairCursor; case CURSOR_CROSSHAIR: return osgViewer::GraphicsWindow::CrosshairCursor;
case CURSOR_IBEAM: return osgViewer::GraphicsWindow::TextCursor; case CURSOR_IBEAM: return osgViewer::GraphicsWindow::TextCursor;
case CURSOR_LEFT_RIGHT: return osgViewer::GraphicsWindow::LeftRightCursor; case CURSOR_LEFT_RIGHT: return osgViewer::GraphicsWindow::LeftRightCursor;
case CURSOR_UP_DOWN: return osgViewer::GraphicsWindow::UpDownCursor;
default: default:
return osgViewer::GraphicsWindow::RightArrowCursor; return osgViewer::GraphicsWindow::RightArrowCursor;
} }
@ -223,7 +224,12 @@ const MouseCursorMap mouse_cursor_map[] = {
{ "crosshair", FGMouseCursor::CURSOR_CROSSHAIR }, { "crosshair", FGMouseCursor::CURSOR_CROSSHAIR },
{ "left-right", FGMouseCursor::CURSOR_LEFT_RIGHT }, { "left-right", FGMouseCursor::CURSOR_LEFT_RIGHT },
{ "hand", FGMouseCursor::CURSOR_HAND }, { "hand", FGMouseCursor::CURSOR_HAND },
{ "closed-hand", FGMouseCursor::CURSOR_CLOSED_HAND },
{ "text", FGMouseCursor::CURSOR_IBEAM }, { "text", FGMouseCursor::CURSOR_IBEAM },
// aliases
{ "drag-horizontal", FGMouseCursor::CURSOR_LEFT_RIGHT },
{ "drag-vertical", FGMouseCursor::CURSOR_UP_DOWN },
{ 0, FGMouseCursor::CURSOR_ARROW } { 0, FGMouseCursor::CURSOR_ARROW }
}; };

View file

@ -33,7 +33,8 @@ public:
enum Cursor enum Cursor
{ {
CURSOR_ARROW, CURSOR_ARROW,
CURSOR_HAND, CURSOR_HAND, ///< the browser 'link' cursor
CURSOR_CLOSED_HAND,
CURSOR_CROSSHAIR, CURSOR_CROSSHAIR,
CURSOR_IBEAM, ///< for editing text CURSOR_IBEAM, ///< for editing text
CURSOR_IN_OUT, ///< arrow pointing into / out of the screen CURSOR_IN_OUT, ///< arrow pointing into / out of the screen