Mercurial > projects > dwt-linux
comparison dwt/widgets/IME.d @ 261:edcf78db8722
fix compile errors for SWT 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 03 Jul 2008 21:20:33 +0200 |
parents | c0d810de7093 |
children |
comparison
equal
deleted
inserted
replaced
260:71a9cd1cf2e9 | 261:edcf78db8722 |
---|---|
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 *******************************************************************************/ | 10 *******************************************************************************/ |
11 module dwt.widgets.IME; | 11 module dwt.widgets.IME; |
12 | 12 |
13 import dwt.dwthelper.utils; | |
13 | 14 |
14 import dwt.DWT; | 15 import dwt.DWT; |
15 import dwt.DWTException; | 16 import dwt.DWTException; |
16 import dwt.graphics.Color; | 17 import dwt.graphics.Color; |
17 import dwt.graphics.TextStyle; | 18 import dwt.graphics.TextStyle; |
25 /** | 26 /** |
26 * Instances of this class represent input method editors. | 27 * Instances of this class represent input method editors. |
27 * These are typically in-line pre-edit text areas that allow | 28 * These are typically in-line pre-edit text areas that allow |
28 * the user to compose characters from Far Eastern languages | 29 * the user to compose characters from Far Eastern languages |
29 * such as Japanese, Chinese or Korean. | 30 * such as Japanese, Chinese or Korean. |
30 * | 31 * |
31 * <dl> | 32 * <dl> |
32 * <dt><b>Styles:</b></dt> | 33 * <dt><b>Styles:</b></dt> |
33 * <dd>(none)</dd> | 34 * <dd>(none)</dd> |
34 * <dt><b>Events:</b></dt> | 35 * <dt><b>Events:</b></dt> |
35 * <dd>ImeComposition</dd> | 36 * <dd>ImeComposition</dd> |
36 * </dl> | 37 * </dl> |
37 * <p> | 38 * <p> |
38 * IMPORTANT: This class is <em>not</em> intended to be subclassed. | 39 * IMPORTANT: This class is <em>not</em> intended to be subclassed. |
39 * </p> | 40 * </p> |
40 * | 41 * |
41 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | 42 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> |
42 * | 43 * |
43 * @since 3.4 | 44 * @since 3.4 |
44 */ | 45 */ |
45 public class IME : Widget { | 46 public class IME : Widget { |
46 Canvas parent; | 47 Canvas parent; |
47 int caretOffset; | 48 int caretOffset; |
62 * Constructs a new instance of this class given its parent | 63 * Constructs a new instance of this class given its parent |
63 * and a style value describing its behavior and appearance. | 64 * and a style value describing its behavior and appearance. |
64 * <p> | 65 * <p> |
65 * The style value is either one of the style constants defined in | 66 * The style value is either one of the style constants defined in |
66 * class <code>DWT</code> which is applicable to instances of this | 67 * class <code>DWT</code> which is applicable to instances of this |
67 * class, or must be built by <em>bitwise OR</em>'ing together | 68 * class, or must be built by <em>bitwise OR</em>'ing together |
68 * (that is, using the <code>int</code> "|" operator) two or more | 69 * (that is, using the <code>int</code> "|" operator) two or more |
69 * of those <code>DWT</code> style constants. The class description | 70 * of those <code>DWT</code> style constants. The class description |
70 * lists the style constants that are applicable to the class. | 71 * lists the style constants that are applicable to the class. |
71 * Style bits are also inherited from superclasses. | 72 * Style bits are also inherited from superclasses. |
72 * </p> | 73 * </p> |
118 /** | 119 /** |
119 * Returns the commit count of the composition. This is the | 120 * Returns the commit count of the composition. This is the |
120 * number of characters that have been composed. When the | 121 * number of characters that have been composed. When the |
121 * commit count is equal to the length of the composition | 122 * commit count is equal to the length of the composition |
122 * text, then the in-line edit operation is complete. | 123 * text, then the in-line edit operation is complete. |
123 * | 124 * |
124 * @return the commit count | 125 * @return the commit count |
125 * | 126 * |
126 * @exception DWTException <ul> | 127 * @exception DWTException <ul> |
127 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 128 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
128 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 129 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
129 * </ul> | 130 * </ul> |
130 * | 131 * |
131 * @see IME#getText | 132 * @see IME#getText |
132 */ | 133 */ |
133 public int getCommitCount () { | 134 public int getCommitCount () { |
134 checkWidget (); | 135 checkWidget (); |
135 return commitCount; | 136 return commitCount; |
166 * | 167 * |
167 * @exception DWTException <ul> | 168 * @exception DWTException <ul> |
168 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 169 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
169 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 170 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
170 * </ul> | 171 * </ul> |
171 * | 172 * |
172 * @see IME#getStyles | 173 * @see IME#getStyles |
173 */ | 174 */ |
174 public int [] getRanges () { | 175 public int [] getRanges () { |
175 checkWidget (); | 176 checkWidget (); |
176 if (ranges is null) return new int [0]; | 177 if (ranges is null) return new int [0]; |
187 * The ranges array contains start and end pairs. Each pair refers to | 188 * The ranges array contains start and end pairs. Each pair refers to |
188 * the corresponding style in the styles array. For example, the pair | 189 * the corresponding style in the styles array. For example, the pair |
189 * that starts at ranges[n] and ends at ranges[n+1] uses the style | 190 * that starts at ranges[n] and ends at ranges[n+1] uses the style |
190 * at styles[n/2]. | 191 * at styles[n/2]. |
191 * </p> | 192 * </p> |
192 * | 193 * |
193 * @return the ranges for the styles | 194 * @return the ranges for the styles |
194 * | 195 * |
195 * @exception DWTException <ul> | 196 * @exception DWTException <ul> |
196 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 197 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
197 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 198 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
198 * </ul> | 199 * </ul> |
199 * | 200 * |
200 * @see IME#getRanges | 201 * @see IME#getRanges |
201 */ | 202 */ |
202 public TextStyle [] getStyles () { | 203 public TextStyle [] getStyles () { |
203 checkWidget (); | 204 checkWidget (); |
204 if (styles is null) return new TextStyle [0]; | 205 if (styles is null) return new TextStyle [0]; |
231 /** | 232 /** |
232 * Returns <code>true</code> if the caret should be wide, and | 233 * Returns <code>true</code> if the caret should be wide, and |
233 * <code>false</code> otherwise. In some languages, for example | 234 * <code>false</code> otherwise. In some languages, for example |
234 * Korean, the caret is typically widened to the width of the | 235 * Korean, the caret is typically widened to the width of the |
235 * current character in the in-line edit session. | 236 * current character in the in-line edit session. |
236 * | 237 * |
237 * @return the wide caret state | 238 * @return the wide caret state |
238 * | 239 * |
239 * @exception DWTException <ul> | 240 * @exception DWTException <ul> |
240 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 241 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
241 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 242 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |