2007-04-25 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / Cursors.cs
index 08eb6a2ab47ce8b1d3d852dc80c431a91c5ca2a5..015888132eb0255845b8167368f7fef8ae58ca6a 100644 (file)
@@ -68,7 +68,8 @@ namespace System.Windows.Forms {
                public static Cursor AppStarting {
                        get {
                                if (app_starting == null) {
-                                       app_starting = new Cursor(XplatUI.DefineStdCursor(StdCursor.AppStarting));
+                                       app_starting = new Cursor(StdCursor.AppStarting);
+                                       app_starting.name = "AppStarting";
                                }
                                return app_starting;
                        }
@@ -77,7 +78,8 @@ namespace System.Windows.Forms {
                public static Cursor Arrow {
                        get {
                                if (arrow == null) {
-                                       arrow = new Cursor(XplatUI.DefineStdCursor(StdCursor.Arrow));
+                                       arrow = new Cursor(StdCursor.Arrow);
+                                       arrow.name = "Arrow";
                                }
                                return arrow;
                        }
@@ -86,7 +88,8 @@ namespace System.Windows.Forms {
                public static Cursor Cross {
                        get {
                                if (cross == null) {
-                                       cross = new Cursor(XplatUI.DefineStdCursor(StdCursor.Cross));
+                                       cross = new Cursor(StdCursor.Cross);
+                                       cross.name = "Cross";
                                }
                                return cross;
                        }
@@ -95,7 +98,8 @@ namespace System.Windows.Forms {
                public static Cursor Default {
                        get {
                                if (def == null) {
-                                       def = new Cursor(XplatUI.DefineStdCursor(StdCursor.Default));
+                                       def = new Cursor(StdCursor.Default);
+                                       def.name = "Default";
                                }
                                return def;
                        }
@@ -104,7 +108,8 @@ namespace System.Windows.Forms {
                public static Cursor Hand {
                        get {
                                if (hand == null) {
-                                       hand = new Cursor(XplatUI.DefineStdCursor(StdCursor.Hand));
+                                       hand = new Cursor(StdCursor.Hand);
+                                       hand.name = "Hand";
                                }
                                return hand;
                        }
@@ -113,7 +118,8 @@ namespace System.Windows.Forms {
                public static Cursor Help {
                        get {
                                if (help == null) {
-                                       help = new Cursor(XplatUI.DefineStdCursor(StdCursor.Help));
+                                       help = new Cursor(StdCursor.Help);
+                                       help.name = "Help";
                                }
                                return help;
                        }
@@ -122,7 +128,8 @@ namespace System.Windows.Forms {
                public static Cursor HSplit {
                        get {
                                if (hsplit == null) {
-                                       hsplit = new Cursor(XplatUI.DefineStdCursor(StdCursor.HSplit));
+                                       hsplit = new Cursor(typeof(Splitter), "SplitterNS.cur");
+                                       hsplit.name = "HSplit";
                                }
                                return hsplit;
                        }
@@ -131,7 +138,8 @@ namespace System.Windows.Forms {
                public static Cursor IBeam {
                        get {
                                if (ibeam == null) {
-                                       ibeam = new Cursor(XplatUI.DefineStdCursor(StdCursor.IBeam));
+                                       ibeam = new Cursor(StdCursor.IBeam);
+                                       ibeam.name = "IBeam";
                                }
                                return ibeam;
                        }
@@ -140,7 +148,8 @@ namespace System.Windows.Forms {
                public static Cursor No {
                        get {
                                if (no == null) {
-                                       no = new Cursor(XplatUI.DefineStdCursor(StdCursor.No));
+                                       no = new Cursor(StdCursor.No);
+                                       no.name = "No";
                                }
                                return no;
                        }
@@ -149,7 +158,8 @@ namespace System.Windows.Forms {
                public static Cursor NoMove2D {
                        get {
                                if (no_move_2d == null) {
-                                       no_move_2d = new Cursor(XplatUI.DefineStdCursor(StdCursor.NoMove2D));
+                                       no_move_2d = new Cursor(StdCursor.NoMove2D);
+                                       no_move_2d.name = "NoMove2D";
                                }
                                return no_move_2d;
                        }
@@ -158,7 +168,8 @@ namespace System.Windows.Forms {
                public static Cursor NoMoveHoriz {
                        get {
                                if (no_move_horiz == null) {
-                                       no_move_horiz = new Cursor(XplatUI.DefineStdCursor(StdCursor.NoMoveHoriz));
+                                       no_move_horiz = new Cursor(StdCursor.NoMoveHoriz);
+                                       no_move_horiz.name = "NoMoveHoriz";
                                }
                                return no_move_horiz;
                        }
@@ -167,7 +178,8 @@ namespace System.Windows.Forms {
                public static Cursor NoMoveVert {
                        get {
                                if (no_move_vert == null) {
-                                       no_move_vert = new Cursor(XplatUI.DefineStdCursor(StdCursor.NoMoveVert));
+                                       no_move_vert = new Cursor(StdCursor.NoMoveVert);
+                                       no_move_vert.name = "NoMoveVert";
                                }
                                return no_move_vert;
                        }
@@ -176,7 +188,8 @@ namespace System.Windows.Forms {
                public static Cursor PanEast {
                        get {
                                if (pan_east == null) {
-                                       pan_east = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanEast));
+                                       pan_east = new Cursor(StdCursor.PanEast);
+                                       pan_east.name = "PanEast";
                                }
                                return pan_east;
                        }
@@ -188,7 +201,8 @@ namespace System.Windows.Forms {
                public static Cursor PanNE {
                        get {
                                if (pan_ne == null) {
-                                       pan_ne = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanNE));
+                                       pan_ne = new Cursor(StdCursor.PanNE);
+                                       pan_ne.name = "PanNE";
                                }
                                return pan_ne;
                        }
@@ -198,7 +212,8 @@ namespace System.Windows.Forms {
                public static Cursor PanNorth {
                        get {
                                if (pan_north == null) {
-                                       pan_north = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanNorth));
+                                       pan_north = new Cursor(StdCursor.PanNorth);
+                                       pan_north.name = "PanNorth";
                                }
                                return pan_north;
                        }
@@ -207,7 +222,8 @@ namespace System.Windows.Forms {
                public static Cursor PanNW {
                        get {
                                if (pan_nw == null) {
-                                       pan_nw = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanNW));
+                                       pan_nw = new Cursor(StdCursor.PanNW);
+                                       pan_nw.name = "PanNW";
                                }
                                return pan_nw;
                        }
@@ -216,7 +232,8 @@ namespace System.Windows.Forms {
                public static Cursor PanSE {
                        get {
                                if (pan_se == null) {
-                                       pan_se = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanSE));
+                                       pan_se = new Cursor(StdCursor.PanSE);
+                                       pan_se.name = "PanSE";
                                }
                                return pan_se;
                        }
@@ -225,7 +242,8 @@ namespace System.Windows.Forms {
                public static Cursor PanSouth {
                        get {
                                if (pan_south == null) {
-                                       pan_south = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanSouth));
+                                       pan_south = new Cursor(StdCursor.PanSouth);
+                                       pan_south.name = "PanSouth";
                                }
                                return pan_south;
                        }
@@ -234,7 +252,8 @@ namespace System.Windows.Forms {
                public static Cursor PanSW {
                        get {
                                if (pan_sw == null) {
-                                       pan_sw = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanSW));
+                                       pan_sw = new Cursor(StdCursor.PanSW);
+                                       pan_sw.name = "PanSW";
                                }
                                return pan_sw;
                        }
@@ -243,7 +262,8 @@ namespace System.Windows.Forms {
                public static Cursor PanWest {
                        get {
                                if (pan_west == null) {
-                                       pan_west = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanWest));
+                                       pan_west = new Cursor(StdCursor.PanWest);
+                                       pan_west.name = "PanWest";
                                }
                                return pan_west;
                        }
@@ -252,7 +272,8 @@ namespace System.Windows.Forms {
                public static Cursor SizeAll {
                        get {
                                if (size_all == null) {
-                                       size_all = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeAll));
+                                       size_all = new Cursor(StdCursor.SizeAll);
+                                       size_all.name = "SizeAll";
                                }
                                return size_all;
                        }
@@ -261,7 +282,13 @@ namespace System.Windows.Forms {
                public static Cursor SizeNESW {
                        get {
                                if (size_nesw == null) {
-                                       size_nesw = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeNESW));
+                                       if (((int)Environment.OSVersion.Platform == 4) || ((int)Environment.OSVersion.Platform == 128)) {
+                                               size_nesw = new Cursor(typeof(Cursor), "NESW.cur");
+                                               size_nesw.name = "SizeNESW";
+                                       } else {
+                                               size_nesw = new Cursor(StdCursor.SizeNWSE);
+                                               size_nesw.name = "SizeNESW";
+                                       }
                                }
                                return size_nesw;
                        }
@@ -270,7 +297,8 @@ namespace System.Windows.Forms {
                public static Cursor SizeNS {
                        get {
                                if (size_ns == null) {
-                                       size_ns = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeNS));
+                                       size_ns = new Cursor(StdCursor.SizeNS);
+                                       size_ns.name = "SizeNS";
                                }
                                return size_ns;
                        }
@@ -279,7 +307,13 @@ namespace System.Windows.Forms {
                public static Cursor SizeNWSE {
                        get {
                                if (size_nwse == null) {
-                                       size_nwse = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeNWSE));
+                                       if (((int)Environment.OSVersion.Platform == 4) || ((int)Environment.OSVersion.Platform == 128)) {
+                                               size_nwse = new Cursor(typeof(Cursor), "NWSE.cur");
+                                               size_nwse.name = "SizeNWSE";
+                                       } else {
+                                               size_nwse = new Cursor(StdCursor.SizeNWSE);
+                                               size_nwse.name = "SizeNWSE";
+                                       }
                                }
                                return size_nwse;
                        }
@@ -288,7 +322,8 @@ namespace System.Windows.Forms {
                public static Cursor SizeWE {
                        get {
                                if (size_we == null) {
-                                       size_we = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeWE));
+                                       size_we = new Cursor(StdCursor.SizeWE);
+                                       size_we.name = "SizeWE";
                                }
                                return size_we;
                        }
@@ -297,7 +332,8 @@ namespace System.Windows.Forms {
                public static Cursor UpArrow {
                        get {
                                if (up_arrow == null) {
-                                       up_arrow = new Cursor(XplatUI.DefineStdCursor(StdCursor.UpArrow));
+                                       up_arrow = new Cursor(StdCursor.UpArrow);
+                                       up_arrow.name = "UpArrow";
                                }
                                return up_arrow;
                        }
@@ -306,7 +342,8 @@ namespace System.Windows.Forms {
                public static Cursor VSplit {
                        get {
                                if (vsplit == null) {
-                                       vsplit = new Cursor(XplatUI.DefineStdCursor(StdCursor.VSplit));
+                                       vsplit = new Cursor(typeof(Cursor), "SplitterWE.cur");
+                                       vsplit.name = "VSplit";
                                }
                                return vsplit;
                        }
@@ -315,7 +352,8 @@ namespace System.Windows.Forms {
                public static Cursor WaitCursor {
                        get {
                                if (wait_cursor == null) {
-                                       wait_cursor = new Cursor(XplatUI.DefineStdCursor(StdCursor.WaitCursor));
+                                       wait_cursor = new Cursor(StdCursor.WaitCursor);
+                                       wait_cursor.name = "WaitCursor";
                                }
                                return wait_cursor;
                        }