1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
23 // Peter Bartok pbartok@novell.com
29 namespace System.Windows.Forms {
30 public sealed class Cursors {
31 #region Local Variables
32 internal static Cursor app_starting;
33 internal static Cursor arrow;
34 internal static Cursor cross;
35 internal static Cursor def;
36 internal static Cursor hand;
37 internal static Cursor help;
38 internal static Cursor hsplit;
39 internal static Cursor ibeam;
40 internal static Cursor no;
41 internal static Cursor no_move_2d;
42 internal static Cursor no_move_horiz;
43 internal static Cursor no_move_vert;
44 internal static Cursor pan_east;
45 internal static Cursor pan_ne;
46 internal static Cursor pan_north;
47 internal static Cursor pan_nw;
48 internal static Cursor pan_se;
49 internal static Cursor pan_south;
50 internal static Cursor pan_sw;
51 internal static Cursor pan_west;
52 internal static Cursor size_all;
53 internal static Cursor size_nesw;
54 internal static Cursor size_ns;
55 internal static Cursor size_nwse;
56 internal static Cursor size_we;
57 internal static Cursor up_arrow;
58 internal static Cursor vsplit;
59 internal static Cursor wait_cursor;
60 #endregion // Local Variables
65 #endregion // Constructors
67 #region Public Static Properties
68 public static Cursor AppStarting {
70 if (app_starting == null) {
71 app_starting = new Cursor(XplatUI.DefineStdCursor(StdCursor.AppStarting));
72 app_starting.name = "AppStarting";
78 public static Cursor Arrow {
81 arrow = new Cursor(XplatUI.DefineStdCursor(StdCursor.Arrow));
88 public static Cursor Cross {
91 cross = new Cursor(XplatUI.DefineStdCursor(StdCursor.Cross));
98 public static Cursor Default {
101 def = new Cursor(XplatUI.DefineStdCursor(StdCursor.Default));
102 def.name = "Default";
108 public static Cursor Hand {
111 hand = new Cursor(XplatUI.DefineStdCursor(StdCursor.Hand));
118 public static Cursor Help {
121 help = new Cursor(XplatUI.DefineStdCursor(StdCursor.Help));
128 public static Cursor HSplit {
130 if (hsplit == null) {
131 hsplit = new Cursor(typeof(Splitter), "SplitterNS.cur");
132 hsplit.name = "HSplit";
138 public static Cursor IBeam {
141 ibeam = new Cursor(XplatUI.DefineStdCursor(StdCursor.IBeam));
142 ibeam.name = "IBeam";
148 public static Cursor No {
151 no = new Cursor(XplatUI.DefineStdCursor(StdCursor.No));
158 public static Cursor NoMove2D {
160 if (no_move_2d == null) {
161 no_move_2d = new Cursor(XplatUI.DefineStdCursor(StdCursor.NoMove2D));
162 no_move_2d.name = "NoMove2D";
168 public static Cursor NoMoveHoriz {
170 if (no_move_horiz == null) {
171 no_move_horiz = new Cursor(XplatUI.DefineStdCursor(StdCursor.NoMoveHoriz));
172 no_move_horiz.name = "NoMoveHoriz";
174 return no_move_horiz;
178 public static Cursor NoMoveVert {
180 if (no_move_vert == null) {
181 no_move_vert = new Cursor(XplatUI.DefineStdCursor(StdCursor.NoMoveVert));
182 no_move_vert.name = "NoMoveVert";
188 public static Cursor PanEast {
190 if (pan_east == null) {
191 pan_east = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanEast));
192 pan_east.name = "PanEast";
201 public static Cursor PanNE {
203 if (pan_ne == null) {
204 pan_ne = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanNE));
205 pan_ne.name = "PanNE";
212 public static Cursor PanNorth {
214 if (pan_north == null) {
215 pan_north = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanNorth));
216 pan_north.name = "PanNorth";
222 public static Cursor PanNW {
224 if (pan_nw == null) {
225 pan_nw = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanNW));
226 pan_nw.name = "PanNW";
232 public static Cursor PanSE {
234 if (pan_se == null) {
235 pan_se = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanSE));
236 pan_se.name = "PanSE";
242 public static Cursor PanSouth {
244 if (pan_south == null) {
245 pan_south = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanSouth));
246 pan_south.name = "PanSouth";
252 public static Cursor PanSW {
254 if (pan_sw == null) {
255 pan_sw = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanSW));
256 pan_sw.name = "PanSW";
262 public static Cursor PanWest {
264 if (pan_west == null) {
265 pan_west = new Cursor(XplatUI.DefineStdCursor(StdCursor.PanWest));
266 pan_west.name = "PanWest";
272 public static Cursor SizeAll {
274 if (size_all == null) {
275 size_all = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeAll));
276 size_all.name = "SizeAll";
282 public static Cursor SizeNESW {
284 if (size_nesw == null) {
285 if (((int)Environment.OSVersion.Platform == 4) || ((int)Environment.OSVersion.Platform == 128)) {
286 size_nesw = new Cursor(typeof(Cursor), "NESW.cur");
287 size_nesw.name = "SizeNESW";
289 size_nesw = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeNWSE));
290 size_nesw.name = "SizeNESW";
297 public static Cursor SizeNS {
299 if (size_ns == null) {
300 size_ns = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeNS));
301 size_ns.name = "SizeNS";
307 public static Cursor SizeNWSE {
309 if (size_nwse == null) {
310 if (((int)Environment.OSVersion.Platform == 4) || ((int)Environment.OSVersion.Platform == 128)) {
311 size_nwse = new Cursor(typeof(Cursor), "NWSE.cur");
312 size_nwse.name = "SizeNWSE";
314 size_nwse = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeNWSE));
315 size_nwse.name = "SizeNWSE";
322 public static Cursor SizeWE {
324 if (size_we == null) {
325 size_we = new Cursor(XplatUI.DefineStdCursor(StdCursor.SizeWE));
326 size_we.name = "SizeWE";
332 public static Cursor UpArrow {
334 if (up_arrow == null) {
335 up_arrow = new Cursor(XplatUI.DefineStdCursor(StdCursor.UpArrow));
336 up_arrow.name = "UpArrow";
342 public static Cursor VSplit {
344 if (vsplit == null) {
345 vsplit = new Cursor(typeof(Cursor), "SplitterWE.cur");
346 vsplit.name = "VSplit";
352 public static Cursor WaitCursor {
354 if (wait_cursor == null) {
355 wait_cursor = new Cursor(XplatUI.DefineStdCursor(StdCursor.WaitCursor));
356 wait_cursor.name = "WaitCursor";
361 #endregion // Public Static Properties