Mercurial > projects > dwt-mac
comparison dwt/events/TraverseEvent.d @ 34:5123b17c98ef
Ported dwt.events.*, dwt.graphics.GC, Region, dwt.internal.image.*
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sun, 14 Sep 2008 01:45:57 +0200 |
parents | 1a8b3cb347e0 |
children | 43be986a1372 |
comparison
equal
deleted
inserted
replaced
33:965ac0a77267 | 34:5123b17c98ef |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2006 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
10 *******************************************************************************/ | 12 *******************************************************************************/ |
11 module dwt.events.TraverseEvent; | 13 module dwt.events.TraverseEvent; |
12 | 14 |
13 import dwt.dwthelper.utils; | 15 import dwt.dwthelper.utils; |
14 | 16 |
15 | 17 |
16 import dwt.widgets.Event; | 18 import dwt.widgets.Event; |
19 import dwt.events.KeyEvent; | |
17 | 20 |
21 import tango.text.convert.Format; | |
18 /** | 22 /** |
19 * Instances of this class are sent as a result of | 23 * Instances of this class are sent as a result of |
20 * widget traversal actions. | 24 * widget traversal actions. |
21 * <p> | 25 * <p> |
22 * The traversal event allows fine control over keyboard traversal | 26 * The traversal event allows fine control over keyboard traversal |
73 * to <code>TRAVERSE_NONE</code>. | 77 * to <code>TRAVERSE_NONE</code>. |
74 * </p><p> | 78 * </p><p> |
75 * Note: A widget implementor will typically implement traversal using | 79 * Note: A widget implementor will typically implement traversal using |
76 * only the doit flag to either enable or disable system traversal. | 80 * only the doit flag to either enable or disable system traversal. |
77 * </p> | 81 * </p> |
78 * | 82 * |
79 * @see TraverseListener | 83 * @see TraverseListener |
84 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
80 */ | 85 */ |
81 | 86 |
82 public final class TraverseEvent : KeyEvent { | 87 public final class TraverseEvent : KeyEvent { |
83 | 88 |
84 /** | 89 /** |
85 * The traversal type. | 90 * The traversal type. |
86 * <p><ul> | 91 * <p><ul> |
87 * <li>{@link dwt.DWT#TRAVERSE_NONE}</li> | 92 * <li>{@link dwt.DWT#TRAVERSE_NONE}</li> |
88 * <li>{@link dwt.DWT#TRAVERSE_ESCAPE}</li> | 93 * <li>{@link dwt.DWT#TRAVERSE_ESCAPE}</li> |
93 * <li>{@link dwt.DWT#TRAVERSE_ARROW_PREVIOUS}</li> | 98 * <li>{@link dwt.DWT#TRAVERSE_ARROW_PREVIOUS}</li> |
94 * <li>{@link dwt.DWT#TRAVERSE_MNEMONIC}</li> | 99 * <li>{@link dwt.DWT#TRAVERSE_MNEMONIC}</li> |
95 * <li>{@link dwt.DWT#TRAVERSE_PAGE_NEXT}</li> | 100 * <li>{@link dwt.DWT#TRAVERSE_PAGE_NEXT}</li> |
96 * <li>{@link dwt.DWT#TRAVERSE_PAGE_PREVIOUS}</li> | 101 * <li>{@link dwt.DWT#TRAVERSE_PAGE_PREVIOUS}</li> |
97 * </ul></p> | 102 * </ul></p> |
98 * | 103 * |
99 * Setting this field will change the type of traversal. | 104 * Setting this field will change the type of traversal. |
100 * For example, setting the detail to <code>TRAVERSE_NONE</code> | 105 * For example, setting the detail to <code>TRAVERSE_NONE</code> |
101 * causes no traversal action to be taken. | 106 * causes no traversal action to be taken. |
102 * | 107 * |
103 * When used in conjunction with the <code>doit</code> field, the | 108 * When used in conjunction with the <code>doit</code> field, the |
104 * traversal detail field can be useful when overriding the default | 109 * traversal detail field can be useful when overriding the default |
105 * traversal mechanism for a control. For example, setting the doit | 110 * traversal mechanism for a control. For example, setting the doit |
106 * field to <code>false</code> will cancel the operation and allow | 111 * field to <code>false</code> will cancel the operation and allow |
107 * the traversal key stroke to be delivered to the control. Setting | 112 * the traversal key stroke to be delivered to the control. Setting |
108 * the doit field to <code>true</code> indicates that the traversal | 113 * the doit field to <code>true</code> indicates that the traversal |
109 * described by the detail field is to be performed. | 114 * described by the detail field is to be performed. |
110 */ | 115 */ |
111 public int detail; | 116 public int detail; |
112 | 117 |
113 static final long serialVersionUID = 3257565105301239349L; | 118 //static final long serialVersionUID = 3257565105301239349L; |
114 | 119 |
115 /** | 120 /** |
116 * Constructs a new instance of this class based on the | 121 * Constructs a new instance of this class based on the |
117 * information in the given untyped event. | 122 * information in the given untyped event. |
118 * | 123 * |
119 * @param e the untyped event containing the information | 124 * @param e the untyped event containing the information |
127 * Returns a string containing a concise, human-readable | 132 * Returns a string containing a concise, human-readable |
128 * description of the receiver. | 133 * description of the receiver. |
129 * | 134 * |
130 * @return a string representation of the event | 135 * @return a string representation of the event |
131 */ | 136 */ |
132 public String toString() { | 137 public override String toString() { |
133 String string = super.toString (); | 138 return Format( "{} detail={}}", super.toString[ 0 .. $-2 ], detail ); |
134 return string.substring (0, string.length() - 1) // remove trailing '}' | |
135 + " detail=" + detail | |
136 + "}"; | |
137 } | 139 } |
138 } | 140 } |