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