Mercurial > projects > dwt-addons
annotate dwtx/ui/internal/forms/widgets/FormsResources.d @ 90:7ffeace6c47f
Update 3.4M7 to 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 06 Jul 2008 23:30:07 +0200 |
parents | 26c6c9dfd13c |
children |
rev | line source |
---|---|
75 | 1 /******************************************************************************* |
2 * Copyright (c) 2003, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.ui.internal.forms.widgets.FormsResources; | |
14 | |
15 import dwt.DWT; | |
16 import dwt.graphics.Cursor; | |
17 import dwt.widgets.Display; | |
18 | |
19 /** | |
20 * Utility methods to access shared form-specific resources. | |
21 * <p> | |
22 * All methods declared on this class are static. This | |
23 * class cannot be instantiated. | |
24 * </p> | |
25 * <p> | |
26 * </p> | |
27 */ | |
28 public class FormsResources { | |
29 private static Cursor busyCursor; | |
30 private static Cursor handCursor; | |
31 private static Cursor textCursor; | |
32 | |
33 public static Cursor getBusyCursor() { | |
77
26c6c9dfd13c
ui.forms compile, just FormTextModel with xml reimpl left todo
Frank Benoit <benoit@tionex.de>
parents:
75
diff
changeset
|
34 if (busyCursor is null) |
75 | 35 busyCursor = new Cursor(Display.getCurrent(), DWT.CURSOR_WAIT); |
36 return busyCursor; | |
37 } | |
38 public static Cursor getHandCursor() { | |
77
26c6c9dfd13c
ui.forms compile, just FormTextModel with xml reimpl left todo
Frank Benoit <benoit@tionex.de>
parents:
75
diff
changeset
|
39 if (handCursor is null) |
75 | 40 handCursor = new Cursor(Display.getCurrent(), DWT.CURSOR_HAND); |
41 return handCursor; | |
42 } | |
43 public static Cursor getTextCursor() { | |
77
26c6c9dfd13c
ui.forms compile, just FormTextModel with xml reimpl left todo
Frank Benoit <benoit@tionex.de>
parents:
75
diff
changeset
|
44 if (textCursor is null) |
75 | 45 textCursor = new Cursor(Display.getCurrent(), DWT.CURSOR_IBEAM); |
46 return textCursor; | |
47 } | |
48 | |
49 public static int getProgressDelay(int index) { | |
50 /* | |
90 | 51 if (progressDelays is null) |
75 | 52 return 0; |
53 return progressDelays[index]; | |
54 */ | |
55 return 100; | |
56 } | |
57 | |
58 public static void shutdown() { | |
59 if (busyCursor !is null) | |
60 busyCursor.dispose(); | |
61 if (handCursor !is null) | |
62 handCursor.dispose(); | |
63 if (textCursor !is null) | |
64 textCursor.dispose(); | |
65 busyCursor=null; | |
66 handCursor=null; | |
67 textCursor=null; | |
68 } | |
69 } |