Browse Source

Added some sizing cursors

pull/372/head
Nikita Tsukanov 11 years ago
parent
commit
f85d68d580
  1. 32
      src/Gtk/Perspex.Gtk/CursorFactory.cs
  2. 10
      src/Perspex.Input/Cursors.cs
  3. 40
      src/Windows/Perspex.Win32/CursorFactory.cs

32
src/Gtk/Perspex.Gtk/CursorFactory.cs

@ -21,20 +21,28 @@ namespace Perspex.Gtk
private static readonly Dictionary<StandardCursorType, object> CursorTypeMapping = new Dictionary private static readonly Dictionary<StandardCursorType, object> CursorTypeMapping = new Dictionary
<StandardCursorType, object> <StandardCursorType, object>
{ {
{ StandardCursorType.AppStarting, CursorType.Watch }, {StandardCursorType.AppStarting, CursorType.Watch},
{ StandardCursorType.Arrow, CursorType.LeftPtr }, {StandardCursorType.Arrow, CursorType.LeftPtr},
{ StandardCursorType.Cross, CursorType.Cross }, {StandardCursorType.Cross, CursorType.Cross},
{ StandardCursorType.Hand, CursorType.Hand1 }, {StandardCursorType.Hand, CursorType.Hand1},
{ StandardCursorType.Ibeam, CursorType.Xterm }, {StandardCursorType.Ibeam, CursorType.Xterm},
{ StandardCursorType.No, Gtk.Stock.Cancel}, {StandardCursorType.No, Gtk.Stock.Cancel},
{ StandardCursorType.SizeAll, CursorType.Sizing }, {StandardCursorType.SizeAll, CursorType.Sizing},
//{ StandardCursorType.SizeNorthEastSouthWest, 32643 }, //{ StandardCursorType.SizeNorthEastSouthWest, 32643 },
{ StandardCursorType.SizeNorthSouth, CursorType.SbVDoubleArrow}, {StandardCursorType.SizeNorthSouth, CursorType.SbVDoubleArrow},
//{ StandardCursorType.SizeNorthWestSouthEast, 32642 }, //{ StandardCursorType.SizeNorthWestSouthEast, 32642 },
{ StandardCursorType.SizeWestEast, CursorType.SbHDoubleArrow }, {StandardCursorType.SizeWestEast, CursorType.SbHDoubleArrow},
{ StandardCursorType.UpArrow, CursorType.BasedArrowUp }, {StandardCursorType.UpArrow, CursorType.BasedArrowUp},
{ StandardCursorType.Wait, CursorType.Watch }, {StandardCursorType.Wait, CursorType.Watch},
{ StandardCursorType.Help, Gtk.Stock.Help } {StandardCursorType.Help, Gtk.Stock.Help},
{StandardCursorType.TopSide, CursorType.TopSide},
{StandardCursorType.BottomSize, CursorType.BottomSide},
{StandardCursorType.LeftSide, CursorType.LeftSide},
{StandardCursorType.RightSide, CursorType.RightSide},
{StandardCursorType.TopLeftCorner, CursorType.TopLeftCorner},
{StandardCursorType.TopRightCorner, CursorType.TopRightCorner},
{StandardCursorType.BottomLeftCorner, CursorType.BottomLeftCorner},
{StandardCursorType.BottomRightCorner, CursorType.BottomRightCorner}
}; };
private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache = private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache =

10
src/Perspex.Input/Cursors.cs

@ -30,7 +30,15 @@ namespace Perspex.Input
No, No,
Hand, Hand,
AppStarting, AppStarting,
Help Help,
TopSide,
BottomSize,
LeftSide,
RightSide,
TopLeftCorner,
TopRightCorner,
BottomLeftCorner,
BottomRightCorner
// Not available in GTK directly, see http://www.pixelbeat.org/programming/x_cursors/ // Not available in GTK directly, see http://www.pixelbeat.org/programming/x_cursors/
// We might enable them later, preferably, by loading pixmax direclty from theme with fallback image // We might enable them later, preferably, by loading pixmax direclty from theme with fallback image

40
src/Windows/Perspex.Win32/CursorFactory.cs

@ -23,22 +23,30 @@ namespace Perspex.Win32
private static readonly Dictionary<StandardCursorType, int> CursorTypeMapping = new Dictionary private static readonly Dictionary<StandardCursorType, int> CursorTypeMapping = new Dictionary
<StandardCursorType, int> <StandardCursorType, int>
{ {
{ StandardCursorType.AppStarting, 32650 }, {StandardCursorType.AppStarting, 32650},
{ StandardCursorType.Arrow, 32512 }, {StandardCursorType.Arrow, 32512},
{ StandardCursorType.Cross, 32515 }, {StandardCursorType.Cross, 32515},
{ StandardCursorType.Hand, 32649 }, {StandardCursorType.Hand, 32649},
{ StandardCursorType.Help, 32651 }, {StandardCursorType.Help, 32651},
{ StandardCursorType.Ibeam, 32513 }, {StandardCursorType.Ibeam, 32513},
{ StandardCursorType.No, 32648 }, {StandardCursorType.No, 32648},
{ StandardCursorType.SizeAll, 32646 }, {StandardCursorType.SizeAll, 32646},
{StandardCursorType.UpArrow, 32516},
// { StandardCursorType.SizeNorthEastSouthWest, 32643 }, {StandardCursorType.SizeNorthSouth, 32645},
{ StandardCursorType.SizeNorthSouth, 32645 }, {StandardCursorType.SizeWestEast, 32644},
{StandardCursorType.Wait, 32514},
// { StandardCursorType.SizeNorthWestSouthEast, 32642 }, //Same as SizeNorthSouth
{ StandardCursorType.SizeWestEast, 32644 }, {StandardCursorType.TopSide, 32645},
{ StandardCursorType.UpArrow, 32516 }, {StandardCursorType.BottomSize, 32645},
{ StandardCursorType.Wait, 32514 } //Same as SizeWestEast
{StandardCursorType.LeftSide, 32644},
{StandardCursorType.RightSide, 32644},
//Using SizeNorthWestSouthEast
{StandardCursorType.TopLeftCorner, 32642},
{StandardCursorType.BottomRightCorner, 32642},
//Using SizeNorthEastSouthWest
{StandardCursorType.TopRightCorner, 32643},
{StandardCursorType.BottomLeftCorner, 32643},
}; };
private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache = private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache =

Loading…
Cancel
Save